Skip to content

Commit 357f359

Browse files
north-echoclaude
andcommitted
security: add security boundaries, remove triage prompts from public repo
Add SECURITY-BOUNDARIES.md defining the public/private boundary for this project. Add CLAUDE.md with CC instructions referencing it. Remove prompts/ from git tracking — triage agent prompts encode assessment methodology and must not be public (rule 1). Update .gitignore to exclude prompts/, queries/, scans/, findings/, reports/, and .sql files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b5c88a4 commit 357f359

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ dist/
77
*.db-wal
88
*.db-shm
99

10+
# Private research (see SECURITY-BOUNDARIES.md)
11+
prompts/
12+
queries/
13+
scans/
14+
findings/
15+
reports/
16+
MEMORY.md
17+
*.sql
18+
19+
# Environment and secrets
20+
.env
21+
.env.*
22+
1023
# Editor/OS
1124
.DS_Store
1225
*.swp

CLAUDE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Fluxgate — Claude Code Instructions
2+
3+
## Project
4+
5+
Fluxgate is a CI/CD pipeline security static analysis tool. It scans GitHub Actions, GitLab CI, and Azure Pipelines workflow files for dangerous security patterns (pwn requests, script injection, OIDC misconfiguration, etc.).
6+
7+
## Security Boundaries
8+
9+
**READ [SECURITY-BOUNDARIES.md](SECURITY-BOUNDARIES.md) BEFORE EVERY COMMIT.**
10+
11+
Key constraints:
12+
- Never commit prompt files, BigQuery queries, scan databases, triage briefs, or real scan output to this public repo.
13+
- Never reference specific unpatched repos by name in commits or code.
14+
- Never embed disclosure tracking IDs (GHSA-*, VULN-*) in public code.
15+
- Test fixtures must be synthetic — never copy real workflow files from scanned repos.
16+
- **Before every push, ask: "Does this commit contain anything that helps an attacker evade detection or identifies an unpatched target?"**
17+
18+
## Code Structure
19+
20+
- `cmd/fluxgate/` — CLI entry point (cobra)
21+
- `internal/scanner/` — GitHub Actions parser, rules (FG-xxx), scanner orchestration
22+
- `internal/cicd/` — GitLab CI parser+rules (GL-xxx), Azure Pipelines parser+rules (AZ-xxx)
23+
- `internal/github/` — GitHub API client, batch scanning, discovery
24+
- `internal/report/` — Output formatters (table, JSON, SARIF, markdown)
25+
- `internal/store/` — SQLite persistence
26+
- `test/fixtures/` — Synthetic YAML fixtures for rule tests
27+
28+
## Testing
29+
30+
```bash
31+
go test ./...
32+
```
33+
34+
All rules must have corresponding test fixtures and test functions in `*_test.go`.
35+
36+
## Style
37+
38+
- Go standard library style, no unnecessary abstractions
39+
- Rules are functions with signature `func(wf *Workflow) []Finding`
40+
- Platform-specific rules live in their parser package (internal/cicd/)
41+
- Bridge functions in scanner.go convert platform findings to common Finding type

SECURITY-BOUNDARIES.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SECURITY BOUNDARIES — READ THIS BEFORE EVERY COMMIT
2+
3+
## Classification: What is PUBLIC vs PRIVATE
4+
5+
This project has a hard boundary between open-source tooling and private research infrastructure. Violating this boundary burns disclosure credibility and hands adversaries our methodology.
6+
7+
### PUBLIC (safe to commit to north-echo/fluxgate)
8+
9+
- Detection rules (rules.go, all FG-/GL-/AZ- rule logic)
10+
- YAML parsers (workflow.go, gitlab.go, azure.go)
11+
- CLI and command structure (cmd/)
12+
- Report output formats (JSON, SARIF, table, markdown)
13+
- Test fixtures (test/fixtures/) — synthetic only, never real workflow files from scanned repos
14+
- Scanner architecture (scanner.go, finding.go)
15+
- GitHub API client and batch scanning logic
16+
- Containerfile, go.mod, go.sum, CI workflows
17+
- README, CONTRIBUTING, LICENSE, SECURITY, DISCLOSURE
18+
- .goreleaser.yaml
19+
20+
### PRIVATE (never commit to any public repository)
21+
22+
- **Triage agent prompts** (sonnet-triage.txt, haiku-filter.txt, any prompt files) — these encode exact triage methodology and mitigating factor weights. Publishing them teaches attackers how to evade our assessment.
23+
- **BigQuery queries** (fg001-candidates.sql, risky-triggers.sql, any .sql files for target discovery) — these are target acquisition logic.
24+
- **Scan databases** (*.db, *.db-wal, *.db-shm) — contain unpublished findings and repo-specific data.
25+
- **Triage briefs and disclosure drafts** — any file containing repo-specific vulnerability details, advisory text, or disclosure tracking.
26+
- **MEMORY.md and session state files** — contain disclosure status, maintainer contact info, and tracking IDs.
27+
- **API keys, tokens, .env files** — obvious but stated for completeness.
28+
- **GH Archive hit databases** — contain unpublished monitoring results.
29+
- **Scan result JSON/SARIF from real repos** — any output from scanning real repositories, as opposed to test fixtures.
30+
31+
### RULES
32+
33+
1. **Never commit prompt files to a public repo.** The triage agent loads prompts from a mounted volume or a private repo. The Containerfile should COPY from a local path, but the prompts directory must be in .gitignore if the repo is public.
34+
35+
2. **Never commit .sql query files to a public repo.** BigQuery discovery queries go in a private repo or stay on the research station only.
36+
37+
3. **Never commit real scan output to a public repo.** Test fixtures are synthetic. If you need a regression test based on a real workflow, anonymize it — change the repo name, strip identifying details, keep only the structural pattern.
38+
39+
4. **Never reference specific unpatched repos by name in commit messages, comments, or documentation.** Use aggregate stats only ("20 confirmed criticals across 16 repos") until the disclosure window closes.
40+
41+
5. **Never embed disclosure tracking IDs (GHSA-*, VULN-*, HackerOne report numbers) in public code or commits.** These go in private tracking only.
42+
43+
6. **The .gitignore must exclude:** `*.db`, `*.db-wal`, `*.db-shm`, `.env`, `prompts/`, `queries/`, `scans/`, `findings/`, `reports/`, `MEMORY.md`, and any directory containing triage output.
44+
45+
7. **Before every push, ask:** "Does this commit contain anything that helps an attacker evade detection or identifies an unpatched target?" If yes, do not push.
46+
47+
8. **When in doubt, keep it private.** Moving something from private to public is easy. Moving it back is impossible.

0 commit comments

Comments
 (0)