Documentation
¶
Overview ¶
Package modules is the credential catalog. Each file registers one or more modules (recipe-built or hand-written), their gitleaks rule mappings, and any custom set/file recognizers, via init(). Importing this package for its side effects populates module.Default.
Endpoints come from untrusted input ¶
A recognizer runs over a file an attacker may have written. Any host it reads out of that file — a co-located env var, a URL matched in the raw blob, a hostname concatenated into a base — is therefore attacker-reachable, and a planted value aims a real credential at whoever planted it. When writing a module that takes its destination from the blob:
- Declare an Endpoint policy (module.EndpointPolicy): saasOnly(...) with the vendor's own domains for a SaaS-only service, selfHosted for anything deployable at an arbitrary domain. recognize.Recognize enforces it before any module code runs, which is what protects an Authenticate hook too.
- Resolve the host with resolveEndpoint, which puts the operator's --endpoint ahead of anything in the file. Do not hand-roll that ordering: letting the file win means an operator can name a host and still have the credential sent somewhere else.
- Bind each host variable to the service it names. Pairing one service's credential with another service's URL variable lets a single planted line redirect an unrelated token.
TestEveryEndpointSteeredModuleDeclaresAPolicy fails the build when a module aims its calls with a URL-valued field and declares no policy.
Source Files
¶
- ai_ide_stores.go
- alibaba.go
- atlassian.go
- aws.go
- aws_privesc.go
- aws_sso.go
- azure_keyvault.go
- azure_msal.go
- bedrock.go
- catalog.go
- catalog_ai.go
- catalog_ai_devtools.go
- catalog_analytics.go
- catalog_backup.go
- catalog_bearer.go
- catalog_data.go
- catalog_endpoint_mgmt.go
- catalog_enterprise.go
- catalog_enterprise_harvest.go
- catalog_envnames.go
- catalog_freshworks.go
- catalog_header.go
- catalog_itsm_iam.go
- catalog_localstores.go
- catalog_monitoring.go
- catalog_needs_endpoint.go
- catalog_oauth.go
- catalog_secret_stores.go
- catalog_security_infra.go
- catalog_sets.go
- catalog_special.go
- catalog_structural.go
- catalog_workos.go
- cloud_metadata.go
- cloudflare.go
- cyberark.go
- devlaptop.go
- doc.go
- duo.go
- dynatrace.go
- filestack.go
- firefox.go
- firefox_nss.go
- gcloud_db.go
- gcp_adc.go
- gcp_metadata.go
- gcp_sa.go
- gcp_secrets.go
- generic_named.go
- github.go
- helpers.go
- jwt.go
- k8srecon.go
- mcp_config.go
- mongodb_atlas.go
- netlify.go
- oci_instance.go
- passwordmgr.go
- session_login.go
- ssh_correlate.go