Repository navigation
Labels
scope/configSettings, OS Keyring, environment variables, and defaultsscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaultsource/agentFiled by an agenttype/securityType security: a vulnerability or a leak
Description
Problem
Checked at release/v0.2.30 (edd2578). Follow-up to #1022 (PR #1461); the owner decided on 2026-10-09 that a confirmed leak fails the audit.
devops config audit-keysreports a plaintext secret (is_compliant: false, the key underplaintext_leaks) but exits 0.tests/test_config_audit_keys.py:62(test_config_audit_keys_plaintext_leak_detected) pins exit 0.- After fix(config): the secrets audit never prints a config line it cannot parse, and an unparsable file is not reported clean #1022, an unparsable config file makes the audit exit 1. So in CI or a pre-commit hook, a broken file fails the step while a confirmed plaintext secret passes.
Proposed remedy
- Exit 1 whenever the audit finds a plaintext leak, in both table and
--jsonoutput (the JSON is still printed in full first). Exit 0 only when the audit is compliant. - Update the test to pin exit 1, and the command's help and docs to say so.
Acceptance criteria
- A plaintext leak exits 1 with and without
--json; a compliant config exits 0; an unparsable file still exits 1 (fix(config): the secrets audit never prints a config line it cannot parse, and an unparsable file is not reported clean #1022). - The help text and generated docs state the exit codes.
Proposed design
Problem statement
The devops config audit-keys command exits 0 when it finds a plaintext secret. CI pipelines and pre-commit hooks that check the exit code pass even when a confirmed leak is present. After issue #1022, an unparsable config file exits 1, so a broken file fails while a confirmed secret passes. This is the wrong priority for a security audit.
Acceptance criteria
- Criterion 1: A plaintext leak exits 1 with and without
--json. A compliant config exits 0. An unparsable file still exits 1 per fix(config): the secrets audit never prints a config line it cannot parse, and an unparsable file is not reported clean #1022.
Verification: Rundevops config audit-keysagainst a config with a plaintext secret and confirm exit code 1. Run against a compliant config and confirm exit code 0. Run against an unparsable file and confirm exit code 1. - Criterion 2: The help text and generated docs state the exit codes.
Verification: Rundevops config audit-keys --helpand confirm the exit codes are stated. Check the generated docs for the same.
Key questions
- What exit code should the audit return when it finds a plaintext leak?: Exit 1. The owner decided on 2026-10-09 that a confirmed leak fails the audit. (proposed)
- Where is the exit code logic that needs to change?: src/devops_cli/commands/config.py, around line 733 where is_overall_compliant is computed and the result is returned. [sources: src/devops_cli/commands/config.py:733]
- Which test pins the current exit code?: tests/test_config_audit_keys.py:74, function test_config_audit_keys_plaintext_leak_detected, which pins exit 0. [sources: tests/test_config_audit_keys.py:74]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
scope/configSettings, OS Keyring, environment variables, and defaultsscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaultsource/agentFiled by an agenttype/securityType security: a vulnerability or a leak
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty-bot commentedon Oct 9, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
A security audit tool that passes CI despite finding a confirmed plaintext secret is a meaningful gap, but it is a tooling defect rather than an active vulnerability.The primary purpose of the audit command is to fail CI on plaintext secrets; exiting 0 makes it useless in automated pipelines.Change the exit code to 1 on leak detection, update one test assertion, and adjust help text and docs.dan-petty commentedon Oct 26, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The change affects security compliance and CI/CD pipeline reliability.Fixing the exit code ensures that plaintext leaks are properly reported and fail builds.The fix involves updating exit code logic and test assertions, which is low effort.Both items relate to secrets audit, but the candidate fixes exit codes while item #1024 removes false findings from review scanners.dan-petty commentedon Oct 27, 2026
Status set to Ready at cc34caa (see proposed design in issue body).
fix(config): exit 1 when audit-keys finds a plaintext secret (#2401)
chore(main): release 0.8.3 (#2403)
fix(security): refuse GCONV_PATH, SHELLOPTS, BASHOPTS and PS4 from a …