mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-08-01 08:30:20 +00:00
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):
- brain/ LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
dispatch, A51 channels, and the OSINT cluster
- knowledge/ LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
MITRE ATT&CK data
- reference/ defensive threat-reference (C3, shhbruh doc) + AdaYaml parser
License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.
Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.
https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
49 lines
1.3 KiB
Markdown
49 lines
1.3 KiB
Markdown
# API Reference: Implementing API Key Security Controls
|
|
|
|
## Secure Key Generation
|
|
|
|
```python
|
|
import secrets, hashlib
|
|
key = f"sk_{secrets.token_hex(32)}"
|
|
key_hash = hashlib.sha256(key.encode()).hexdigest() # Store hash only
|
|
```
|
|
|
|
## Leaked Key Patterns
|
|
|
|
| Pattern | Service |
|
|
|---------|---------|
|
|
| `sk_live_[a-zA-Z0-9]{24,}` | Stripe |
|
|
| `AKIA[0-9A-Z]{16}` | AWS |
|
|
| `AIza[0-9A-Za-z_-]{35}` | Google |
|
|
| `ghp_[a-zA-Z0-9]{36}` | GitHub PAT |
|
|
| `sk-[a-zA-Z0-9]{48}` | OpenAI |
|
|
|
|
## Key Rotation Policy
|
|
|
|
| Criteria | Threshold | Severity |
|
|
|----------|-----------|----------|
|
|
| Key age > 90 days | Rotation required | HIGH |
|
|
| Unused > 30 days | Revocation candidate | MEDIUM |
|
|
| Wildcard scope | Scope reduction needed | HIGH |
|
|
| Shared across IPs | Possible leak | HIGH |
|
|
|
|
## TruffleHog Scanning
|
|
|
|
```bash
|
|
trufflehog filesystem --directory /path/to/code --json
|
|
trufflehog git https://github.com/org/repo --json
|
|
```
|
|
|
|
## GitHub Secret Scanning API
|
|
|
|
```bash
|
|
curl -H "Authorization: token $TOKEN" \
|
|
https://api.github.com/repos/OWNER/REPO/secret-scanning/alerts
|
|
```
|
|
|
|
### References
|
|
|
|
- GitHub Secret Scanning: https://docs.github.com/en/code-security/secret-scanning
|
|
- TruffleHog: https://github.com/trufflesecurity/trufflehog
|
|
- OWASP API Key Management: https://cheatsheetseries.owasp.org/cheatsheets/API_Security_Cheat_Sheet.html
|