File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -270,8 +270,8 @@ describe('docker-manager', () => {
270270 const agent = result . services . agent ;
271271 const volumes = agent . volumes as string [ ] ;
272272
273- // Should NOT include blanket /:/host:ro mount
274- expect ( volumes ) . not . toContain ( '/:/host:ro' ) ;
273+ // Should STILL include /:/host:ro mount for chroot functionality
274+ expect ( volumes ) . toContain ( '/:/host:ro' ) ;
275275
276276 // Should include custom mounts
277277 expect ( volumes ) . toContain ( '/workspace:/workspace:ro' ) ;
@@ -282,12 +282,12 @@ describe('docker-manager', () => {
282282 expect ( volumes . some ( ( v : string ) => v . includes ( 'agent-logs' ) ) ) . toBe ( true ) ;
283283 } ) ;
284284
285- it ( 'should use blanket mount when no custom mounts specified ' , ( ) => {
285+ it ( 'should always include /:/host:ro mount for chroot functionality ' , ( ) => {
286286 const result = generateDockerCompose ( mockConfig , mockNetworkConfig ) ;
287287 const agent = result . services . agent ;
288288 const volumes = agent . volumes as string [ ] ;
289289
290- // Should include blanket /:/host:ro mount
290+ // Should include /:/host:ro mount
291291 expect ( volumes ) . toContain ( '/:/host:ro' ) ;
292292 } ) ;
293293
Original file line number Diff line number Diff line change @@ -355,12 +355,13 @@ export function generateDockerCompose(
355355 config . volumeMounts . forEach ( mount => {
356356 agentVolumes . push ( mount ) ;
357357 } ) ;
358- } else {
359- // If no custom mounts specified, include blanket host filesystem mount for backward compatibility
360- logger . debug ( 'No custom mounts specified, using blanket /:/host:ro mount' ) ;
361- agentVolumes . unshift ( '/:/host:ro' ) ;
362358 }
363359
360+ // Always include /:/host:ro mount for isolate.sh chroot functionality
361+ // This is added regardless of custom mounts to ensure commands can fall back to host binaries
362+ logger . debug ( 'Adding /:/host:ro mount for chroot functionality' ) ;
363+ agentVolumes . unshift ( '/:/host:ro' ) ;
364+
364365 // Agent service configuration
365366 const agentService : any = {
366367 container_name : 'awf-agent' ,
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ export interface WrapperConfig {
180180 * - 'host_path:container_path:rw' (read-write)
181181 *
182182 * These are in addition to essential mounts (Docker socket, HOME, /tmp).
183- * The blanket /:/host:ro mount is removed when custom mounts are specified .
183+ * The /:/host:ro mount is always included for chroot functionality .
184184 *
185185 * @example ['/workspace:/workspace:ro', '/data:/data:rw']
186186 */
You can’t perform that action at this time.
0 commit comments