Skip to content

Commit 9576d83

Browse files
authored
fix: revert audit permission change and clarify test comment
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/596b0f08-d1fb-468e-9115-70b3e4af8519
1 parent 63f4f87 commit 9576d83

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

scripts/ci/postprocess-smoke-workflows.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,11 @@ describe('issueDuplicationConclusionConcurrencyRegex', () => {
423423
' concurrency:\n' +
424424
' group: "gh-aw-conclusion-issue-duplication-detector-${{ github.event.issue.number || github.run_id }}"\n' +
425425
' cancel-in-progress: false\n';
426-
// The sentinel string is present in the already-updated content —
427-
// this means the transform would be skipped via the sentinel check.
426+
// The sentinel string is present in the already-updated content, so the
427+
// postprocess script skips the transform. Additionally, the regex itself
428+
// does NOT match the updated form because the closing quote is no longer
429+
// immediately after "issue-duplication-detector" — both guards agree.
428430
expect(alreadyUpdated.includes(issueDuplicationConclusionConcurrencySentinel)).toBe(true);
429-
// The regex itself still matches the suffix of the group name, but the
430-
// sentinel guard in the script prevents double-application.
431431
expect(issueDuplicationConclusionConcurrencyRegex.test(alreadyUpdated)).toBe(false);
432432
});
433433

src/docker-manager.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)