Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to Skeleton are documented here, following [Keep a Changelog

- Add `secretspec.toml` to the template and the root: the secrets a repository reads, with a `ci` profile on the job environment, seeded once through `_skip_if_exists`.
- Add the `secretspec-manifest` hook, which checks the declaration without reading a value and skips when `secretspec` is absent.
- Add a reason to the example read in the `secretspec.toml` comment, because secretspec refuses an agent session that reads without one.
- Add `scripts/trash` and `tests/test_trash.py`: a recoverable delete into the system Trash, through `/usr/bin/trash` on macOS and `gio trash` on Linux, each with a fallback.
- Add seven dcg packs under `.dcg/packs/`, one per rule (`search`, `parsers`, `secrets`, `push`, `provenance`, `rtk`, `homebrew`), ids `rune.<segment>`, in the template and the root (SKEL-0009).
- Add `.dcg/fixtures.txt`, `.dcg/test-config.toml`, and `scripts/test-dcg-packs`: a denied command per rule and a permitted one per exemption, replayed through `dcg test` under an isolated config.
Expand Down
24 changes: 24 additions & 0 deletions docs/changes/secret-read-reason/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
status: proposed
---

# Secret read reason

## Why

The comment at the top of `secretspec.toml` shows two reads: `secretspec run -- <command>` and `secretspec get <NAME>`. Neither gives `--reason`. SecretSpec 0.21.1 refuses both in an agent session, because its `require_reason` policy defaults to `agents` ([SecretSpec][SECRETSPEC]). An agent that copies the example gets "Accessing secrets requires a reason". A bare `secretspec get` also prints the value into the transcript.

## What Changes

- `templates/base/secretspec.toml.jinja` and the root `secretspec.toml` show one read, `secretspec run --reason "<why>" -- <command>`, and say that an agent session must give a reason.
- `CHANGELOG.md` gains one line.

## Capabilities

- secret-read-reason (new)

## Impact

- One template file, one root file, and `CHANGELOG.md`. `copier.yaml` seeds `secretspec.toml` once, so only new repositories get the new comment. An existing consumer edits its own copy: the deck does that in runedeck/deck#86.

[SECRETSPEC]: https://secretspec.dev/reference/configuration/
19 changes: 19 additions & 0 deletions docs/changes/secret-read-reason/pull-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Shows the example read in `secretspec.toml` with `--reason`, which secretspec requires from an agent session.

## Plan

Change `secret-read-reason`: proposal, one ADDED delta (`secret-read-reason`), and tasks under `docs/changes/secret-read-reason/`.

## Changes

- Changes the comment in `templates/base/secretspec.toml.jinja` and the root `secretspec.toml`: the read is `secretspec run --reason "<why>" -- <command>`, and the bare `secretspec get <NAME>` example is gone, because it prints the value.
- Adds one `CHANGELOG.md` line.

## Testing

- With secretspec 0.21.1 in an agent session, a read without `--reason` exits 1 with "Accessing secrets requires a reason", and the same read with `--reason` succeeds. The probe used a scratch manifest with a synthetic value.
- `rune spec validate secret-read-reason` passes. The guarded push pipeline passed on this head.

## Release Notes

- The `secretspec.toml` comment shows a read that works in an agent session.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## ADDED Requirements

### Requirement: Declaration shows a read with a reason

The secret declaration that the generator writes MUST show its example read with a reason for the access. The secret manager refuses a read from an agent session that gives no reason, so an agent that copies a read without one fails.

#### Scenario: Agent copies the example read

- **WHEN** an agent copies the read that the generated declaration shows
- **THEN** the read gives a reason
- **AND** the secret manager accepts the read from an agent session
15 changes: 15 additions & 0 deletions docs/changes/secret-read-reason/tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Tasks

## 1. Implementation

- [x] 1.1 The example read in `templates/base/secretspec.toml.jinja` and the root `secretspec.toml` gives `--reason`
- [x] 1.2 One `CHANGELOG.md` line

## 2. Verification

- [x] 2.1 SecretSpec 0.21.1 refuses a read without `--reason` in an agent session and accepts the same read with one
- [x] 2.2 `rune spec validate secret-read-reason` and the guarded push pipeline

## 3. Record

- [ ] 3.1 Archive merges the delta into `docs/specs/`
4 changes: 2 additions & 2 deletions secretspec.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#:schema https://secretspec.dev/schema/secretspec.schema.json
# The secrets this repository's scripts and checks read. Declare a new one with
# `secretspec add <NAME> --description "<purpose>"`, and read it with
# `secretspec run -- <command>` or `secretspec get <NAME>`. No value ever enters
# the repository. On a workstation, values come from the provider the owner's
# `secretspec run --reason "<why>" -- <command>`. An agent session must give a
# reason. No value ever enters the repository. On a workstation, values come from the provider the owner's
# secretspec config names, the Keychain by default. The ci profile reads them
# from the job environment only.
# Reference: https://secretspec.dev/reference/configuration/
Expand Down
4 changes: 2 additions & 2 deletions templates/base/secretspec.toml.jinja
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#:schema https://secretspec.dev/schema/secretspec.schema.json
# The secrets this repository's scripts and checks read. Declare a new one with
# `secretspec add <NAME> --description "<purpose>"`, and read it with
# `secretspec run -- <command>` or `secretspec get <NAME>`. No value ever enters
# the repository. On a workstation, values come from the provider the owner's
# `secretspec run --reason "<why>" -- <command>`. An agent session must give a
# reason. No value ever enters the repository. On a workstation, values come from the provider the owner's
# secretspec config names, the Keychain by default. The ci profile reads them
# from the job environment only.
# Reference: https://secretspec.dev/reference/configuration/
Expand Down
Loading