44 lines
2.7 KiB
Markdown
44 lines
2.7 KiB
Markdown
# Local migration operator authorisation
|
|
|
|
The supported development composition accepts a policy loader through
|
|
`SiteOperations(operator_policy=...)`. The loader must return a fresh
|
|
`OperatorApprovalPolicy` on each call. Configure the policy in trusted runtime code with a one-to-one mapping from dedicated OS accounts to operator
|
|
principals. The policy authenticates the process's effective UID. The operator's
|
|
login or service launcher must authenticate access to that account. A shared
|
|
service account cannot provide individual operator identity.
|
|
|
|
Each grant names the UID, principal, operation (`issue` or `execute`), site,
|
|
exact Git revision and UTC expiry. Issue and execute grants are independent.
|
|
Both must match the same approval principal. An issue grant allows saving a
|
|
draft. Execution requires a current execute grant, a valid approval seal, and
|
|
the original approval and rehearsal checks. The coordinator verifies authority
|
|
before writing intent and the store repeats verification under its lock before
|
|
publishing the single-use consumption record.
|
|
|
|
Supply an independently generated random key of at least 32 bytes from protected
|
|
runtime configuration. Keep it stable across process restarts and separate from
|
|
approval state. The key authenticates the complete version 2 approval payload,
|
|
including the exact rehearsal, backup and pending migrations. A version 1
|
|
draft or record cannot authorise execution. Historical records remain readable
|
|
for audit. Unsealed recovery evidence requires manual review. Recovery evidence
|
|
verification requires access to the sealing key used for issuance.
|
|
|
|
The runtime process, its code, policy, key, clock and state directory are trusted.
|
|
|
|
Use `FileOperatorAuthority(path, group=...)` for a local authority source. Place
|
|
the root-owned mode 0440 JSON file in a root-owned mode 0750 directory whose
|
|
group matches the configured reader group, under administrator-controlled
|
|
ancestors. The JSON object contains `sealing_key` as hex and `grants` as a list
|
|
of objects with `uid`, `principal`, `operation`, `site`, `revision` and
|
|
`expires_at` (timezone-aware ISO 8601). Atomically replace the whole file when
|
|
removing grants or changing the key. The runtime reopens it for each authority
|
|
check, including consumption under the approval lock. Missing, unreadable,
|
|
unsafe or malformed state denies the operation. Key rotation invalidates
|
|
outstanding approvals and puts evidence sealed with the retired key into
|
|
manual review. Revocation is evaluated at the next authority read and cannot
|
|
recall an operation that already passed its final consumption check.
|
|
|
|
The approved account
|
|
must never be exposed as a shared application or arbitrary command identity.
|
|
The inspection CLI remains disabled for production execution.
|