|
|
|
|
@ -27,17 +27,17 @@ This document is a companion to the Security Plan and Verification Plan. It does
|
|
|
|
|
|
|
|
|
|
| Requirement | Test | Location | Status |
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| Config file integrity / signature verification | `TestConfigIntegrityVerification` | `tests/unit/security/config_integrity_test.go` | `✓ Exists` — Tests config loading, signing, and tamper detection (lines 14-127) |
|
|
|
|
|
| `compliance_mode: hipaa` enforces network_mode | `TestHIPAAValidation_NetworkMode` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| `compliance_mode: hipaa` enforces no_new_privileges | `TestHIPAAValidation_NoNewPrivileges` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| `compliance_mode: hipaa` enforces seccomp_profile | `TestHIPAAValidation_SeccompProfile` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| `compliance_mode: hipaa` rejects inline credentials | `TestHIPAAValidation_InlineCredentials` | `tests/unit/security/hipaa_test.go` | `✓ Exists` — Now includes env var expansion verification for RedisPassword (lines 132-140) |
|
|
|
|
|
| `AllowedSecrets` PHI denylist enforced at `Validate()` | `TestPHIDenylist_Validation` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| Manifest filename includes nonce | `TestManifestFilenameNonce` | `tests/unit/security/manifest_filename_test.go` | `✓ Exists` — Verifies cryptographic nonce generation and filename pattern (lines 17-140) |
|
|
|
|
|
| Artifact ingestion file count cap | `TestArtifactIngestionCaps` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| Artifact ingestion total size cap | `TestArtifactIngestionCaps` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| GPU detection method logged at startup | `TestGPUDetectionAudit` | `tests/unit/security/gpu_audit_test.go` | `✓ Exists` — Verifies structured logging of GPU detection at startup (lines 14-160) |
|
|
|
|
|
| Resource env vars bounded by quota enforcement | `TestResourceEnvVarParsing` | `tests/unit/security/resource_quota_test.go` | `✓ Exists` — Tests env var parsing and override behavior (lines 11-183) |
|
|
|
|
|
| Config file integrity / signature verification | `TestConfigIntegrityVerification` | `internal/security/config_integrity_test.go` | `✓ Exists` — Tests config loading, signing, and tamper detection (lines 14-127) |
|
|
|
|
|
| `compliance_mode: hipaa` enforces network_mode | `TestHIPAAValidation_NetworkMode` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| `compliance_mode: hipaa` enforces no_new_privileges | `TestHIPAAValidation_NoNewPrivileges` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| `compliance_mode: hipaa` enforces seccomp_profile | `TestHIPAAValidation_SeccompProfile` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| `compliance_mode: hipaa` rejects inline credentials | `TestHIPAAValidation_InlineCredentials` | `internal/security/hipaa_test.go` | `✓ Exists` — Now includes env var expansion verification for RedisPassword (lines 132-140) |
|
|
|
|
|
| `AllowedSecrets` PHI denylist enforced at `Validate()` | `TestPHIDenylist_Validation` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| Manifest filename includes nonce | `TestManifestFilenameNonce` | `internal/security/manifest_filename_test.go` | `✓ Exists` — Verifies cryptographic nonce generation and filename pattern (lines 17-140) |
|
|
|
|
|
| Artifact ingestion file count cap | `TestArtifactIngestionCaps` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| Artifact ingestion total size cap | `TestArtifactIngestionCaps` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| GPU detection method logged at startup | `TestGPUDetectionAudit` | `internal/security/gpu_audit_test.go` | `✓ Exists` — Verifies structured logging of GPU detection at startup (lines 14-160) |
|
|
|
|
|
| Resource env vars bounded by quota enforcement | `TestResourceEnvVarParsing` | `internal/security/resource_quota_test.go` | `✓ Exists` — Tests env var parsing and override behavior (lines 11-183) |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
@ -45,20 +45,20 @@ This document is a companion to the Security Plan and Verification Plan. It does
|
|
|
|
|
|
|
|
|
|
| Requirement | Test | Location | Status |
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| R.1 — `manifest.Artifacts.Environment` populated on every scan | `TestManifestEnvironmentCapture` | `tests/unit/reproducibility/environment_capture_test.go` | `✓ Exists` — Tests Environment population with ConfigHash and DetectionMethod (lines 15-127) |
|
|
|
|
|
| R.1 — `Environment.ConfigHash` non-empty | `TestManifestEnvironmentCapture` | `tests/unit/reproducibility/environment_capture_test.go` | `✓ Exists` — Verified in EnvironmentPopulatedInManifest subtest (line 58) |
|
|
|
|
|
| R.1 — `Environment.DetectionMethod` non-empty | `TestManifestEnvironmentCapture` | `tests/unit/reproducibility/environment_capture_test.go` | `✓ Exists` — Verified in EnvironmentPopulatedInManifest subtest (line 63) |
|
|
|
|
|
| R.2 — Resolved config hash stable (same input → same hash) | `TestConfigHash_Computation` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| R.2 — Resolved config hash differs on changed input | `TestConfigHash_Computation` | `tests/unit/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| R.2 — Hash computed after defaults and env expansion, not raw file | `TestConfigHashPostDefaults` | `tests/unit/reproducibility/config_hash_test.go` | `✓ Exists` — Tests hash computation after env expansion and defaults (lines 14-118) |
|
|
|
|
|
| R.3 — `CreateDetectorWithInfo` result written to manifest | `TestGPUDetectionWrittenToManifest` | `tests/unit/reproducibility/` | `✓ Exists` — **Covered by:** `TestAMDAliasManifestRecord` in `tests/unit/gpu/gpu_detector_test.go` tests GPU detection and manifest recording (lines 87-138) |
|
|
|
|
|
| R.3 — AMD alias recorded as `configured_vendor` in manifest | `TestAMDAliasManifestRecord` | `tests/unit/gpu/gpu_detector_test.go` | `✓ Exists` — Test renamed and enhanced with manifest recording validation (line 87-138) |
|
|
|
|
|
| R.4 — `ProvenanceBestEffort=false` fails on incomplete environment | `TestProvenanceBestEffortEnforcement` | `tests/unit/reproducibility/` | `✓ Exists` — Covered by `TestEnforceTaskProvenance_StrictMissingOrMismatchFails` in `tests/unit/worker/worker_test.go` |
|
|
|
|
|
| R.4 — `ProvenanceBestEffort=true` succeeds on incomplete environment | `TestProvenanceBestEffortPermissive` | `tests/unit/reproducibility/` | `✓ Exists` — Covered by `TestEnforceTaskProvenance_BestEffortOverwrites` in `tests/unit/worker/worker_test.go` |
|
|
|
|
|
| R.5 — Scan exclusions recorded in manifest | `TestScanExclusionsRecorded` | `tests/unit/worker/artifacts_test.go` | `✓ Exists` — Renamed from TestScanArtifacts_SkipsKnownPathsAndLogs, validates exclusions recorded with reasons (lines 71-116) |
|
|
|
|
|
| R.5 — `*.log` exclusion reason recorded | `TestScanExclusionsRecorded` | `tests/unit/worker/artifacts_test.go` | `✓ Exists` — Verified in exclusion reason check (line 85) |
|
|
|
|
|
| R.5 — `code/` exclusion reason recorded | `TestScanExclusionsRecorded` | `tests/unit/worker/artifacts_test.go` | `✓ Exists` — Verified in exclusion reason check (line 87) |
|
|
|
|
|
| R.5 — `snapshot/` exclusion reason recorded | `TestScanExclusionsRecorded` | `tests/unit/worker/artifacts_test.go` | `✓ Exists` — Verified in exclusion reason check (line 89) |
|
|
|
|
|
| R.1 — `manifest.Artifacts.Environment` populated on every scan | `TestManifestEnvironmentCapture` | `internal/tracking/environment_capture_test.go` | `✓ Exists` — Tests Environment population with ConfigHash and DetectionMethod (lines 15-127) |
|
|
|
|
|
| R.1 — `Environment.ConfigHash` non-empty | `TestManifestEnvironmentCapture` | `internal/tracking/environment_capture_test.go` | `✓ Exists` — Verified in EnvironmentPopulatedInManifest subtest (line 58) |
|
|
|
|
|
| R.1 — `Environment.DetectionMethod` non-empty | `TestManifestEnvironmentCapture` | `internal/tracking/environment_capture_test.go` | `✓ Exists` — Verified in EnvironmentPopulatedInManifest subtest (line 63) |
|
|
|
|
|
| R.2 — Resolved config hash stable (same input → same hash) | `TestConfigHash_Computation` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| R.2 — Resolved config hash differs on changed input | `TestConfigHash_Computation` | `internal/security/hipaa_test.go` | `✓ Exists` |
|
|
|
|
|
| R.2 — Hash computed after defaults and env expansion, not raw file | `TestConfigHashPostDefaults` | `internal/tracking/config_hash_test.go` | `✓ Exists` — Tests hash computation after env expansion and defaults (lines 14-118) |
|
|
|
|
|
| R.3 — `CreateDetectorWithInfo` result written to manifest | `TestGPUDetectionWrittenToManifest` | `internal/tracking/` | `✓ Exists` — **Covered by:** `TestAMDAliasManifestRecord` in `internal/resources/gpu_detector_test.go` tests GPU detection and manifest recording (lines 87-138) |
|
|
|
|
|
| R.3 — AMD alias recorded as `configured_vendor` in manifest | `TestAMDAliasManifestRecord` | `internal/resources/gpu_detector_test.go` | `✓ Exists` — Test renamed and enhanced with manifest recording validation (line 87-138) |
|
|
|
|
|
| R.4 — `ProvenanceBestEffort=false` fails on incomplete environment | `TestProvenanceBestEffortEnforcement` | `internal/tracking/` | `✓ Exists` — Covered by `TestEnforceTaskProvenance_StrictMissingOrMismatchFails` in `internal/worker/worker_test.go` |
|
|
|
|
|
| R.4 — `ProvenanceBestEffort=true` succeeds on incomplete environment | `TestProvenanceBestEffortPermissive` | `internal/tracking/` | `✓ Exists` — Covered by `TestEnforceTaskProvenance_BestEffortOverwrites` in `internal/worker/worker_test.go` |
|
|
|
|
|
| R.5 — Scan exclusions recorded in manifest | `TestScanExclusionsRecorded` | `internal/worker/artifacts_test.go` | `✓ Exists` — Renamed from TestScanArtifacts_SkipsKnownPathsAndLogs, validates exclusions recorded with reasons (lines 71-116) |
|
|
|
|
|
| R.5 — `*.log` exclusion reason recorded | `TestScanExclusionsRecorded` | `internal/worker/artifacts_test.go` | `✓ Exists` — Verified in exclusion reason check (line 85) |
|
|
|
|
|
| R.5 — `code/` exclusion reason recorded | `TestScanExclusionsRecorded` | `internal/worker/artifacts_test.go` | `✓ Exists` — Verified in exclusion reason check (line 87) |
|
|
|
|
|
| R.5 — `snapshot/` exclusion reason recorded | `TestScanExclusionsRecorded` | `internal/worker/artifacts_test.go` | `✓ Exists` — Verified in exclusion reason check (line 89) |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
@ -68,7 +68,7 @@ This document is a companion to the Security Plan and Verification Plan. It does
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| `manifest.Artifacts` schema matches committed version | `TestSchemaUnchanged` | `internal/manifest/schema_test.go` | `✓ Exists` |
|
|
|
|
|
| `Environment` field required in schema | `TestSchemaEnvironmentRequired` | `internal/manifest/` | `✓ Exists` — **Covered by:** `TestSchemaRejectsInvalidManifest` in `internal/manifest/schema_test.go` validates missing `environment.config_hash` is rejected |
|
|
|
|
|
| `DetectionMethod` constrained to enum values in schema | `TestSchemaDetectionMethodEnum` | `tests/unit/manifest/schema_test.go` | `✓ Exists` — **Covered by:** `TestSchemaRejectsInvalidManifest` validates `compliance_mode` enum; `gpu_detection_method` validated in environment capture tests |
|
|
|
|
|
| `DetectionMethod` constrained to enum values in schema | `TestSchemaDetectionMethodEnum` | `internal/manifest/schema_test.go` | `✓ Exists` — **Covered by:** `TestSchemaRejectsInvalidManifest` validates `compliance_mode` enum; `gpu_detection_method` validated in environment capture tests |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
@ -92,7 +92,7 @@ Not tests themselves — packages and targets that must achieve >80% mutation ki
|
|
|
|
|
| `pkg/worker/config.go` | `ProvenanceBestEffort` enforcement branch, HIPAA hard-requirement checks, credential denylist |
|
|
|
|
|
| `pkg/worker/gpu_detector.go` | `CreateDetectorWithInfo` call site, `DetectionInfo` capture |
|
|
|
|
|
| `internal/manifest/` | `Environment` nil check, `Exclusions` population, schema version check |
|
|
|
|
|
| `tests/unit/security/` | PHI denylist logic, inline credential detection |
|
|
|
|
|
| `internal/security/` | PHI denylist logic, inline credential detection |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
@ -113,8 +113,8 @@ Not tests — static analysis rules enforced at compile time in CI. All four mus
|
|
|
|
|
|
|
|
|
|
| Requirement | Test | Location | Status |
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| Chained hash detects tampered entry | `TestAuditChainTamperDetection` | `tests/unit/security/audit_test.go` | `✓ Exists` — **Covered by:** `TestAuditLogger_VerifyChain` validates tamper detection (lines 89-100) |
|
|
|
|
|
| Chained hash detects deleted entry | `TestAuditChainDeletionDetection` | `tests/unit/security/audit_test.go` | `✓ Exists` — **Covered by:** `TestAuditLogger_VerifyChain` validates chain break detection via `prev_hash` mismatch (lines 102-113) |
|
|
|
|
|
| Chained hash detects tampered entry | `TestAuditChainTamperDetection` | `internal/security/audit_test.go` | `✓ Exists` — **Covered by:** `TestAuditLogger_VerifyChain` validates tamper detection (lines 89-100) |
|
|
|
|
|
| Chained hash detects deleted entry | `TestAuditChainDeletionDetection` | `internal/security/audit_test.go` | `✓ Exists` — **Covered by:** `TestAuditLogger_VerifyChain` validates chain break detection via `prev_hash` mismatch (lines 102-113) |
|
|
|
|
|
| Background verification job alerts on chain break | `TestAuditVerificationJob` | `tests/integration/audit/verification_test.go` | `✓ Exists` — Integration test for audit chain verification (lines 14-126) |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
@ -165,15 +165,15 @@ The following tests exist but use different naming conventions than specified in
|
|
|
|
|
|
|
|
|
|
| Coverage Map Name | Actual Test Name | Location | Relationship |
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| `TestGPUDetectionAudit` | `TestGPUDetectorEnvOverrides`, `TestGPUDetectorDetectionSources`, `TestGPUDetectorInfoFields` | `tests/unit/gpu/gpu_detector_test.go` | Tests GPU detection but not audit logging |
|
|
|
|
|
| `TestAMDAliasManifestRecord` | `TestGPUDetectorAMDVendorAlias` | `tests/unit/gpu/gpu_detector_test.go` | Tests AMD vendor aliasing but not manifest recording |
|
|
|
|
|
| `TestGPUDetectionAudit` | `TestGPUDetectorEnvOverrides`, `TestGPUDetectorDetectionSources`, `TestGPUDetectorInfoFields` | `internal/resources/gpu_detector_test.go` | Tests GPU detection but not audit logging |
|
|
|
|
|
| `TestAMDAliasManifestRecord` | `TestGPUDetectorAMDVendorAlias` | `internal/resources/gpu_detector_test.go` | Tests AMD vendor aliasing but not manifest recording |
|
|
|
|
|
| `TestGPUDetectionWrittenToManifest` | N/A - uses same tests as above | - | GPU detection tests don't verify manifest writing |
|
|
|
|
|
| `TestProvenanceBestEffortEnforcement` | `TestEnforceTaskProvenance_StrictMissingOrMismatchFails` | `tests/unit/worker/worker_test.go` | Tests strict provenance enforcement |
|
|
|
|
|
| `TestProvenanceBestEffortPermissive` | `TestEnforceTaskProvenance_BestEffortOverwrites` | `tests/unit/worker/worker_test.go` | Tests best-effort provenance behavior |
|
|
|
|
|
| `TestScanExclusionsRecorded` | `TestScanArtifacts_SkipsKnownPathsAndLogs` | `tests/unit/worker/artifacts_test.go` | Tests scan exclusions but not manifest recording |
|
|
|
|
|
| `TestProvenanceBestEffortEnforcement` | `TestEnforceTaskProvenance_StrictMissingOrMismatchFails` | `internal/worker/worker_test.go` | Tests strict provenance enforcement |
|
|
|
|
|
| `TestProvenanceBestEffortPermissive` | `TestEnforceTaskProvenance_BestEffortOverwrites` | `internal/worker/worker_test.go` | Tests best-effort provenance behavior |
|
|
|
|
|
| `TestScanExclusionsRecorded` | `TestScanArtifacts_SkipsKnownPathsAndLogs` | `internal/worker/artifacts_test.go` | Tests scan exclusions but not manifest recording |
|
|
|
|
|
| `TestSandboxSyscallBlocking` | `TestSandboxSeccompEnforcement` | `tests/integration/security/sandbox_escape_test.go` | Tests seccomp syscall blocking |
|
|
|
|
|
| `TestAuditChainTamperDetection` | `TestAuditLogger_VerifyChain` (tamper portion) | `tests/unit/security/audit_test.go` | Lines 89-100 test tamper detection |
|
|
|
|
|
| `TestAuditChainDeletionDetection` | `TestAuditLogger_VerifyChain` (chain break portion) | `tests/unit/security/audit_test.go` | Lines 102-113 test prev_hash mismatch |
|
|
|
|
|
| `TestAuditChainTamperDetection` | `TestAuditLogger_VerifyChain` (tamper portion) | `internal/security/audit_test.go` | Lines 89-100 test tamper detection |
|
|
|
|
|
| `TestAuditChainDeletionDetection` | `TestAuditLogger_VerifyChain` (chain break portion) | `internal/security/audit_test.go` | Lines 102-113 test prev_hash mismatch |
|
|
|
|
|
| `TestSchemaEnvironmentRequired` | `TestSchemaRejectsInvalidManifest` (portion) | `internal/manifest/schema_test.go` | Tests missing environment.config_hash rejection |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
@ -184,11 +184,11 @@ These tests exist and provide related functionality testing, but don't fully cov
|
|
|
|
|
|
|
|
|
|
| Requirement Area | Related Tests | Location | Gap |
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| GPU Detection | `TestGPUDetectorEnvOverrides`, `TestGPUDetectorAMDVendorAlias`, `TestGPUDetectorDetectionSources`, `TestGPUDetectorInfoFields`, `TestGPUDetectorEnvCountOverride` | `tests/unit/gpu/gpu_detector_test.go` | No manifest writing validation; no startup audit logging |
|
|
|
|
|
| Artifact Scanning | `TestScanArtifacts_SkipsKnownPathsAndLogs` | `tests/unit/worker/artifacts_test.go` | No `Environment` population check; no exclusion reason recording in manifest |
|
|
|
|
|
| Provenance | `TestEnforceTaskProvenance_StrictMissingOrMismatchFails`, `TestEnforceTaskProvenance_BestEffortOverwrites`, `TestComputeTaskProvenance` | `tests/unit/worker/worker_test.go` | Different test structure than coverage map specifies |
|
|
|
|
|
| GPU Detection | `TestGPUDetectorEnvOverrides`, `TestGPUDetectorAMDVendorAlias`, `TestGPUDetectorDetectionSources`, `TestGPUDetectorInfoFields`, `TestGPUDetectorEnvCountOverride` | `internal/resources/gpu_detector_test.go` | No manifest writing validation; no startup audit logging |
|
|
|
|
|
| Artifact Scanning | `TestScanArtifacts_SkipsKnownPathsAndLogs` | `internal/worker/artifacts_test.go` | No `Environment` population check; no exclusion reason recording in manifest |
|
|
|
|
|
| Provenance | `TestEnforceTaskProvenance_StrictMissingOrMismatchFails`, `TestEnforceTaskProvenance_BestEffortOverwrites`, `TestComputeTaskProvenance` | `internal/worker/worker_test.go` | Different test structure than coverage map specifies |
|
|
|
|
|
| Schema Validation | `TestSchemaValidatesExampleManifest`, `TestSchemaRejectsInvalidManifest` | `internal/manifest/schema_test.go` | Exist and provide good coverage |
|
|
|
|
|
| Manifest | `TestRunManifestWriteLoadAndMarkFinished`, `TestRunManifestApplyNarrativePatchPartialUpdate` | `tests/unit/manifest/run_manifest_test.go` | Basic manifest operations tested |
|
|
|
|
|
| Manifest | `TestRunManifestWriteLoadAndMarkFinished`, `TestRunManifestApplyNarrativePatchPartialUpdate` | `internal/manifest/run_manifest_test.go` | Basic manifest operations tested |
|
|
|
|
|
| Sandbox Security | `TestSandboxCapabilityDrop`, `TestSandboxNoNewPrivileges`, `TestSandboxSeccompEnforcement`, `TestSandboxNetworkIsolation`, `TestSandboxFilesystemEscape` | `tests/integration/security/sandbox_escape_test.go` | Comprehensive sandbox tests exist |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
@ -252,9 +252,9 @@ Work through gaps in this order:
|
|
|
|
|
- `TestConfigHashPostDefaults` - Hash computation after env expansion and defaults
|
|
|
|
|
|
|
|
|
|
### Files Modified
|
|
|
|
|
- `tests/unit/gpu/gpu_detector_test.go`
|
|
|
|
|
- `tests/unit/worker/artifacts_test.go`
|
|
|
|
|
- `tests/unit/security/hipaa_validation_test.go`
|
|
|
|
|
- `internal/resources/gpu_detector_test.go`
|
|
|
|
|
- `internal/worker/artifacts_test.go`
|
|
|
|
|
- `internal/security/hipaa_validation_test.go`
|
|
|
|
|
- `internal/worker/artifacts.go` (added exclusions recording)
|
|
|
|
|
- `internal/manifest/run_manifest.go` (nonce-based filename support)
|
|
|
|
|
- 6 new test files created
|
|
|
|
|
|