Skip to content

Commit 68d68fb

Browse files
scotwellsclaude
andcommitted
feat: add activity rules for system-created default DNS records
Add audit rules matching system:* users creating DNSRecordSet resources so that auto-created SOA and NS records appear in the activity timeline as "Default SOA record created for example.com" instead of being silently filtered out. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5934f1b commit 68d68fb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

config/milo/activity/policies/dnsrecordset-policy.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,16 @@ spec:
135135
match: "!audit.user.username.startsWith('system:') && audit.verb in ['update', 'patch'] && !has(audit.objectRef.subresource)"
136136
summary: "{{ actor }} updated {{ link('a DNS record', audit.objectRef) }}"
137137

138-
# Status subresource updates are system-initiated and typically not shown to users
139-
# - name: update-status
140-
# match: "!audit.user.username.startsWith('system:') && audit.verb in ['update', 'patch'] && audit.objectRef.subresource == 'status'"
141-
# summary: "System updated status of {{ link(audit.objectRef.name, audit.objectRef) }}"
138+
# ----- SYSTEM CREATE RULES -----
139+
# System-created records (SOA, NS) with display annotations
140+
- name: system-create-annotated
141+
match: "audit.user.username.startsWith('system:') && audit.verb == 'create' && has(audit.responseObject.metadata.annotations) && 'dns.networking.miloapis.com/display-name' in audit.responseObject.metadata.annotations && has(audit.requestObject.spec)"
142+
summary: "Default {{ audit.requestObject.spec.recordType }} record created for {{ link(audit.responseObject.metadata.annotations['dns.networking.miloapis.com/display-name'], audit.objectRef) }}"
143+
144+
# System-created records with spec but no display annotations
145+
- name: system-create-from-request
146+
match: "audit.user.username.startsWith('system:') && audit.verb == 'create' && has(audit.requestObject.spec)"
147+
summary: "Default {{ audit.requestObject.spec.recordType }} record created for {{ link(audit.objectRef.name, audit.objectRef) }}"
142148

143149
# Event rules for controller-emitted Kubernetes events.
144150
# These capture async outcomes that audit logs cannot represent.

0 commit comments

Comments
 (0)