Imported from eshu-hq/eshu (
go/internal/collector/secretsiam/AGENTS.md). Install upstream withnpx skills add eshu-hq/eshu --skill secretsiam. Copyright stays with the author.
AGENTS.md - internal/collector/secretsiam guidance
Read First
README.md- package purpose, exported surface, and invariants.doc.go- package contract.types.go- accepted source observation shapes.envelope.go- stable identity and payload construction.kubernetes_types.go- accepted Kubernetes observation shapes.kubernetes_envelope.go- Kubernetes stable identity and payload construction.vault_types.go- accepted Vault observation shapes.vault_envelope.go- Vault stable identity and payload construction.docs/public/guides/collector-authoring.md- collector authoring contract.
Invariants
- Keep
CollectorKindset tosecrets_iam_posture. - Emit source facts only. Do not add graph writes, reducer logic, or query behavior here.
- Keep policy evidence metadata-only: no raw policy JSON, no statement bodies, no condition values, no credentials, and no session tokens.
- Keep Kubernetes evidence metadata-only: no raw Secret names, projected tokens, ServiceAccount names, namespaces, RBAC subject names, RBAC resourceNames, or nonResourceURLs in payloads unless a test proves the value is fingerprinted or represented by a bounded count.
- Keep Vault evidence metadata-only: no raw KV paths, key names, custom metadata values, policy bodies, policy names, auth role names, mount accessors, entity IDs, alias names, Vault tokens, AppRole secret IDs, private URLs, or warning messages in payloads. Use fingerprints, counts, and bounded capability summaries.
- Preserve provider-native identity needed for stable joins, but keep user-facing posture and trust-chain conclusions in reducers.
Common Changes
- Add a source fact by defining the fact kind in
internal/facts, writing a failing envelope test, then adding a narrow observation type and builder. - Extend a payload only with additive fields and update the package README plus public fact docs when the wire contract changes.
- Add scanner integration in the provider-specific scanner after the envelope builder test proves normalization and redaction.
What Not To Change Without An ADR
- Do not promote IAM trust principals into canonical graph identities here.
- Do not persist raw provider documents or secret-bearing values.
- Do not infer workloads, environments, ownership, or deployment truth from IAM names, ARNs, paths, or policy text.