Repository navigation
Description
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
- Use a temporary
HOMEand the null keyring (PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring). - Write
ai:\n api_key: <fake value>into$HOME/.config/devops-cli/config.yaml. - Write a clean file
clean.yaml(log_level: INFO), and setDEVOPS_CLI_CONFIGto its path. - 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
- DevOps CLI Version: main at d739a47 (after fix(config): exit 1 when audit-keys finds a plaintext secret #2401)
- Python Version: 3.14.10
- OS & Architecture: Linux x86_64 (WSL2)
- Execution Environment: DevContainer
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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
A security audit tool reports false compliance because it skips the global config layer.The audit gives false security confidence in a specific but common configuration, but it requires a particular setup to trigger.Users relying on the audit for secret detection get a false pass when their global config holds a plaintext key.The fix adds one path to the scanned files list in 'audit_keys_cmd', as the candidate describes.Both fix correctness of 'devops config audit-keys'; #1469 fixes the exit code on detection, the candidate fixes which files are scanned.docs(openspec): plan the change 2426-audit-keys-scans-global-config
test(config): expect audit-keys to fail on a plaintext secret in the …
fix(config): devops config audit-keys scans each config file that the…
docs(config): the help of devops config audit-keys names the files th…
test(config): write the global config file in the worker HOME, not a …
test(config): expect audit-keys to report a config file that the YAML…
docs(openspec): plan the change 2426-audit-keys-scans-global-config
test(config): expect audit-keys to fail on a plaintext secret in the …
fix(config): devops config audit-keys scans each config file that the…
docs(config): the help of devops config audit-keys names the files th…
test(config): write the global config file in the worker HOME, not a …
test(config): expect audit-keys to report a config file that the YAML…
docs(openspec): plan the change 2426-audit-keys-scans-global-config
test(config): expect audit-keys to fail on a plaintext secret in the …
fix(config): devops config audit-keys scans each config file that the…
docs(config): the help of devops config audit-keys names the files th…
test(config): write the global config file in the worker HOME, not a …
test(config): expect audit-keys to report a config file that the YAML…
fix(config): devops config audit-keys scans each config file that the…