StarIntel credential lifecycle
Goal
Issue or replace narrowly scoped Star Server credentials, store their one-time
values in an encrypted Org file, and deliver a service credential through its
local administration API without losing or exposing key material.
Requires curl, jq, ssh, emacsclient, an Emacs daemon with EasyPG access,
an authenticated Star Server administrator path, and the target service's local
API contract.
Input
Credential owners and principal types, exact capability and resource scopes,
expiry, encrypted Org file and headings, predecessor credential IDs, target SSH
identity, local API URL, and destination secret name such as STAR_AUTH.
Output
Authenticated replacement credentials, encrypted records, masked target API
readback, and revoked predecessors with sanitized lifecycle receipts.
Workflow
- Inspect the deployed Star Server authorization vocabulary and credential API.
Reject unknown scopes. Changing scopes requires a new credential; rotation
preserves the old scope set.
- Read existing records from the
.org.gpg buffer through emacsclient.
Extract only required values into memory; do not decrypt to a plaintext file.
- Resolve every requested resource dimension explicitly. Target work commonly
needs
targets:read, targets:dispatch, targets:lease, and matching
tenant:, dataset:, actor:, target:, target-namespace:, and
program: grants. Do not infer wildcard access from a capability.
- Authenticate to Star Server through the approved administrator path and
POST /auth/credentials. Parse the identifier from
credential.credential_id; the raw api_key is returned only once.
- Validate owner, principal type, expiry, and exact ordered scopes in each
response. If a multi-key issuance is partial, revoke unusable new keys.
- Before revoking predecessors, update the encrypted Org buffer through
emacsclient, save it with EasyPG, and retain predecessor IDs as revoked
audit references. If save fails, revoke the new keys and stop.
- Configure the target over SSH using
curl against its loopback API. For
Agent Zero, obtain CSRF token plus session cookie with an explicit Origin,
read current settings, preserve all fields, merge the secret, and submit via
/api/settings_set. Keep ephemeral cookie material in memory-backed storage
and remove it on exit.
- Confirm target readback contains the secret name with a masked value. Then
call Star Server
/auth/context with each new key and compare the complete
principal and scope set. Exercise representative endpoints in every granted
tenant and one ungranted tenant; require both allow and deny behavior.
- Revoke predecessor IDs through the authenticated Star Server API only after
encrypted storage, delivery, and context checks pass. List credential
metadata and verify the intended active/revoked states.
Rules
- Never print bearer keys, administrator material, decrypted buffers, request
bodies containing secrets, or unmasked settings responses.
- Never use the one-time bootstrap route for routine credential lifecycle work.
- Exclude delete, force-release, credential-administration, principal-management,
audit, and
admin capabilities unless the operator explicitly requests them.
- A minted key without durable encrypted storage is unusable and must be revoked.
- A masked target readback proves storage, not authorization;
/auth/context
proves authentication and scopes.
1---2name: starintel-credential-lifecycle3description: starintel, api-keys, scopes, rotation, agent-zero, easypg4metadata:5 source: https://skillmd.com/skills/lost-rob0t/starintel-credential-lifecycle6---78# StarIntel credential lifecycle910## Goal1112Issue or replace narrowly scoped Star Server credentials, store their one-time13values in an encrypted Org file, and deliver a service credential through its14local administration API without losing or exposing key material.1516Requires `curl`, `jq`, `ssh`, `emacsclient`, an Emacs daemon with EasyPG access,17an authenticated Star Server administrator path, and the target service's local18API contract.1920## Input2122Credential owners and principal types, exact capability and resource scopes,23expiry, encrypted Org file and headings, predecessor credential IDs, target SSH24identity, local API URL, and destination secret name such as `STAR_AUTH`.2526## Output2728Authenticated replacement credentials, encrypted records, masked target API29readback, and revoked predecessors with sanitized lifecycle receipts.3031## Workflow32331. Inspect the deployed Star Server authorization vocabulary and credential API.34 Reject unknown scopes. Changing scopes requires a new credential; rotation35 preserves the old scope set.362. Read existing records from the `.org.gpg` buffer through `emacsclient`.37 Extract only required values into memory; do not decrypt to a plaintext file.383. Resolve every requested resource dimension explicitly. Target work commonly39 needs `targets:read`, `targets:dispatch`, `targets:lease`, and matching40 `tenant:`, `dataset:`, `actor:`, `target:`, `target-namespace:`, and41 `program:` grants. Do not infer wildcard access from a capability.424. Authenticate to Star Server through the approved administrator path and43 `POST /auth/credentials`. Parse the identifier from44 `credential.credential_id`; the raw `api_key` is returned only once.455. Validate owner, principal type, expiry, and exact ordered scopes in each46 response. If a multi-key issuance is partial, revoke unusable new keys.476. Before revoking predecessors, update the encrypted Org buffer through48 `emacsclient`, save it with EasyPG, and retain predecessor IDs as revoked49 audit references. If save fails, revoke the new keys and stop.507. Configure the target over SSH using `curl` against its loopback API. For51 Agent Zero, obtain CSRF token plus session cookie with an explicit `Origin`,52 read current settings, preserve all fields, merge the secret, and submit via53 `/api/settings_set`. Keep ephemeral cookie material in memory-backed storage54 and remove it on exit.558. Confirm target readback contains the secret name with a masked value. Then56 call Star Server `/auth/context` with each new key and compare the complete57 principal and scope set. Exercise representative endpoints in every granted58 tenant and one ungranted tenant; require both allow and deny behavior.599. Revoke predecessor IDs through the authenticated Star Server API only after60 encrypted storage, delivery, and context checks pass. List credential61 metadata and verify the intended active/revoked states.6263## Rules6465- Never print bearer keys, administrator material, decrypted buffers, request66 bodies containing secrets, or unmasked settings responses.67- Never use the one-time bootstrap route for routine credential lifecycle work.68- Exclude delete, force-release, credential-administration, principal-management,69 audit, and `admin` capabilities unless the operator explicitly requests them.70- A minted key without durable encrypted storage is unusable and must be revoked.71- A masked target readback proves storage, not authorization; `/auth/context`72 proves authentication and scopes.