File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1197,6 +1197,18 @@ func (c *complianceTester) validatePosixMounts(spec *rspec.Spec) error {
11971197 return mountErrs
11981198}
11991199
1200+ func (c * complianceTester ) validateApparmorProfile (spec * rspec.Spec ) error {
1201+ if spec .Process == nil || spec .Process .ApparmorProfile == "" {
1202+ c .harness .Skip (1 , "process.ApparmorProfile not set" )
1203+ return nil
1204+ }
1205+ profilePath := filepath .Join (spec .Root .Path , "/etc/apparmor.d" , spec .Process .ApparmorProfile )
1206+ _ , err := os .Stat (profilePath )
1207+ c .harness .Ok (err != nil , "has expected apparmorProfile" )
1208+
1209+ return nil
1210+ }
1211+
12001212func (c * complianceTester ) validateMountLabel (spec * rspec.Spec ) error {
12011213 if spec .Linux == nil || spec .Linux .MountLabel == "" {
12021214 c .harness .Skip (1 , "linux.mountlabel not set" )
@@ -1279,6 +1291,7 @@ func run(context *cli.Context) error {
12791291 c .validateUIDMappings ,
12801292 c .validateGIDMappings ,
12811293 c .validateMountLabel ,
1294+ c .validateApparmorProfile ,
12821295 }
12831296
12841297 validations := defaultValidations
You can’t perform that action at this time.
0 commit comments