Skip to content

Commit

Permalink
Merge pull request #1884 from daemon1024/fix-apparmor-host
Browse files Browse the repository at this point in the history
fix(apparmor/host): sanitise profile name for from-source policy
  • Loading branch information
DelusionalOptimist authored Oct 30, 2024
2 parents 319b70c + bde11c9 commit 4731b3c
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 "/" "" | 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 "/" "" | replace "." "" }} {
{{$source}} rix,
{{template "pre-section" $value }}
{{template "file-section" $value}}
Expand Down

0 comments on commit 4731b3c

Please sign in to comment.