Skip to content

fix(config): devops config audit-keys exits 1 when it finds a plaintext secret #1469

Description

@dan-petty

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.

Proposed remedy

  • Exit 1 whenever the audit finds a plaintext leak, in both table and --json output (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

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: Run devops config audit-keys against 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: Run devops config audit-keys --help and 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.

Activity

  1. added
    type/security
    scope/security
    scope/config
    source/agent
    on Oct 9, 2026
  2. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    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.

    • Priority: P2-Medium. 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.
    • Value: High. The primary purpose of the audit command is to fail CI on plaintext secrets; exiting 0 makes it useless in automated pipelines.
    • Effort: Low. Change the exit code to 1 on leak detection, update one test assertion, and adjust help text and docs.
  3. dan-petty commented on Oct 26, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

  4. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at cc34caa (see proposed design in issue body).

  5. added 3 commits that reference this issue on Oct 28, 2026
    ad0114f
    e2f2341
    1f9231d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/configscope/securitysource/agenttype/security

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions