Skip to content

Repo hardening: fix install instructions, dead imports, hygiene#2

Open
cognis-digital wants to merge 3 commits into
mainfrom
cognis-audit/repo-hardening
Open

Repo hardening: fix install instructions, dead imports, hygiene#2
cognis-digital wants to merge 3 commits into
mainfrom
cognis-audit/repo-hardening

Conversation

@cognis-digital

@cognis-digital cognis-digital commented Jun 12, 2026

Copy link
Copy Markdown
Owner

This PR applies a few small, mechanically-verified hardening fixes found by an automated audit of the Cognis suite:

  • fix 1 broken pip install line(s) in README (package is not on PyPI; use the working git+https install)
  • remove 16 unused import(s) (ruff F401/F811)

Each change is deterministic; all touched Python files were confirmed to still compile (py_compile) before this PR was opened.

@cognis-digital cognis-digital force-pushed the cognis-audit/repo-hardening branch from ff04fa5 to 23eefd8 Compare June 12, 2026 21:47
…rehensive cross-platform install scripts

- README opens with a plain-language "What is this?" overview
- comprehensive Install section + install.sh / install.ps1 (pipx / uv / pip git+https / source)
- verified build-out: real test + CLI audit embedded (README Verification + AUDIT.md)
@cognis-digital cognis-digital force-pushed the cognis-audit/repo-hardening branch from 2a97d39 to 4609aab Compare June 13, 2026 12:40
Cognis Digital added 2 commits June 13, 2026 09:18
- scan() now raises FileNotFoundError for missing targets so the CLI
  surfaces a clear message (exit 2) instead of a raw traceback
- parse_osquery_results guards against missing files, empty files,
  malformed JSON, and unexpected shapes — returns {_error} dict each time
- scan() skips non-list query values silently rather than crashing
- emit_query_pack encodes output files with explicit utf-8
- make_cli wraps scan_fn calls in FileNotFoundError / ValueError /
  Exception handlers with clean stderr messages and non-zero exit codes
- make_cli uses open(..., encoding='utf-8') when writing --out files and
  wraps that in OSError handling
- Fix all ruff F/E violations across cognis_mil and comint_osquery
  (F401 re-export aliases, E401/E701/E702/E722/F541)
- Add tests/test_hardening.py: 10 tests covering missing file, empty file,
  malformed JSON, unexpected JSON shape, missing target dir,
  malformed-file finding, empty dir scan, non-list rows, file write, no-out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant