Repository navigation
Safely collect redacted AWF resolved configuration artifacts - #69109
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot fix all failing ci checks |
There was a problem hiding this comment.
🟡 Changes recommended
Secret-redaction and runtime-packaging defects remain unresolved.
6 open findings
Add missing safe outputs redactor deployment dependencies · New Prevent uploads of rejected staging directories · New Redact escaped secret values in staged JSON · New Continue redaction after invalid AWF publication · New Regenerate golden fixtures for AWF config artifacts · New Add fail-closed AWF validation and cleanup regressions · New
What changed in this PR
Extends gh-aw’s artifact pipeline to collect AWF’s early resolved configuration for cleanup-failure diagnostics.
Changes:
- Adds source validation, redaction, and sanitized staging.
- Extends normal, fallback, and ARC/DinD artifact collection.
- Adds regression tests and documents compatibility.
| File | Description |
|---|---|
| pkg/workflow/compiler_yaml_post_agent.go | Adds configuration evidence to unified uploads. |
| pkg/workflow/compiler_yaml_artifacts.go | Includes evidence in fallback uploads. |
| pkg/workflow/compiler_artifacts_test.go | Checks expected artifact paths. |
| pkg/constants/constants.go | Defines sanitized staging paths. |
| docs/src/content/docs/reference/artifacts.md | Documents publication and compatibility requirements. |
| actions/setup/js/redact_secrets.test.cjs | Adds path, compatibility, and staging tests. |
| actions/setup/js/redact_secrets.cjs | Validates, sanitizes, and stages resolved configuration. |
🧠 Review effort: Max
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| const { collectAddMaskedValues, redactArtifactMaskedValues } = require("./add_mask_redaction.cjs"); | ||
| const { redactPiSessionHTML } = require("./pi_session_redaction.cjs"); | ||
| const { getOTLPSecretValues } = require("./otlp_header_helpers.cjs"); | ||
| const { redactSensitiveConfig } = require("./safe_outputs_config_redact.cjs"); |
There was a problem hiding this comment.
Added safe_outputs_config_redact.cjs to the session parser embed list; it was already present in MCP_SCRIPTS_FILES in setup.sh. The runtime packaging test passes. Fixed in 18a682d.
| function stageAWFResolvedConfig(sourcePath, secretValues, maskedValues) { | ||
| const existing = fs.lstatSync(AWF_RESOLVED_CONFIG_STAGING_PATH, { throwIfNoEntry: false }); | ||
| if (existing) { | ||
| if (!existing.isFile()) throw new Error(`${ERR_VALIDATION}: AWF resolved configuration staging path is not a file`); |
There was a problem hiding this comment.
Staging now recursively removes stale files/directories/symlinks without following links, and both unified and fallback uploads require successful redaction whenever the AWF artifact path is included. Cleanup failures therefore block uploads. Added regressions; fixed in 18a682d.
| } | ||
| const safeConfig = redactSensitiveConfig(parsed); | ||
| const serialized = JSON.stringify(safeConfig, null, 2); | ||
| const redacted = redactSecrets(redactBuiltInPatterns(redactArtifactMaskedValues(serialized, maskedValues)).content, secretValues).content; |
There was a problem hiding this comment.
The JSON-aware staging redactor now receives eligible secretValues as well as runtime masks; added a quote/backslash/newline secret regression. Fixed in 18a682d.
| let stagedResolvedConfig = false; | ||
| try { | ||
| stagedResolvedConfig = stageAWFResolvedConfig(process.env.AWF_RESOLVED_CONFIG, secretValues, maskedValues); | ||
| } catch (error) { | ||
| core.setFailed(`${ERR_VALIDATION}: AWF resolved configuration was not collected safely`); | ||
| core.warning(`AWF resolved configuration collection failed: ${getErrorMessage(error)}`); | ||
| return; | ||
| } | ||
| if (stagedResolvedConfig) { | ||
| core.info("Collected sanitized AWF resolved configuration"); | ||
| } else { | ||
| core.info("AWF did not publish an early resolved configuration artifact"); | ||
| } |
There was a problem hiding this comment.
Collection errors now remain visible, skip the misleading absent-publication message, and do not stop redaction of other artifacts. Uploads containing the AWF path are gated on redaction success. Added a main-path regression; fixed in 18a682d.
| paths = append(paths, constants.AWFReflectFilePathExpr) | ||
| } else { | ||
| paths = append(paths, constants.AWFConfigFilePath.String()) | ||
| paths = append(paths, constants.AWFResolvedConfigFilePath.String()) |
There was a problem hiding this comment.
Regenerated the native and wasm golden fixtures with make update-wasm-golden; the wasm golden tests now pass. Fixed in 18a682d.
| expect(fs.existsSync(AWF_RESOLVED_CONFIG_STAGING_PATH)).toBe(false); | ||
| }); | ||
|
|
||
| it("stages only sanitized configuration after validating the protected source", () => { |
There was a problem hiding this comment.
Added regressions for invalid ownership/modes, symlink/non-regular sources, hard links, inode/device changes, malformed JSON, stale-output cleanup, cleanup failure, and continued redaction of other artifacts. Fixed in 18a682d.
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 8f10371
|
|
@copilot fix failing CGO ci checks |
…-awf-config-artifact Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
The CGO failures were on the earlier |
|
🎉 This pull request is included in a new release. Release: |


AWF publishes early resolved configuration under a protected host path so diagnostics remain available when privileged cleanup fails. gh-aw now validates, redacts, stages, and collects that evidence without exposing raw configuration or weakening host/guest isolation.
Secure collection
/run/awf-config-audit/run-<id>/awf-resolved-config.jsonlayout.Redaction and failure handling
AWF_RESOLVED_CONFIG.Artifact integration
/tmp/gh-aw/awf-resolved-config.json.