Security rules for collectors¶
These rules are enforced in review and by CodeQL; follow them in every collector:
- Never collect secret values. Record names, ARNs and metadata, never values: no SSM
parameter values, no environment variable values (
environment_keysandidentifier_refsonly), no passwords, pre-shared keys, auth keys, webhook secrets, connection strings, user data. Cloud Control properties go throughredact(). - Never log secrets or secret names in a way that looks like one. Log identifiers and error codes; do not interpolate values that came from secret-bearing fields.
- Strip credentials from URLs. Use
_clean_url()/url_alias(); repository URLs can embed tokens, and query strings can carry signatures. - Judge URLs on the parsed host. Use
urlsplit()and an anchored, full-match regular expression on the host (as_is_sqs_queue_urland_image_registry_hostdo), never substring checks on the whole string. - No regular expressions with nested quantifiers on attacker-influenced input (resource names, tags, policy documents). Prefer splitting and parsing.
- Read-only calls only. No
Create*,Put*,Update*,Delete*, and in Kubernetes onlyGET. - Do not widen permissions in docs or defaults. Recommend read-only roles.