Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aa6dbec
fix(ci): redact sandboxed verification output
seonghobae Aug 5, 2026
06f1dcd
fix(ci): redact sandboxed web E2E output
seonghobae Aug 5, 2026
df52aa3
test(ci): cover secret-safe sandbox output
seonghobae Aug 5, 2026
014f30c
docs(doctoring): record sandbox log redaction boundary
seonghobae Aug 5, 2026
e165834
test(ci): require complete sandbox output redaction
seonghobae Aug 5, 2026
d71f133
fix(ci): redact every sandbox evidence publication sink
seonghobae Aug 5, 2026
27bb444
docs(ci): cover every sandbox evidence redaction sink
seonghobae Aug 5, 2026
f538053
test(ci): reject JSON-value credential disclosure
seonghobae Aug 5, 2026
4d61304
fix(ci): redact credential-shaped JSON values recursively
seonghobae Aug 5, 2026
03c9c94
test(ci): reject credential-shaped JSON object keys
seonghobae Aug 5, 2026
0fab425
fix(ci): redact credential-shaped JSON object keys
seonghobae Aug 5, 2026
87a6743
test(ci): bound assignment redaction scanning work
seonghobae Aug 5, 2026
5cf890b
perf(ci): make assignment redaction a bounded forward scan
seonghobae Aug 5, 2026
02d50bb
docs(ci): record recursive and bounded log redaction
seonghobae Aug 5, 2026
9f92c3d
build(security): align Strix dependency snapshots
seonghobae Aug 5, 2026
36f358d
docs(ci): record complete sandbox evidence redaction
seonghobae Aug 5, 2026
eb07d6b
test(ci): isolate provider-pattern JSON key coverage
seonghobae Aug 5, 2026
ea38588
test(ci): complete central redaction behavior coverage
seonghobae Aug 5, 2026
45dc74f
test(ci): require complete Authorization header redaction
seonghobae Aug 5, 2026
c832714
test(ci): preserve standalone auth scheme evidence safely
seonghobae Aug 5, 2026
13323b1
fix(ci): consume complete Authorization header values
seonghobae Aug 5, 2026
cb533a8
test(ci): cover complete redactor branch and entry contracts
seonghobae Aug 5, 2026
17d7d46
test(redaction): cover echoed separate secret options
seonghobae Aug 5, 2026
d4065bf
fix(redaction): scrub echoed separate secret options
seonghobae Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

All notable changes to the ContextualWisdomLab central GitHub control plane are documented in this file.

The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versioned releases follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Security

- Upgrade the central Strix dependency snapshots to `aiohttp==3.14.3`, `cryptography==50.0.0`, and the compatible `pyOpenSSL==26.4.0` closure so the hard dependency gates contain no known affected releases.
- Redact credentials from every sandbox evidence publication sink, including completed and timed-out process output, service log tails, commands, reviewer notes, nested JSON values, and JSON object keys.

### Fixed

- Replace quadratic sensitive-assignment rescanning with a bounded forward scan so one long ordinary diagnostic token cannot cause disproportionate log-processing work.

### Documentation

- Add an APA 7 doctoring record for the sandbox command/output redaction boundary, structured diagnostics, availability controls, verification evidence, limitations, and rollback requirements.
76 changes: 76 additions & 0 deletions docs/doctoring/sandboxed-command-log-redaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Sandboxed command and output redaction

## Decision

The central verification wrappers treat subprocess output, service log tails, command arguments, shell-command strings, and reviewer evidence notes as potentially sensitive before writing them to GitHub Actions logs or machine-readable review evidence.

One trusted redaction module owns this publication boundary:

- captured standard output and standard error are redacted before printing;
- `TimeoutExpired` byte and text payloads use the same redaction path;
- service log tails are redacted before publication;
- command arguments following sensitive options such as `--token`, `--password`, or `--api-key` are replaced;
- sensitive `KEY=value` command arguments are replaced while preserving the key;
- standalone provider-token shapes are removed;
- valid JSON is traversed recursively so credential-shaped object keys and string values cannot bypass line-oriented patterns;
- shell command strings are parsed without execution and reconstructed from redacted arguments; and
- JSON result markers redact commands and evidence notes before serialization.

The original argument vectors and output are used only inside the isolated execution boundary. Redaction changes neither the command that runs nor its exit status. It is applied at every publication sink instead of depending on each child process to avoid printing credentials.

## Threat model

Repository verification commands and web end-to-end services can emit credentials through exception messages, dependency-manager diagnostics, HTTP-client traces, command-line options, environment-derived configuration, startup logs, structured JSON diagnostics, and timeout payloads. An explicitly allowlisted environment variable can therefore remain correctly scoped to a child process and still be disclosed when that child echoes it.

GitHub Actions logs and review envelopes are durable evidence with a potentially broader readership than the originating credential. MITRE classifies insertion of sensitive information into log files as CWE-532. OWASP's current logging guidance identifies access tokens, passwords, database connection strings, encryption keys, and other primary secrets as values that should normally be removed, masked, sanitized, hashed, or encrypted before logging. NIST SSDF requires protection of software and development artifacts from unauthorized access and disclosure.

## Security and availability boundaries

- No provider-shaped credential literal is committed as a test fixture. Tests construct credential-shaped values from fragments at runtime so Secret Scan remains authoritative.
- Redaction is fail-closed for recognized sensitive option names, assignments, bearer/basic values, JWTs, and known provider token formats, but it is not a general data-loss-prevention engine.
- Sensitive option detection uses explicit credential terms. Ambiguous short flags such as `-p` are not guessed because they can mean port, path, project, or password depending on the child tool.
- Shell strings are tokenized with `shlex.split`; no shell is invoked for redaction. Malformed strings fall back to line-oriented redaction.
- `subprocess.run` and `subprocess.Popen` receive structured argument arrays with `shell=False`. Preventing shell interpretation and preventing log disclosure are independent controls.
- The assignment scanner advances through each ordinary identifier once. A deterministic instrumentation test prevents a long non-sensitive token from reintroducing quadratic rescanning and log-processing denial of service.
- File paths, working directories, and sandbox paths remain visible operational evidence. Operators must not place credentials in path names.
- Redaction preserves line boundaries and ordinary non-sensitive diagnostics. It does not transform a failed command into a successful result or suppress a nonzero exit status.

No formal OWASP, NIST, or CWE conformity is claimed.

## Verification contract

The focused regression suite constructs a credential-shaped token at runtime and proves that it does not appear in:

1. completed verification stdout or stderr;
2. timeout output supplied as bytes or text;
3. human-readable command displays;
4. JSON result-marker command arrays;
5. backend, frontend, or E2E shell-command fields;
6. reviewer evidence notes;
7. service log tails;
8. nested JSON string values; or
9. JSON object keys.

The tests also cover separate sensitive options, `--option=value`, `KEY=value` assignments, standalone provider-token shapes, malformed shell quoting, missing logs, bounded final-line selection, recursive JSON structures, bounded assignment scanning, and both wrappers' end-to-end publication paths. Ordinary text, line endings, result envelopes, cleanup, timeouts, and child-process exit codes remain observable.

The exact pull-request head must additionally pass the complete central unit suite, 100% production statement and branch coverage for the changed surface, production docstring checks, Secret Scan, CodeQL, Semgrep, Python Security, Security Scan, OpenCode, Noema, CodeRabbit, independent current-head approval, and branch protection before merge.

## Modular boundary

`sandboxed_verify.py`, `sandboxed_web_e2e.py`, and `redact_sensitive_log.py` remain independently executable scripts and reusable Python modules. Product repositories consume the behavior through the organization control plane without copying repository-local redaction code. The wrappers preserve their existing CLI and machine-readable result contracts.

## Rollback

Rollback must restore every publication sink as one atomic change. Removing only command redaction, JSON traversal, service-tail redaction, or result-envelope redaction would recreate a bypass around the remaining controls. Before rollback, operators must prove that no allowlisted credential can reach child output or command metadata and must retain equivalent focused regression evidence.

## APA 7 references

MITRE Corporation. (2026). *CWE-117: Improper output neutralization for logs* (CWE Version 4.20). https://cwe.mitre.org/data/definitions/117.html

MITRE Corporation. (2026). *CWE-532: Insertion of sensitive information into log file* (CWE Version 4.20). https://cwe.mitre.org/data/definitions/532.html

National Institute of Standards and Technology. (2022). *Secure software development framework (SSDF) version 1.1: Recommendations for mitigating the risk of software vulnerabilities* (NIST Special Publication 800-218). https://doi.org/10.6028/NIST.SP.800-218

OWASP Foundation. (n.d.). *Logging cheat sheet*. OWASP Cheat Sheet Series. Retrieved August 5, 2026, from https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html

Python Software Foundation. (2026). *subprocess—Subprocess management* (Python 3.14.6 documentation). https://docs.python.org/3/library/subprocess.html
Loading
Loading