Skip to content

Commit 4eaab0f

Browse files
authored
Merge pull request #263 from bytedance/unify-violations-level
Unify Violation Logs to Warn Level for Consistent Logging
2 parents de6ee53 + ffba379 commit 4eaab0f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/auditor/audit.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (auditor *Auditor) processAuditEvent(event string) {
9999
Str("profileName", profileName).
100100
Interface("event", e).Msg("violation event")
101101
case AuditAction:
102-
auditor.violationLogger.Debug().
102+
auditor.violationLogger.Warn().
103103
Interface("metadata", auditor.auditEventMetadata).
104104
Str("nodeName", auditor.nodeName).
105105
Str("podUID", info.PodUID).
@@ -122,7 +122,7 @@ func (auditor *Auditor) processAuditEvent(event string) {
122122
} else {
123123
// Only record the allowed event when the policy is in the DefenseInDepth mode.
124124
// This can reduce the noise in the violation log.
125-
auditor.violationLogger.Debug().
125+
auditor.violationLogger.Warn().
126126
Interface("metadata", auditor.auditEventMetadata).
127127
Str("nodeName", auditor.nodeName).
128128
Str("podUID", info.PodUID).
@@ -195,7 +195,7 @@ func (auditor *Auditor) processAuditEvent(event string) {
195195
// This can reduce the noise in the violation log.
196196
// The events of the policy in the DefenseInDepth or EnhanceProtect mode will
197197
// be recorded when no policy is being modeling.
198-
auditor.violationLogger.Debug().
198+
auditor.violationLogger.Warn().
199199
Interface("metadata", auditor.auditEventMetadata).
200200
Str("nodeName", auditor.nodeName).
201201
Str("podUID", info.PodUID).

pkg/auditor/bpf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func (auditor *Auditor) readFromAuditEventRingBuf() {
349349

350350
case bpfenforcer.AuditAction:
351351
// Write the violation event into the log file
352-
auditor.violationLogger.Debug().
352+
auditor.violationLogger.Warn().
353353
Interface("metadata", auditor.auditEventMetadata).
354354
Str("nodeName", auditor.nodeName).
355355
Str("podUID", auditor.containerCache[eventHeader.MntNs].PodUID).

0 commit comments

Comments
 (0)