Deepen tests (~4x) + demos (~4x), harden malformed-input handling, fix POA&M numbering#6
Open
cognis-digital wants to merge 1 commit into
Open
Deepen tests (~4x) + demos (~4x), harden malformed-input handling, fix POA&M numbering#6cognis-digital wants to merge 1 commit into
cognis-digital wants to merge 1 commit into
Conversation
…mbering Tests: 116 -> 466 passing. New coverage for the STIG pack + scan, the cognis_mil models/exporters/audit/classmark layer, the datafeeds ingestion engine (offline + air-gap snapshot), the feeds enrichment edge cases (malformed OSCAL, crosswalk gaps, enhancement-notation normalisation), extended fleet correlation/drift/POA&M, CLI error paths, the make_cli builder, the connect bridge, demo output content, and fixture-directory integrity. Demos: 5 -> 20 runnable scenarios (offline, exit 0, narrated), covering every export format, malformed-input handling, pack deployment, machine-JSON fleet posture, JSON POA&M, CAPCO banner validation, the air-gap snapshot round-trip, countermeasure expansion, a three-tamper audit-chain proof, CI/CD fail-on gating, control-title resolution, drift regressions vs improvements, the full end-to-end RMF workflow, an ATT&CK coverage matrix, and the cognis-connect emit bridge. run_all.py + docs/DEMOS.md updated. Hardening + bug fixes (public API unchanged): * parse_osquery_results now surfaces empty files, unreadable files, and bare-list (single-query) osquery output as explicit diagnostics instead of silently treating them as a clean host -- a dangerous false-negative for a compliance tool. scan() records these as low-severity CO-PARSE findings and fleet.scan_host() marks the host as errored (ok=False). * poam_items() now numbers item IDs per affected asset (web01-001, db02-001) instead of using a global counter that made the first item on a second host read web01-003 -- the per-asset numbering an eMASS reviewer expects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR roughly 4x's the depth of the repo across tests and demos, hardens input handling, and fixes two real bugs — with the public API unchanged.
Tests: 116 → 466 passing
New, offline, stdlib-only coverage for:
scan()behaviour, parse-error and malformed-input paths, YAML pack emission.AuditLog(edit/delete/reorder/non-JSON tamper detection), and the CAPCO-shapeClassificationBannervalidator.update/geterror paths, and the air-gapsnapshot_export/snapshot_importround-trip (incl. path-traversal neutralisation).AC-6(2)→ac-6.2), enrich idempotency.--fail-ongating, feeds subcommands, snapshot round-trip, the cognis-connect emit bridge.Demos: 5 → 20 runnable scenarios
All offline, exit 0, narrated (
PYTHONUTF8=1), and registered inrun_all.py+docs/DEMOS.md. Scenarios 6–20 cover multi-format export, malformed-input hardening, pack deployment, machine-JSON fleet posture, JSON POA&M, banner validation, the air-gap snapshot round-trip, countermeasure expansion, a three-tamper audit-chain proof, CI/CD fail-on gating, control-title resolution, drift regressions vs improvements, the full end-to-end RMF workflow, an ATT&CK coverage matrix, and the cognis-connect emit bridge.Hardening + bug fixes (public API unchanged)
parse_osquery_resultstreated empty files and bare-list (single-query) osquery output as a clean host. For a compliance tool that manufactures false assurance. It now surfaces these as explicit diagnostics:scan()records a low-severityCO-PARSEfinding, andfleet.scan_host()marks the host errored (ok=False).poam_items()used a global counter, so the first item on a second host readweb01-003instead ofweb01-001. IDs are now per-asset sequential, the numbering an eMASS reviewer expects. (IDs remain globally unique via the host prefix.)Verification
python -m pytest -q→ 466 passedpython demos/run_all.py→ exit 0