Skip to content

Commit

Permalink
Merge pull request #1708 from daemon1024/suppress-dp-alerts
Browse files Browse the repository at this point in the history
fix(enforcer): suppress permission denied alerts for any non bpflsm enforcer
  • Loading branch information
DelusionalOptimist authored Apr 5, 2024
2 parents cdfe3f8 + 86aae6f commit e03a381
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions KubeArmor/feeder/feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ func (fd *Feeder) PushLog(log tp.Log) {
in case of enforcer = AppArmor only Default Posture logs will be converted to
container/host log depending upon the defaultPostureLogs flag
*/
if (cfg.GlobalCfg.EnforcerAlerts && fd.Enforcer == "BPFLSM" && log.Enforcer != "BPFLSM") || (fd.Enforcer == "AppArmor" && !cfg.GlobalCfg.DefaultPostureLogs) {
if (cfg.GlobalCfg.EnforcerAlerts && fd.Enforcer == "BPFLSM" && log.Enforcer != "BPFLSM") || (fd.Enforcer != "BPFLSM" && !cfg.GlobalCfg.DefaultPostureLogs) {
log = fd.UpdateMatchedPolicy(log)
if (log.Type == "MatchedPolicy" || log.Type == "MatchedHostPolicy") && ((fd.Enforcer == "BPFLSM" && (strings.Contains(log.PolicyName, "DefaultPosture") || !strings.Contains(log.Action, "Audit"))) || (fd.Enforcer == "AppArmor" && strings.Contains(log.PolicyName, "DefaultPosture"))) {
if (log.Type == "MatchedPolicy" || log.Type == "MatchedHostPolicy") && ((fd.Enforcer == "BPFLSM" && (strings.Contains(log.PolicyName, "DefaultPosture") || !strings.Contains(log.Action, "Audit"))) || (fd.Enforcer != "BPFLSM" && strings.Contains(log.PolicyName, "DefaultPosture"))) {
if log.Type == "MatchedPolicy" {
log.Type = "ContainerLog"
} else if log.Type == "MatchedHostPolicy" {
Expand Down

0 comments on commit e03a381

Please sign in to comment.