@@ -114,10 +114,10 @@ describe("Docker runtime security", () => {
114114 } ) ;
115115 const callerPathInvoked = existsSync ( tracePath ) ;
116116 await rm ( fixtureDirectory , { recursive : true } ) ;
117- const capAddBlock = / ^ \s { 4 } c a p _ a d d : \n ( (?: \s { 6 } - \s + " [ A - Z ] + " \n ) + ) / mu. exec (
117+ const capAddBlock = / ^ \s { 4 } c a p _ a d d : \n ( (?: \s { 6 } - \s + " [ A - Z _ ] + " \n ) + ) / mu. exec (
118118 compose ,
119119 ) ;
120- const startupCapabilities = capAddBlock ?. [ 1 ] ?. match ( / [ A - Z ] + / gu) ?? [ ] ;
120+ const startupCapabilities = capAddBlock ?. [ 1 ] ?. match ( / [ A - Z _ ] + / gu) ?? [ ] ;
121121 const dockerMarkers = [
122122 "COPY scripts/container-entrypoint.sh /usr/local/bin/container-entrypoint.sh" ,
123123 "chmod 0755 /usr/local/bin/container-entrypoint.sh" ,
@@ -148,9 +148,15 @@ describe("Docker runtime security", () => {
148148 [ ...bootstrapMarkers ] . sort ( ( left , right ) => left - right ) ,
149149 ) ;
150150
151- // Linux clears permitted/effective capabilities on uid 0 -> 1000;
151+ // DAC_OVERRIDE is consumed only to read Docker's root-owned file secret.
152+ // Linux then clears permitted/effective capabilities on uid 0 -> 1000;
152153 // no-new-privileges and the absence of file capabilities prevent reacquisition.
153- expect ( startupCapabilities ) . toEqual ( [ "CHOWN" , "SETUID" , "SETGID" ] ) ;
154+ expect ( startupCapabilities ) . toEqual ( [
155+ "CHOWN" ,
156+ "SETUID" ,
157+ "SETGID" ,
158+ "DAC_OVERRIDE" ,
159+ ] ) ;
154160 expect ( compose ) . toMatch ( / ^ \s { 4 } c a p _ d r o p : \n \s { 6 } - " A L L " $ / mu) ;
155161 expect ( compose ) . toMatch (
156162 / ^ \s { 4 } s e c u r i t y _ o p t : \n \s { 6 } - " n o - n e w - p r i v i l e g e s : t r u e " $ / mu,
0 commit comments