|
| 1 | +# Security Policy |
| 2 | + |
| 3 | +## Supported Versions |
| 4 | + |
| 5 | +| Version | Supported | |
| 6 | +|---------|-----------| |
| 7 | +| 1.x | ✅ Active | |
| 8 | + |
| 9 | +## Security Design Principles |
| 10 | + |
| 11 | +TSG is built with a **security-first** philosophy: |
| 12 | + |
| 13 | +### 🛡️ Read-Only Monitoring |
| 14 | +- The monitor **never modifies** Copilot session files (`events.jsonl`, `session.db`, `workspace.yaml`) |
| 15 | +- All session diagnostics are performed by reading file metadata only |
| 16 | +- No write operations are performed on any files outside `~/.tsg/` |
| 17 | + |
| 18 | +### 🔒 Zero External Dependencies |
| 19 | +- TSG has **no third-party NuGet dependencies** — only .NET 10 SDK libraries |
| 20 | +- This eliminates supply-chain attack vectors entirely |
| 21 | +- Verified via `dotnet list package --vulnerable --include-transitive` |
| 22 | + |
| 23 | +### 🔍 Static Analysis |
| 24 | +- Built with `AnalysisLevel=latest-all` (.NET Roslyn analyzers at maximum strictness) |
| 25 | +- `NuGetAudit=true` with `NuGetAuditLevel=low` enabled in CI |
| 26 | +- All CA1031 (broad exception), CA1062 (null validation) findings resolved |
| 27 | +- CI runs `dotnet format --verify-no-changes` to enforce code style |
| 28 | + |
| 29 | +### 📦 Package Integrity |
| 30 | +- Published via GitHub Actions with `--skip-duplicate` to prevent version overwriting |
| 31 | +- NuGet API key stored as GitHub encrypted secret (`NUGET_TSG_API_KEY`) |
| 32 | +- Packages are signed by NuGet.org's repository signature |
| 33 | +- Source link enabled for debuggable builds |
| 34 | + |
| 35 | +### 🖥️ Permissions |
| 36 | +- **No network access** — TSG never makes HTTP calls (except optional `Test-Connection` in monitor) |
| 37 | +- **File access** limited to: |
| 38 | + - `~/.tsg/` — scripts and snapshots (read/write) |
| 39 | + - `~/.copilot/session-state/` — session metadata (read-only) |
| 40 | + - PowerShell profile — appends a marked block (write, with clean uninstall) |
| 41 | + - Windows Terminal Fragments dir — drops a JSON file (write, with clean uninstall) |
| 42 | +- **Process operations**: reads process list, optionally sets priority (requires Admin/sudo) |
| 43 | + |
| 44 | +### 🧪 Security Audit Results |
| 45 | + |
| 46 | +``` |
| 47 | +Vulnerability Scan: ✅ 0 vulnerable packages |
| 48 | +Deprecated Packages: ✅ 0 deprecated packages |
| 49 | +Static Analysis (CA): ✅ 0 security warnings |
| 50 | +NuGet Audit: ✅ Enabled (level: low, mode: all) |
| 51 | +External Dependencies: ✅ None (zero third-party packages) |
| 52 | +``` |
| 53 | + |
| 54 | +## Reporting a Vulnerability |
| 55 | + |
| 56 | +If you discover a security vulnerability, please report it responsibly: |
| 57 | + |
| 58 | +1. **Do NOT** open a public GitHub issue |
| 59 | +2. Email: [Create a private security advisory](https://github.com/sbay-dev/TerminalStateGuard/security/advisories/new) |
| 60 | +3. Include: description, reproduction steps, and impact assessment |
| 61 | + |
| 62 | +We will respond within 48 hours and issue a patch release if confirmed. |
| 63 | + |
| 64 | +## Security Scanning in CI |
| 65 | + |
| 66 | +Every release is automatically scanned: |
| 67 | + |
| 68 | +```yaml |
| 69 | +# .github/workflows/release.yml |
| 70 | +- dotnet list package --vulnerable --include-transitive |
| 71 | +- dotnet build with AnalysisLevel=latest-all |
| 72 | +- dotnet format --verify-no-changes |
| 73 | +``` |
0 commit comments