Skip to content

fix(security): devops config audit-keys scans the global config file that the settings merge #2426

Closed

Description

@dan-petty

Problem Description

devops config audit-keys does not scan the global config file ~/.config/devops-cli/config.yaml when DEVOPS_CLI_CONFIG is set or a project config file exists. The audit scans get_active_config_path(), which returns one layer only, plus config.yaml and .devops/config.yaml in the current directory. load_settings merges two layers: the global file and the project layer (_read_config_layers in src/devops_cli/config/settings.py). Thus a plaintext secret in the global file goes into the settings, but the audit reports the config compliant and exits 0. The devcontainer always sets DEVOPS_CLI_CONFIG (.devcontainer/devcontainer.json), so the audit never reads the global file there.

The command help says "Exits 1 when a config file holds a plaintext secret" (#1469). This case makes that statement false.

Reproduction Steps

  1. Use a temporary HOME and the null keyring (PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring).
  2. Write ai:\n api_key: <fake value> into $HOME/.config/devops-cli/config.yaml.
  3. Write a clean file clean.yaml (log_level: INFO), and set DEVOPS_CLI_CONFIG to its path.
  4. Run devops config audit-keys --json.

Expected vs Actual Behavior

Expected: the report lists the global file under scanned_config_files. It holds config.yaml:ai.api_key under plaintext_leaks and is_compliant: false, and the command exits 1.

Actual: load_settings().ai.api_key holds the fake value, but the command exits 0. The report holds is_compliant: true, an empty plaintext_leaks, and only clean.yaml under scanned_config_files.

Environment Diagnostics

Logs, Traces, or Terminal Output

$ devops config audit-keys --json   # exit 0
is_compliant: true
scanned_config_files: ['<tmp>/proj/clean.yaml']
plaintext_leaks: []

The review of PR #2401 found this defect. It was on main before that pull request. A possible repair: the audit scans each file that _read_config_layers reads, so audit_keys_cmd adds CONFIG_PATH to its scanned files.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #2401

Activity

  1. added
    source/agent
    type/security
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 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.

    • Type: type/security. A security audit tool reports false compliance because it skips the global config layer.
    • Priority: P2-Medium. The audit gives false security confidence in a specific but common configuration, but it requires a particular setup to trigger.
    • Value: Medium. Users relying on the audit for secret detection get a false pass when their global config holds a plaintext key.
    • Effort: Low. The fix adds one path to the scanned files list in 'audit_keys_cmd', as the candidate describes.
    • Related: fix(config): devops config audit-keys exits 1 when it finds a plaintext secret #1469, which asks for a different change. Both fix correctness of 'devops config audit-keys'; #1469 fixes the exit code on detection, the candidate fixes which files are scanned.
  3. added
    priority/p2-medium
    status/new
    value/medium
    effort/low
    on Oct 28, 2026
  4. added 18 commits that reference this issue on Oct 28, 2026
  5. added a commit that references this issue on Oct 28, 2026
    57541df
  6. removed
    status/new
    on Oct 30, 2026
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

    effort/lowpriority/p2-mediumsource/agenttype/securityvalue/medium

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions