@@ -2339,20 +2339,19 @@ export async function writeConfigs(config: WrapperConfig): Promise<void> {
23392339 // Write audit artifacts (config snapshots for post-run forensics)
23402340 const auditDir = config . auditDir || path . join ( config . workDir , 'audit' ) ;
23412341 if ( ! fs . existsSync ( auditDir ) ) {
2342- // World-readable so gh-aw post-job scanners can access audit artifacts
2343- // (files are already secret-redacted, so 0o755 is safe)
2344- fs . mkdirSync ( auditDir , { recursive : true , mode : 0o755 } ) ;
2342+ // Restrictive permissions initially; made readable during cleanup (chmod a+rX)
2343+ fs . mkdirSync ( auditDir , { recursive : true , mode : 0o700 } ) ;
23452344 }
23462345
23472346 // Save squid.conf for audit (no secrets — just domain ACLs and proxy config)
2348- fs . writeFileSync ( path . join ( auditDir , 'squid.conf' ) , squidConfig , { mode : 0o644 } ) ;
2347+ fs . writeFileSync ( path . join ( auditDir , 'squid.conf' ) , squidConfig , { mode : 0o600 } ) ;
23492348
23502349 // Save redacted docker-compose.yml (strip env vars that may contain secrets)
23512350 const redactedCompose = redactDockerComposeSecrets ( dockerCompose ) ;
23522351 fs . writeFileSync (
23532352 path . join ( auditDir , 'docker-compose.redacted.yml' ) ,
23542353 yaml . dump ( redactedCompose , { lineWidth : - 1 } ) ,
2355- { mode : 0o644 }
2354+ { mode : 0o600 }
23562355 ) ;
23572356
23582357 // Generate and save policy manifest (structured description of all firewall rules)
@@ -2369,7 +2368,7 @@ export async function writeConfigs(config: WrapperConfig): Promise<void> {
23692368 fs . writeFileSync (
23702369 path . join ( auditDir , 'policy-manifest.json' ) ,
23712370 JSON . stringify ( policyManifest , null , 2 ) ,
2372- { mode : 0o644 }
2371+ { mode : 0o600 }
23732372 ) ;
23742373
23752374 logger . debug ( `Audit artifacts written to: ${ auditDir } ` ) ;
0 commit comments