| 01-foundation |
03 |
database |
| sqlite |
| aes-256-gcm |
| argon2id |
| encryption |
| storage |
| modernc-sqlite |
|
| phase |
provides |
| 01-foundation-01 |
go.mod with modernc.org/sqlite and golang.org/x/crypto dependencies |
|
|
| AES-256-GCM column encryption (Encrypt/Decrypt) with random nonce prepended |
| Argon2id key derivation (DeriveKey/NewSalt) using RFC 9106 parameters |
| SQLite database Open() with WAL mode and embedded schema migration |
| Finding CRUD |
| SaveFinding encrypts key_value at boundary, ListFindings decrypts transparently |
|
| MaskKey helper |
| first8...last4 display format |
|
| schema.sql with findings, scans, settings tables and performance indexes |
|
| 01-04-scanner |
| 01-05-cli |
| 17-dashboard |
| 18-telegram |
|
| added |
patterns |
| modernc.org/sqlite v1.48.1 (pure Go SQLite, CGO-free) |
| golang.org/x/crypto (argon2.IDKey for key derivation) |
| crypto/aes + crypto/cipher (stdlib AES-256-GCM) |
|
| Encrypt-at-boundary: SaveFinding encrypts, ListFindings decrypts — storage layer handles all crypto transparently |
| go:embed schema.sql — schema migrated on Open(), idempotent via CREATE TABLE IF NOT EXISTS |
| WAL mode enabled on every Open() for concurrent read performance |
| NULL scan_id: zero-value ScanID stored as SQL NULL to satisfy FK constraint |
|
|
| created |
modified |
| pkg/storage/encrypt.go |
| pkg/storage/crypto.go |
| pkg/storage/db.go |
| pkg/storage/findings.go |
| pkg/storage/schema.sql |
| pkg/storage/db_test.go |
|
|
|
| Argon2id over PBKDF2: RFC 9106 recommended, memory-hard, resolves blocker from STATE.md |
| NULL scan_id for findings without parent scan — FK constraint satisfied without mandatory scan creation |
| Nonce prepended to ciphertext in single []byte — simplifies storage (no separate column needed) |
| MaskKey returns first8...last4 — consistent with plan spec, 12-char minimum before masking |
|
| Pattern: Encrypt-at-boundary — pkg/storage is the only layer that sees encrypted bytes |
| Pattern: sql.NullInt64 for nullable FK columns in scan results |
| Pattern: go:embed for all embedded assets — schema.sql embedded in db.go |
|
|
3min |
2026-04-04 |