Skip to content

Commit

Permalink
Merge pull request #224 from oneiro-naut/fix-213
Browse files Browse the repository at this point in the history
Change log action from Allow to Audit if its audit mode
  • Loading branch information
nam-jaehyun authored Jul 29, 2021
2 parents bf3be83 + c7a7682 commit 515b037
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions KubeArmor/feeder/policyMatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,14 @@ func (fd *Feeder) UpdateMatchedPolicy(log tp.Log) tp.Log {
return log
}
} else if log.Type == "MatchedPolicy" {
if log.PolicyEnabled == tp.KubeArmorPolicyAudited {
if log.Action == "Allow" {
log.Action = "Audit (Allow)"
} else if log.Action == "Block" {
log.Action = "Audit (Block)"
}
}

if log.Action == "Allow" && log.Result == "Passed" {
// use 'AllowWithAudit' to get the logs for allowed operations
return tp.Log{}
Expand Down

0 comments on commit 515b037

Please sign in to comment.