@ranimontagna/agent-toolkit 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +257 -71
- package/CONTRIBUTING.md +14 -0
- package/README.md +68 -705
- package/SECURITY.md +62 -8
- package/package.json +1 -1
- package/skills/security/NOTICE.md +9 -0
- package/skills/security/api-security-audit/SKILL.md +63 -0
- package/skills/security/cicd-security-audit/SKILL.md +55 -0
- package/skills/security/cloud-misconfiguration-audit/SKILL.md +54 -0
- package/skills/security/js-secrets-audit/SKILL.md +53 -0
- package/skills/security/llm-agent-security-audit/SKILL.md +54 -0
- package/skills/security/source-leak-audit/SKILL.md +55 -0
package/SECURITY.md
CHANGED
|
@@ -5,7 +5,9 @@ supply-chain changes need careful review.
|
|
|
5
5
|
|
|
6
6
|
## Reporting
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Email the maintainer at
|
|
9
|
+
[raniellimontagna@hotmail.com](mailto:raniellimontagna@hotmail.com) instead of
|
|
10
|
+
opening a public issue. Include:
|
|
9
11
|
|
|
10
12
|
- affected version or commit;
|
|
11
13
|
- exact command used;
|
|
@@ -13,12 +15,64 @@ Open a GitHub security advisory or a private issue with:
|
|
|
13
15
|
- relevant logs with secrets removed.
|
|
14
16
|
|
|
15
17
|
Do not paste tokens, private repository URLs or internal project names into
|
|
16
|
-
public issues.
|
|
18
|
+
public issues. The project does not define a response-time or remediation SLA.
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## Dependency Integrity
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
Repository dependencies resolve through `pnpm-lock.yaml`, and CI installs them
|
|
23
|
+
with `--frozen-lockfile`. Dependency-audit jobs install with lifecycle scripts
|
|
24
|
+
disabled before running the moderate-or-higher audit. See
|
|
25
|
+
[Architecture](docs/ARCHITECTURE.md) for the CI boundary.
|
|
26
|
+
|
|
27
|
+
## External-Source Provenance
|
|
28
|
+
|
|
29
|
+
`tools.lock.json` is the source of truth for the external sources represented in
|
|
30
|
+
the lock. Package sources use exact versions, Git sources use full commits, and
|
|
31
|
+
RTK archives are checked against locked SHA-256 values. The RTK metadata URL may
|
|
32
|
+
select another non-latest tagged release in the locked repository, but the
|
|
33
|
+
downloaded archive must still pass the locked checksum.
|
|
34
|
+
|
|
35
|
+
Two installer paths are not content-pinned by the lock: Superpowers delegates to
|
|
36
|
+
runtime-native plugin or extension identifiers, and the official Antigravity
|
|
37
|
+
installer is identity-gated to an HTTPS URL but is not pinned by checksum or
|
|
38
|
+
commit. Source-identity changes, mutable versions, alternate lock files, and a
|
|
39
|
+
different Antigravity URL require the explicit `--allow-mutable-sources` opt-in;
|
|
40
|
+
that permission accepts the reviewed exception for one invocation rather than
|
|
41
|
+
making it immutable. See [Architecture](docs/ARCHITECTURE.md) and
|
|
42
|
+
[Configuration](docs/CONFIGURATION.md) for the complete boundaries.
|
|
43
|
+
|
|
44
|
+
## Network Bounds
|
|
45
|
+
|
|
46
|
+
Toolkit-owned HTTP fetch and download helpers share a 30-second total deadline,
|
|
47
|
+
allow at most five redirects, reject HTTPS downgrades, and enforce response-size
|
|
48
|
+
limits. Downloads use an exclusive partial file and become visible at the target
|
|
49
|
+
path only after a complete response. External package managers, Git, and
|
|
50
|
+
runtime-native plugin commands retain their own network behavior. See
|
|
51
|
+
[Architecture](docs/ARCHITECTURE.md#transport-and-filesystem-security).
|
|
52
|
+
|
|
53
|
+
## Filesystem Containment
|
|
54
|
+
|
|
55
|
+
Agent Skills checkouts verify the fetched commit and contain requested skill
|
|
56
|
+
roots inside the checkout. Toolkit-managed Custom Skill copies are staged before
|
|
57
|
+
replacement. Manifest-backed uninstall removes only recorded direct children of
|
|
58
|
+
recognized runtime roots after canonical-path and filesystem-identity checks;
|
|
59
|
+
containment failures preserve the manifest for review or retry. See
|
|
60
|
+
[Architecture](docs/ARCHITECTURE.md#manifest-and-lifecycle-boundary).
|
|
61
|
+
|
|
62
|
+
## CI Security Gates
|
|
63
|
+
|
|
64
|
+
CI runs the full lint, typecheck, unit, build, syntax, and integration gate on
|
|
65
|
+
Node.js 24. Separate jobs scan full Git history with Gitleaks, audit dependencies
|
|
66
|
+
without lifecycle scripts, and review pull-request dependency changes at
|
|
67
|
+
moderate severity or higher. Contributor commands and suite ownership are in
|
|
68
|
+
[Testing](docs/TESTING.md).
|
|
69
|
+
|
|
70
|
+
## npm Provenance
|
|
71
|
+
|
|
72
|
+
Tag-driven publication reruns the full gate, checks version and `main` ancestry,
|
|
73
|
+
and grants only read-only repository contents plus `id-token: write`. The publish
|
|
74
|
+
helper uses `npm publish --provenance --access public` and bounded registry
|
|
75
|
+
verification retries; the workflow does not use a long-lived npm token. npm-side
|
|
76
|
+
trusted-publisher setup and release recovery are documented in
|
|
77
|
+
[Deployment and Releases](docs/DEPLOYMENT.md). Released project history remains
|
|
78
|
+
available in the public [changelog](CHANGELOG.md).
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Security Skills Attribution
|
|
2
|
+
|
|
3
|
+
These first-party Agent Toolkit skills are informed by public defensive
|
|
4
|
+
security and reconnaissance patterns from
|
|
5
|
+
[`uphiago/recon-skills`](https://github.com/uphiago/recon-skills), licensed
|
|
6
|
+
under the MIT License. They are rewritten and narrowed for authorized,
|
|
7
|
+
non-destructive application and code security reviews; the upstream agent
|
|
8
|
+
instructions, operational infrastructure assumptions, scripts, and offensive
|
|
9
|
+
workflows are not included.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-security-audit
|
|
3
|
+
description: Use when reviewing an API for authorization gaps, unsafe input binding, token handling, CORS, or HTTP method configuration.
|
|
4
|
+
metadata:
|
|
5
|
+
origin: Adapted from uphiago/recon-skills; first-party defensive rewrite.
|
|
6
|
+
tags: api, security, authorization, cors
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# API Security Audit
|
|
10
|
+
|
|
11
|
+
Review an API for configuration and authorization weaknesses without attempting
|
|
12
|
+
to take over accounts, alter data, or bypass production controls.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Reviewing REST, GraphQL, RPC, or webhook endpoints.
|
|
17
|
+
- Investigating mass-assignment, BOLA/IDOR, CORS, JWT, or verb-tampering risk.
|
|
18
|
+
- Assessing an API before release or after an authorization change.
|
|
19
|
+
|
|
20
|
+
## Authorization Boundary
|
|
21
|
+
|
|
22
|
+
Work only against a repository, local fixture, staging environment, or written
|
|
23
|
+
test scope. Prefer source review and unit tests. Never send admin-changing
|
|
24
|
+
payloads to a real account, brute-force tokens, or probe unrelated hosts.
|
|
25
|
+
|
|
26
|
+
## Procedure
|
|
27
|
+
|
|
28
|
+
1. Inventory routes, methods, auth middleware, schemas, tenant identifiers, and
|
|
29
|
+
generated API documentation.
|
|
30
|
+
2. For every read and write operation, identify the server-side authorization
|
|
31
|
+
decision. Confirm that object ownership and tenant scope are checked after
|
|
32
|
+
loading the object, not inferred from client input.
|
|
33
|
+
3. Inspect request binding. Flag direct persistence of request bodies where
|
|
34
|
+
privileged fields such as `role`, `ownerId`, `tenantId`, `verified`, or
|
|
35
|
+
`isAdmin` are not allowlisted.
|
|
36
|
+
4. Review method handling, including `OPTIONS`, `HEAD`, `TRACE`, method
|
|
37
|
+
override headers, and routes that accept both GET and mutating verbs.
|
|
38
|
+
5. Review JWT validation: fixed algorithm allowlist, issuer/audience checks,
|
|
39
|
+
key rotation, expiry, and rejection of unsigned or wrongly signed tokens.
|
|
40
|
+
6. Review CORS. A wildcard origin alone is not a credential leak; require an
|
|
41
|
+
unsafe combination of origin reflection, credentials, and a sensitive
|
|
42
|
+
browser-readable response.
|
|
43
|
+
7. Reproduce only with harmless fixtures: a second test user, a synthetic
|
|
44
|
+
object, and a request that must return `401` or `403`. Do not modify data.
|
|
45
|
+
|
|
46
|
+
## Evidence Gate
|
|
47
|
+
|
|
48
|
+
Report a finding only when the code path or a controlled fixture demonstrates
|
|
49
|
+
the trust-boundary failure. A suspicious field name, decoded JWT, or permissive
|
|
50
|
+
header is a lead, not proof.
|
|
51
|
+
|
|
52
|
+
## Report
|
|
53
|
+
|
|
54
|
+
Include endpoint or source location, required role, expected decision, observed
|
|
55
|
+
decision, affected asset, minimal safe reproduction, impact, and remediation.
|
|
56
|
+
Redact tokens, cookies, API keys, and personal data.
|
|
57
|
+
|
|
58
|
+
## Common Mistakes
|
|
59
|
+
|
|
60
|
+
- Treating client-side route hiding as authorization.
|
|
61
|
+
- Calling `Access-Control-Allow-Origin: *` a credentialed CORS finding.
|
|
62
|
+
- Using a real user's identifier instead of a synthetic fixture.
|
|
63
|
+
- Recommending `alg:none` or privilege-changing payloads in production tests.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cicd-security-audit
|
|
3
|
+
description: Use when reviewing CI/CD workflows, build pipelines, release automation, action dependencies, permissions, artifacts, or secret handling.
|
|
4
|
+
metadata:
|
|
5
|
+
origin: Adapted from uphiago/recon-skills; first-party defensive rewrite.
|
|
6
|
+
tags: security, ci, cd, supply-chain
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# CI/CD Security Audit
|
|
10
|
+
|
|
11
|
+
Review pipeline configuration for privilege, injection, secret, and supply
|
|
12
|
+
chain risks. Keep the assessment static or use isolated test branches.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Reviewing GitHub Actions, GitLab CI, CircleCI, or release scripts.
|
|
17
|
+
- Preparing a repository for trusted publishing or external contributions.
|
|
18
|
+
- Investigating secrets in logs, unsafe artifacts, or unpinned actions.
|
|
19
|
+
|
|
20
|
+
## Procedure
|
|
21
|
+
|
|
22
|
+
1. Inventory workflow triggers, actors, environments, protected branches,
|
|
23
|
+
reusable workflows, runners, deployment credentials, and artifacts.
|
|
24
|
+
2. Check least privilege. Each job should declare only required permissions;
|
|
25
|
+
pull-request workflows must not expose write tokens to untrusted code.
|
|
26
|
+
3. Trace untrusted input from branch names, issue titles, PR fields, commit
|
|
27
|
+
messages, and changed files into shell commands, expressions, paths, and
|
|
28
|
+
scripts. Use environment variables and fixed argument arrays rather than
|
|
29
|
+
interpolation.
|
|
30
|
+
4. Check third-party actions and downloaded tools for immutable commit pins,
|
|
31
|
+
checksum verification, provenance, and update ownership.
|
|
32
|
+
5. Check secret handling: no echo/trace, no secrets in command-line arguments,
|
|
33
|
+
artifacts, caches, test snapshots, or fork-triggered jobs.
|
|
34
|
+
6. Review artifact upload/download boundaries, retention, deployment gates,
|
|
35
|
+
environment approvals, and concurrency controls.
|
|
36
|
+
7. Validate changes in a disposable branch with synthetic secrets and a dry-run
|
|
37
|
+
deployment. Never print or exfiltrate a real secret.
|
|
38
|
+
|
|
39
|
+
## Evidence Gate
|
|
40
|
+
|
|
41
|
+
Distinguish a theoretical permission from an reachable path. Show the trigger,
|
|
42
|
+
job, permission/input flow, and affected asset. A floating action tag is a
|
|
43
|
+
supply-chain risk, not proof of compromise.
|
|
44
|
+
|
|
45
|
+
## Report
|
|
46
|
+
|
|
47
|
+
Include workflow/job, trigger, trust boundary, vulnerable data flow, impact,
|
|
48
|
+
safe reproduction or static evidence, and exact hardening. Redact secret names
|
|
49
|
+
when they reveal sensitive architecture and never include values.
|
|
50
|
+
|
|
51
|
+
## Common Mistakes
|
|
52
|
+
|
|
53
|
+
- Treating every `pull_request_target` workflow as automatically vulnerable.
|
|
54
|
+
- Calling a public CI log a secret leak without proving the value is sensitive.
|
|
55
|
+
- Suggesting live deployment tests for a static workflow review.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cloud-misconfiguration-audit
|
|
3
|
+
description: Use when reviewing cloud storage, IAM, metadata access, network exposure, or deployment configuration for unauthorized access risk.
|
|
4
|
+
metadata:
|
|
5
|
+
origin: Adapted from uphiago/recon-skills; first-party defensive rewrite.
|
|
6
|
+
tags: cloud, security, iam, storage
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Cloud Misconfiguration Audit
|
|
10
|
+
|
|
11
|
+
Assess cloud exposure from configuration, policy, logs, and synthetic fixtures.
|
|
12
|
+
The goal is to reduce unintended access, not to enumerate or exploit another
|
|
13
|
+
tenant's infrastructure.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Reviewing AWS, GCP, Azure, Supabase, Firebase, object storage, or IAM policy.
|
|
18
|
+
- Checking deployment templates, public endpoints, metadata protections, or
|
|
19
|
+
container/cloud role boundaries.
|
|
20
|
+
|
|
21
|
+
## Procedure
|
|
22
|
+
|
|
23
|
+
1. Define account/project/subscription, region, environment, and read-only
|
|
24
|
+
credentials in scope. Confirm the audit identity and expected permissions.
|
|
25
|
+
2. Inventory internet-facing services, buckets, databases, load balancers,
|
|
26
|
+
serverless functions, service accounts, workload identities, and secrets.
|
|
27
|
+
3. Review IAM for wildcard principals/actions/resources, cross-account trust,
|
|
28
|
+
unused roles, privilege escalation paths, and production identities in CI.
|
|
29
|
+
4. Review storage for public listing/read/write, predictable object paths,
|
|
30
|
+
insecure CORS, version history, logs, and sensitive metadata.
|
|
31
|
+
5. Review metadata-service protections and container/task role boundaries in
|
|
32
|
+
source and infrastructure-as-code. Do not query a live metadata endpoint
|
|
33
|
+
unless the account owner explicitly provides an isolated fixture.
|
|
34
|
+
6. Confirm findings with policy simulation, provider analyzer output, or a
|
|
35
|
+
synthetic object. Never download unrelated customer data or alter policy.
|
|
36
|
+
7. Recheck after remediation with the same read-only identity and record the
|
|
37
|
+
before/after decision.
|
|
38
|
+
|
|
39
|
+
## Evidence Gate
|
|
40
|
+
|
|
41
|
+
Public policy syntax is not automatically exploitable. Prove the effective
|
|
42
|
+
permission, resource scope, and data class. A provider-owned public identifier
|
|
43
|
+
is not a credential.
|
|
44
|
+
|
|
45
|
+
## Report
|
|
46
|
+
|
|
47
|
+
Record provider/account alias, resource type and masked identifier, effective
|
|
48
|
+
principal/action, data class, impact, remediation, and verification result.
|
|
49
|
+
Keep account IDs, tokens, object names, and personal data to the minimum needed.
|
|
50
|
+
|
|
51
|
+
## Stop Conditions
|
|
52
|
+
|
|
53
|
+
Stop on customer data, cross-account access, write permission, or unexpected
|
|
54
|
+
production impact. Preserve only metadata and notify the authorized owner.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: js-secrets-audit
|
|
3
|
+
description: Use when reviewing JavaScript bundles, source maps, frontend configuration, or generated assets for exposed credentials and internal endpoints.
|
|
4
|
+
metadata:
|
|
5
|
+
origin: Adapted from uphiago/recon-skills; first-party defensive rewrite.
|
|
6
|
+
tags: javascript, security, frontend, secrets
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# JavaScript Secrets Audit
|
|
10
|
+
|
|
11
|
+
Inspect browser-delivered JavaScript and source maps for values that grant
|
|
12
|
+
privilege or reveal sensitive internal systems. Public configuration is not
|
|
13
|
+
automatically a secret, and all findings must be redacted.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Reviewing a frontend build before release.
|
|
18
|
+
- Investigating a suspected API key, JWT, private URL, or source-map exposure.
|
|
19
|
+
- Auditing generated assets from a local build or authorized staging site.
|
|
20
|
+
|
|
21
|
+
## Procedure
|
|
22
|
+
|
|
23
|
+
1. Inventory emitted JS, maps, HTML bootstraps, runtime config, and public
|
|
24
|
+
environment variables. Prefer local build output.
|
|
25
|
+
2. Search for high-signal patterns: private-key headers, bearer tokens, JWT
|
|
26
|
+
shapes, cloud access-key prefixes, database URLs, webhook secrets, and
|
|
27
|
+
internal hostnames. Treat regex matches as leads.
|
|
28
|
+
3. Classify each value: public identifier, publishable key, short-lived token,
|
|
29
|
+
privileged credential, personal data, or internal endpoint.
|
|
30
|
+
4. Confirm only through source/config ownership and documentation. Never call a
|
|
31
|
+
matched service, decode a real token, or test a credential.
|
|
32
|
+
5. Report path, bundle offset/source line, secret class, masked fingerprint,
|
|
33
|
+
exposure scope, and rotation/removal action.
|
|
34
|
+
6. Rebuild with proper environment separation, remove maps or sensitive config,
|
|
35
|
+
invalidate caches, rotate credentials when needed, and rescan.
|
|
36
|
+
|
|
37
|
+
## Evidence Gate
|
|
38
|
+
|
|
39
|
+
Regex alone is insufficient. A finding needs ownership/context showing that the
|
|
40
|
+
value is sensitive or that the endpoint exposes protected functionality. Never
|
|
41
|
+
place the value in reports, snapshots, tickets, chat, or terminal output.
|
|
42
|
+
|
|
43
|
+
## Safe Masking
|
|
44
|
+
|
|
45
|
+
Use only a short prefix/suffix or a one-way fingerprint, for example
|
|
46
|
+
`sk_live_••••••••9f2a`; preserve enough context for the owner to locate it.
|
|
47
|
+
|
|
48
|
+
## Common Mistakes
|
|
49
|
+
|
|
50
|
+
- Reporting every Firebase/Supabase/public client key as a vulnerability.
|
|
51
|
+
- Assuming minification makes a secret safe.
|
|
52
|
+
- Downloading source maps from unrelated deployments.
|
|
53
|
+
- Testing a suspected credential instead of rotating it through the owner.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: llm-agent-security-audit
|
|
3
|
+
description: Use when auditing an LLM, RAG, chatbot, or tool-using agent for prompt injection, data exfiltration, system-prompt leakage, or cross-tenant access.
|
|
4
|
+
metadata:
|
|
5
|
+
origin: Adapted from uphiago/recon-skills; first-party defensive rewrite.
|
|
6
|
+
tags: security, llm, agents, prompt-injection
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# LLM and Agent Security Audit
|
|
10
|
+
|
|
11
|
+
Test trust boundaries around model instructions, retrieved content, tools, and
|
|
12
|
+
tenant data. A refusal or unsafe sentence alone is not a vulnerability; require
|
|
13
|
+
reproducible impact at the data or action layer.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Reviewing an agent with browser, shell, filesystem, email, or API tools.
|
|
18
|
+
- Assessing RAG/document ingestion, plugins, MCP tools, or multi-tenant chat.
|
|
19
|
+
- Investigating prompt injection, system-prompt leakage, or tool exfiltration.
|
|
20
|
+
|
|
21
|
+
## Procedure
|
|
22
|
+
|
|
23
|
+
1. Map system/developer/user/retrieved instructions, tool schemas, credentials,
|
|
24
|
+
memory, tenant boundaries, and approval gates.
|
|
25
|
+
2. Use synthetic canary data and a disposable account. Label every test input
|
|
26
|
+
and keep external callbacks under the auditor's control.
|
|
27
|
+
3. Test indirect instructions in documents and web content for instruction/data
|
|
28
|
+
confusion. Verify whether the model can cause a tool action, not merely say
|
|
29
|
+
it would.
|
|
30
|
+
4. Apply the run-twice rule for alleged prompt or system-message leakage. A
|
|
31
|
+
finding needs reproducible non-guessable content or a verifiable action.
|
|
32
|
+
5. For exfiltration claims, require an authorized OOB callback containing only
|
|
33
|
+
the synthetic canary. Rendered Markdown or a model claim is not proof.
|
|
34
|
+
6. Test cross-tenant retrieval with a value independently known to belong to a
|
|
35
|
+
second synthetic tenant. Do not use real customer data.
|
|
36
|
+
7. Check tool permissions, argument validation, URL allowlists, confirmation
|
|
37
|
+
gates, output encoding, and audit logs. Recommend architectural controls,
|
|
38
|
+
not prompt-only mitigations.
|
|
39
|
+
|
|
40
|
+
## Evidence Gate
|
|
41
|
+
|
|
42
|
+
Confabulation, jailbreak compliance, a model repeating user input, and a generic
|
|
43
|
+
refusal bypass are not findings without a trust-boundary consequence.
|
|
44
|
+
|
|
45
|
+
## Report
|
|
46
|
+
|
|
47
|
+
Include model/build, synthetic input, tool/data boundary, reproducibility,
|
|
48
|
+
observable impact, logs or callback metadata, and mitigation. Never include
|
|
49
|
+
system prompts, customer content, credentials, or harmful payloads verbatim.
|
|
50
|
+
|
|
51
|
+
## Stop Conditions
|
|
52
|
+
|
|
53
|
+
Stop if a test reaches real data, sends an uncontrolled external request, or
|
|
54
|
+
would mutate a real system. Revoke test credentials and preserve minimal logs.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: source-leak-audit
|
|
3
|
+
description: Use when checking an application, repository, build, or deployment for exposed source files, debug artifacts, backups, configuration, or secrets.
|
|
4
|
+
metadata:
|
|
5
|
+
origin: Adapted from uphiago/recon-skills; first-party defensive rewrite.
|
|
6
|
+
tags: security, source-leak, debug, secrets
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Source Leak Audit
|
|
10
|
+
|
|
11
|
+
Find accidentally published source and diagnostic artifacts while preserving
|
|
12
|
+
confidentiality. The audit proves exposure and location without collecting or
|
|
13
|
+
redistributing secret values.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Reviewing a web deployment, static asset bucket, container image, or repo.
|
|
18
|
+
- Investigating `.env`, source maps, backups, debug pages, directory listings,
|
|
19
|
+
stack traces, or exposed API documentation.
|
|
20
|
+
|
|
21
|
+
## Procedure
|
|
22
|
+
|
|
23
|
+
1. Establish the exact authorized asset and deployment scope.
|
|
24
|
+
2. Inspect repository ignore rules, build output, Docker layers, release
|
|
25
|
+
artifacts, static hosting configuration, and server error handling.
|
|
26
|
+
3. Search source and generated files for filenames and patterns such as
|
|
27
|
+
`.env`, `*.map`, `.git/`, `backup`, `debug`, `phpinfo`, private keys, and
|
|
28
|
+
connection strings. Record file path and line number, not values.
|
|
29
|
+
4. For a controlled deployment, request only harmless metadata or a bounded
|
|
30
|
+
prefix sufficient to prove the artifact exists. Stop when sensitive content
|
|
31
|
+
is confirmed.
|
|
32
|
+
5. Check whether the exposed value is active using the owning team's approved
|
|
33
|
+
rotation or revocation process. Do not use the credential to authenticate.
|
|
34
|
+
6. Verify remediation by removing the artifact, invalidating caches, rotating
|
|
35
|
+
credentials, and confirming the safe response status.
|
|
36
|
+
|
|
37
|
+
## Evidence Gate
|
|
38
|
+
|
|
39
|
+
An accessible filename is not enough. Confirm the artifact contains relevant
|
|
40
|
+
source/configuration or that a debug response exposes meaningful internals.
|
|
41
|
+
Never include secret values, full cookies, private keys, or personal data in a
|
|
42
|
+
report, terminal output, issue, or model context.
|
|
43
|
+
|
|
44
|
+
## Report
|
|
45
|
+
|
|
46
|
+
Record asset, path, response/build location, data class, exposure window if
|
|
47
|
+
known, impact, containment action, and safe verification result. Use masked
|
|
48
|
+
examples such as `DATABASE_URL=postgres://***`.
|
|
49
|
+
|
|
50
|
+
## Do Not
|
|
51
|
+
|
|
52
|
+
- Clone or archive an exposed private repository.
|
|
53
|
+
- Download more content after confirming exposure.
|
|
54
|
+
- Test leaked credentials against any service.
|
|
55
|
+
- Treat a public client identifier as a secret without evidence of privilege.
|