Security Policy
Canontra is built to run safely on untrusted repositories, CI runners, and offline air-gapped networks (Canontra.Security.Path, Canontra.Cache.SlabV7, Canontra.Harness.*).
1. Offline & Air-Gapped Guarantees
Section titled “1. Offline & Air-Gapped Guarantees”- Zero Network Libraries:
canontra.cabalimports no HTTP, socket, TLS, or RPC packages. - Zero Telemetry: No source code, file paths, or metrics ever leave the local machine.
- Zero C-FFI Dependencies: All parsers and graph engines run in pure, memory-safe Haskell without
libtree-sitteror native dynamic libraries.
2. Path Sandboxing & Loop Detection
Section titled “2. Path Sandboxing & Loop Detection”- Root Containment: Target paths pass through
canonicalizeSafePathto ensure they stay inside the project root. Sequences like../../etc/passwdor cross-drive jumps fail immediately with Exit Code4. - Null-Byte Rejection: Paths with embedded
\0bytes are rejected before calling OS filesystem APIs. - Symlink & Junction Cycle Breaking: Directory walks track
FileNodeIdentity(fniVolumeID,fniFileID) to stop circular symlinks and Windows NTFS junctions before stack overflow can occur.
3. Hard Resource Limits
Section titled “3. Hard Resource Limits”- Maximum File Size:
50 MB(52,428,800bytes) per source file. - Maximum Directory Depth:
64directory levels. - Bounded Graph Passes: Dominator-tree, RPO, and CSR multi-source BFS allocations stay strictly bounded by vertex count
|V|.
4. CNTR\x07 (SlabV7) Cache & Git Subprocess Safety
Section titled “4. CNTR\x07 (SlabV7) Cache & Git Subprocess Safety”- 4KB CRC-32C Integrity: Every payload page storing 9-tier bundles and
FileGraphSummarydata carries an IEEE 802.3 CRC-32C checksum (decodeSlabV7Resilient/readSlabV7FileResilient). Damaged pages are dropped and recomputed without crashing. - Atomic Swap with Retry: Cache writes stage to
.tmp.<pid>and rename viaatomicSwapWithRetry/atomicSwapWithRetry_(exponential backoff with jitter) to survive Windows Defender or SearchIndexer locks. - Shell-Free Read-Only Git Calls:
git diff,git ls-tree, andgit showrun viaSystem.Process.readProcessWithExitCodewith explicit argument arrays (never invokingsh,cmd.exe, orpowershell.exe), and returned paths pass throughcanonicalizeSafePath.
5. canontra snap (Alpha) Rollback Safety
Section titled “5. canontra snap (Alpha) Rollback Safety”- Zero
.gitChanges & Auto-Ignore:.canontra/snaps/stores local blobs (objects/), manifests (manifests/),HEAD, andledger.jsonlwithout runninggitwrite commands;ensureSnapStorecreates.canontra/.gitignoreautomatically. - ID & Path Validation:
isSafeSnapIdrejects..,/,\, and leading dots with Exit Code4;snap rewindvalidates every path with bothisSafeRelativeFilePathandcanonicalizeSafePathbefore touching disk. - Preflight SHA-256 Verification:
preflightRewindreads and SHA-256 verifies every object viareadVerifiedBlobbefore modifying or deleting any workspace file; tampered objects abort with zero partial disk changes. - Untracked File Preservation: Rollbacks only delete files tracked in
HEADthat do not exist in the target snapshot, leaving unrelated user files untouched.
6. Automated CI Security Checks (.github/workflows/security.yml)
Section titled “6. Automated CI Security Checks (.github/workflows/security.yml)”Every Pull Request and push to main runs automated security checks in .github/workflows/security.yml:
- Zero-Trust Architectural Gate: Confirms zero networking or C-FFI imports exist in Haskell source or
.cabaldependencies. - Gitleaks OSS: Scans commit history and diffs for leaked secrets or tokens.
- Google OSV-Scanner: Checks dependencies against known open-source vulnerability advisories.
zizmor: Audits GitHub Actions workflows for script-injection, over-privileged tokens, and unpinned action risks.
7. Reporting a Vulnerability
Section titled “7. Reporting a Vulnerability”- Private Advisory: github.com/symtrace/canontra/security/advisories/new
- Issue Tracker: github.com/symtrace/canontra/issues (use
[SECURITY] Canontra Vulnerability Reportfor non-sensitive bugs) - Response SLA: Acknowledgement within 48 hours with a triage timeline; coordinated disclosure before public details.