Skip to content

Commit

Permalink
fix(apparmor/host): sanitise profile name for from-source policy
Browse files Browse the repository at this point in the history
Signed-off-by: daemon1024 <[email protected]>
  • Loading branch information
daemon1024 committed Oct 30, 2024
1 parent 319b70c commit 3b7abf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions KubeArmor/enforcer/appArmorTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
{{template "file-section" . }}
## == DISPATCHER START == ##
{{- range $source, $value:= $.FromSource}}
{{$source}} px -> {{$.Name}}-{{$source}},
{{$source}} px -> {{$v := $.Name | split "."}}{{$v._0}}_{{ $source | replace "/" "" }},
{{- end}}
{{- range $value, $data := .ProcessPaths}}
{{- $suffix := ""}}
Expand Down Expand Up @@ -146,7 +146,7 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
## == FromSource per binary profiles START == ##
{{- range $source, $value := $.FromSource}}
profile {{$.Name}}-{{$source}} {
profile {{$v := $.Name | split "."}}{{$v._0}}_{{ $source | replace "/" "" }} {
{{$source}} rix,
{{template "pre-section" $value }}
{{template "file-section" $value}}
Expand Down

0 comments on commit 3b7abf9

Please sign in to comment.