Repository navigation
Closed
Labels
Description
Friction
- Two planned items need a GitHub App private key in the keyring: the roadmap jobs' App identity (intake-service-identity.md) and Argo CD's deployment records (feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387, re-scoped to Argo CD's own GitHub notifier).
- A GitHub App private key is a multi-line PEM block.
devops config setcan only take a secret on argv or at a one-line hidden prompt. - Pasting a PEM key at that prompt stores only its first line. The other lines reach the shell as commands and land in shell history. Passing it on argv puts the key in the process list, which the command was built to avoid.
Evidence
Checked at main 3dd7fa6.
_value_or_prompt(src/devops_cli/commands/config.py:173-183) returns the argv value ortyper.prompt(..., hide_input=True), which reads one line.dotted_set(src/devops_cli/config/settings.py:1294-1302) writes a key to the keyring only when it is in_SECRET_FIELDS(settings.py:103, fromSECRET_CONFIG_OPTIONSatsrc/devops_cli/config/options.py:228). Any other key is a plain setting or an error.- The cluster push reads keyring values through
KeyringSource(src/devops_cli/k8s/cluster_secrets.py:34), so a multi-line value stored correctly reaches a Kubernetes Secret unchanged. - Nothing under
src/reads a secret from a file or from stdin today.
Remedy
devops config set <secret-key> --from-file <path>reads the value from the file, and--from-file -reads stdin until EOF. The value never appears in argv, in output or in logs.- The option is accepted only for keys in
_SECRET_FIELDS. For any other key, or together with a positional value, it exits 2 with a message naming the problem. - The file is read as text, one trailing newline is kept as the file has it, and an empty value is refused.
- Size is capped (a constant in
config/constants.py, well above a 4096-bit PEM key), so a wrong path cannot load a large file into the keyring. - The help text and the configuration docs show the PEM case.
- Priority under the owner's blocker rule (2026-10-17): P0 if the GitHub App identity item is filed (D2 = A), because it blocks that P0 item. Otherwise no rule-driven raise: its other dependent, feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387, has no priority label.
Acceptance criteria
- Tests first, offline, with an in-memory keyring:
- a three-line PEM-shaped value from a
tmp_pathfile and from stdin is stored byte for byte; --from-filewith a non-secret key, with a positional value, with an empty file and with an oversize file each exit 2 and store nothing;- the value appears in no captured output.
- a three-line PEM-shaped value from a
-
devops docs generate --sync-readmeoutput is committed, anddevops docs checkpasses. -
uv run devops cipasses.
Related
- Needed by: the GitHub App identity item (intake-service-identity.md) and feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 after its re-scope.
- chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562.
Proposed design
Problem statement
The current devops config set command only supports single-line secret inputs via command-line arguments or a one-line hidden prompt. This is insecure and inadequate for multi-line secrets like PEM private keys, which are commonly needed for GitHub App identities and Argo CD deployments.
Acceptance criteria
- Criterion 1: A three-line PEM-shaped value from a file is stored byte for byte in the keyring
Verification: Run offline tests with an in-memory keyring that verifies the exact bytes of a multi-line secret read from a temporary file - Criterion 2: A multi-line secret from stdin is stored byte for byte in the keyring
Verification: Run offline tests with an in-memory keyring that verifies the exact bytes of a multi-line secret read from stdin - Criterion 3: Using --from-file with a non-secret key exits 2 and stores nothing
Verification: Executedevops config set regular-key --from-file /tmp/testand confirm exit code 2 with no value stored - Criterion 4: Using --from-file together with a positional value exits 2 and stores nothing
Verification: Executedevops config set secret-key test-value --from-file /tmp/testand confirm exit code 2 with no value stored - Criterion 5: Using --from-file with an empty file exits 2 and stores nothing
Verification: Create an empty file, rundevops config set secret-key --from-file /tmp/empty, and confirm exit code 2 with no value stored - Criterion 6: Using --from-file with an oversize file exits 2 and stores nothing
Verification: Create a file larger than the defined size limit, rundevops config set secret-key --from-file /tmp/large, and confirm exit code 2 with no value stored - Criterion 7: The secret value appears in no captured output
Verification: Run command with --from-file and check that no part of the secret appears in stdout, stderr or logs - Criterion 8: The generated documentation includes help text for the new --from-file option
Verification: Rundevops docs generate --sync-readmeand verify that the help text for config set includes examples with --from-file - Criterion 9: Running
devops docs checkpasses
Verification: Executedevops docs checkafter generating documentation and confirm all checks pass - Criterion 10: A changelog fragment exists for the issue
Verification: Confirm that a file namedchangelog.d/1649.mdexists with appropriate content describing the feature - Criterion 11: Running
uv run devops cipasses
Verification: Execute the CI pipeline and confirm all checks pass including unit tests for the new functionality
Key questions
- What is the maximum size allowed for files read by --from-file?: The size is capped by a constant in config/constants.py, well above a 4096-bit PEM key. [sources: src/devops_cli/config/constants.py]
- Which keys are considered secret fields that can use --from-file?: Only keys in _SECRET_FIELDS, which is derived from SECRET_CONFIG_OPTIONS in src/devops_cli/config/options.py. [sources: src/devops_cli/config/settings.py:104, src/devops_cli/config/options.py:228]
- How does the command handle reading from stdin when --from-file - is specified?: When --from-file - is used, it reads from stdin until EOF. [sources: src/devops_cli/commands/config.py:173-183]
- What happens if someone tries to use --from-file with a non-secret key?: The command exits 2 with an error message naming the problem. [sources: src/devops_cli/commands/config.py:180]
- What happens if someone tries to use --from-file together with a positional value?: The command exits 2 with an error message naming the problem. [sources: src/devops_cli/commands/config.py:197]
- How does the file reading process handle trailing newlines?: The file is read as text, one trailing newline is kept as the file has it. [sources: src/devops_cli/commands/config.py:173-183]
- How does the command validate that a file is not empty?: An empty value is refused, so the command will exit 2 if an empty file is provided. [sources: src/devops_cli/commands/config.py:173-183]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 18, 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.
The candidate adds a new feature to read secrets from files or stdin.It is required by a P0 item (the roadmap jobs' App identity) and blocks other dependent items.It enables secure handling of multi-line secrets like PEM keys, which is critical for security and functionality.The change involves adding new command-line options, file reading logic, validation, and tests, but does not fundamentally alter the system architecture.dan-petty commentedon Oct 18, 2026
Status set to Ready at 25e2cda (see proposed design in issue body).
feat(config): devops config set stores a multi-line secret, such as a…
fix(tests): a test that writes a real config.yaml fails at the write …