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 {
1197
1197
return mountErrs
1198
1198
}
1199
1199
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
+
1200
1212
func (c * complianceTester ) validateMountLabel (spec * rspec.Spec ) error {
1201
1213
if spec .Linux == nil || spec .Linux .MountLabel == "" {
1202
1214
c .harness .Skip (1 , "linux.mountlabel not set" )
@@ -1279,6 +1291,7 @@ func run(context *cli.Context) error {
1279
1291
c .validateUIDMappings ,
1280
1292
c .validateGIDMappings ,
1281
1293
c .validateMountLabel ,
1294
+ c .validateApparmorProfile ,
1282
1295
}
1283
1296
1284
1297
validations := defaultValidations
You can’t perform that action at this time.
0 commit comments