Skip to content

Commit

Permalink
Handle readonly File violation corner case for Audit mode
Browse files Browse the repository at this point in the history
Fixes: #213

Signed-off-by: Ayush Dwivedi <ayush.dwivedi@accuknox.com>
  • Loading branch information
oneiro-naut committed Jul 28, 2021
1 parent 490bb56 commit 60333f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion KubeArmor/feeder/policyMatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ func (fd *Feeder) UpdateMatchedPolicy(log tp.Log) tp.Log {

log.Type = "MatchedPolicy"
log.Action = secPolicy.Action

}
}
}
Expand Down Expand Up @@ -908,7 +909,7 @@ func (fd *Feeder) UpdateMatchedPolicy(log tp.Log) tp.Log {
return log
}
} else if log.Type == "MatchedPolicy" {
if log.Action == "Allow" && log.Result == "Passed" {
if log.PolicyEnabled != tp.KubeArmorPolicyAudited && log.Action == "Allow" && log.Result == "Passed" {
// use 'AllowWithAudit' to get the logs for allowed operations
return tp.Log{}
}
Expand Down

0 comments on commit 60333f3

Please sign in to comment.