Repository navigation
Description
Problem Description
devops config audit-keys finds a plaintext secret in each config file that the settings merge, but no devops config command removes the secret from a file that is not the active config file. The alert of the audit says: "Migrate secrets to OS Keyring via 'devops config set ', and delete any key that is not a config option."
devops config set <key> <val>stores a credential in the keyring and writes no config file (save_settings(settings, keys=())). The plaintext value stays in each file that holds it, so the audit continues to fail.devops config unset <key>edits onlyget_active_config_path(). When a project config file is active, the command does not edit the global config file~/.config/devops-cli/config.yaml.
Thus, when the global config file holds a plaintext secret and a project config file is active, the person must find the file and edit it by hand. This is the usual case in the devcontainer, which sets DEVOPS_CLI_CONFIG.
Reproduction Steps
- Make a temporary
HOMEand a git repository in a temporary directory. Writeai:andapi_key: FAKE-2426-valueto$HOME/.config/devops-cli/config.yaml. - Write
log_level: INFOto.devcontainer/config.yamlin the repository. Do not setDEVOPS_CLI_CONFIG. - Set
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring, and rundevops config audit-keysin the repository. - Run
devops config unset ai.api_keyin the repository.
Expected vs Actual Behavior
Expected: the alert names a command that removes the plaintext value from the file that the leak names, and the audit passes after that command. For example, devops config unset can take the file of the leak, or devops config set of a credential can remove the plaintext value from each config file that the settings merge.
Actual: step 3 exits 1 and names the global file. Step 4 exits 1 with "The config file /.devcontainer/config.yaml does not hold the key 'ai.api_key'. Nothing changed." The global file keeps the value, and the audit continues to fail.
Environment Diagnostics
devops-cli 0.10.0 on the branch of #2426, which makes the audit scan the global config file and makes a leak name the full path of its file. PyYAML 6.0.3, Python 3.14.10, Linux.
Logs, Traces, or Terminal Output
Security Alert: Found plaintext secrets stored in config files: ['<tmp>/.config/devops-cli/config.yaml:ai.api_key']. Migrate secrets to OS Keyring via 'devops config set <key> <val>', and delete any key that is not a config option.
audit exit=1
The config file <tmp>/proj/.devcontainer/config.yaml does not hold the key 'ai.api_key'. Nothing changed.
unset exit=1
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: #2426
Proposed design
Problem statement
devops config audit-keys reports a plaintext secret in a config file, but devops config unset edits only the active config file. When the secret is in a different file, no command removes it. The user must find and edit the file by hand. This blocks the remediation the audit recommends.
Acceptance criteria
- Criterion 1: devops config unset --file removes the key from the named file.
Verification: Run devops config unset ai.api_key --file ~/.config/devops-cli/config.yaml in a repo where the project config is active. Confirm the key is gone from the named file. - Criterion 2: After the unset command, devops config audit-keys no longer reports that key in that file.
Verification: Run devops config audit-keys after the unset. Confirm exit code 0 and no alert for that key. - Criterion 3: The audit alert message names the --file option so the user knows how to remediate.
Verification: Run devops config audit-keys with a plaintext secret present. Confirm the alert text includes 'devops config unset --file '. - Criterion 4: devops config unset without --file still edits only the active config file.
Verification: Run devops config unset log_level in a repo with a project config active. Confirm only the project config file is edited.
Key questions
- How should the user target a specific config file for key removal?: Add a --file flag to devops config unset. When present, the command edits the named file instead of get_active_config_path(). When absent, behavior is unchanged. (best practice) [sources: docs/CONFIGURATION.md:8]
- Chosen: Add --file flag to unset. Explicit and targeted. The audit already names the file, so the user knows the path. No surprising side effects. Minimal change.
- Rejected: Make unset remove the key from all config files in the merge. Broader than needed. Could remove a key the user wants to keep in one file. Surprising side effect.
- Rejected: Make set also remove the plaintext from all config files. set is for storing a new value in the keyring. Adding file-deletion as a side effect is not obvious and couples two concerns.
- Should the audit alert message be updated to reference the new --file option?: Yes. The alert should say: 'Migrate secrets to OS Keyring via devops config set , and remove the key from the named file via devops config unset --file .' (proposed)
- Chosen: Update the alert to name --file. The alert is the user's only guidance. It must name a command that actually works for the reported file.
- Rejected: Leave the alert unchanged. The current text only names devops config set, which does not remove the plaintext. The user is left without a working command.
- What is the config file resolution order that the settings merge uses?: 1. The file DEVOPS_CLI_CONFIG names. 2. The user-level config at ~/.config/devops-cli/config.yaml. 3. The nearest project config (config.yaml, .devcontainer/config.yaml, .devops/config.yaml, .devops.yaml, or .devcontainer/.devops.yaml) from the working directory up to the repository root. [sources: docs/CONFIGURATION.md:8]
- Does devops config set write any config file?: No. devops config set calls save_settings(settings, keys=()), which stores the credential in the keyring and writes no config file. The plaintext value stays in each file that holds it. [sources: docs/CONFIGURATION.md:8]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
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.
The gap leaves plaintext secrets on disk and blocks the remediation the audit recommends.Users cannot remove a plaintext secret that the audit reports, which blocks security compliance.Users are stuck with plaintext secrets they cannot remove via the tool.Requires modifying unset or set to target a specific file or all merged config files.Both involve devops config audit-keys and plaintext secrets in config files, but #2511 fixes the audit's scan depth while the candidate fixes the removal command's file scope.docs(openspec): record the YAML errors and the leak path of audit-key…
docs(openspec): record the YAML errors and the leak path of audit-key…
docs(openspec): record the YAML errors and the leak path of audit-key…
devops-cli-service commentedon Oct 29, 2026
Status set to Ready at ef6e028 (see proposed design in issue body).
fix(config): the audit-keys alert names the removal commands (#2663)
chore(main): release 0.16.5 (#2671)