Skip to content

feat: offline security inspection plugin with runtime, drift, and pol… - #498

Open
KodeCharya wants to merge 4 commits into
NVIDIA:mainfrom
KodeCharya:main
Open

feat: offline security inspection plugin with runtime, drift, and pol…#498
KodeCharya wants to merge 4 commits into
NVIDIA:mainfrom
KodeCharya:main

Conversation

@KodeCharya

Copy link
Copy Markdown

Add 100% offline, deterministic security inspection plugin for NVIDIA Skill Inspector.

Core (9 modules, air-gapped, no cloud/LLM/telemetry):

  • Dependency graph: networkx DiGraph + AST/import + manifest, Cytoscape (vendored offline) + cycle detection
  • Permissions: declared vs observed (filesystem/network/subprocess/env/mcp) + least-privilege
  • Provenance: SHA-256 + author/origin/version history + SQLite (~/.skill-inspector/)
  • Secrets: 16 regex + Shannon entropy >=4.2 + logging detection (SEC-*)
  • Diff: git plumbing + difflib fallback + escalation detection
  • SBOM: CycloneDX 1.5 + pURLs + hashes per-skill + aggregate
  • Scorecard: severity×category weighted 0–100 + grade A–F
  • Privacy: PII/Credentials/Financial/... + read/write/transmit flow
  • Reporting: FastAPI + Jinja2 on 127.0.0.1 only, vendored cytoscape.min.js

Intelligence layer (new):

  • Runtime Behavior Monitor: isolated tempfile sandbox, audit-hook/monkey-patch collectors for filesystem/network/processes/env/executables/package/MCP/DNS/outbound
  • SecurityEvent normalized model (source/category/action/subject/target/capability) → EventGraph
  • Drift Analyzer: declared vs static vs runtime → MATCH/UNDER_DECLARED/OVER_DECLARED
  • Correlation Engine: credential→file→subprocess→network attack paths (CRED_EXFIL, DATA_EXFIL)
  • Policy-as-Code: YAML allow/deny → PASS/WARN/BLOCK (policy check)
  • Regression Engine: security-diff old/ new/ → risk/grade delta + BLOCK decision

Integration:

  • src/skillspector/security_inspection/* + src/skillspector/nodes/analyzers/offline_security_inspection.py (auto-discovered)
  • CLI: offline-scan --runtime, runtime-scan, policy, security-diff, security-report/server
  • pyproject: yara conditional for Windows, networkx/jinja2/fastapi/uvicorn, hatch templates/static
  • Tests: 44 passed (plugin/tests/test_security_plugin.py + test_comprehensive.py)
  • THIRD_PARTY_NOTICES.md for vendored cytoscape (offline, no CDN)

Storage: SQLite + SBOM + reports under ~/.skill-inspector/, loopback only.

…icy enforcement

Add 100% offline, deterministic security inspection plugin for NVIDIA Skill Inspector.

Core (9 modules, air-gapped, no cloud/LLM/telemetry):
- Dependency graph: networkx DiGraph + AST/import + manifest, Cytoscape (vendored offline) + cycle detection
- Permissions: declared vs observed (filesystem/network/subprocess/env/mcp) + least-privilege
- Provenance: SHA-256 + author/origin/version history + SQLite (~/.skill-inspector/)
- Secrets: 16 regex + Shannon entropy >=4.2 + logging detection (SEC-*)
- Diff: git plumbing + difflib fallback + escalation detection
- SBOM: CycloneDX 1.5 + pURLs + hashes per-skill + aggregate
- Scorecard: severity×category weighted 0–100 + grade A–F
- Privacy: PII/Credentials/Financial/... + read/write/transmit flow
- Reporting: FastAPI + Jinja2 on 127.0.0.1 only, vendored cytoscape.min.js

Intelligence layer (new):
- Runtime Behavior Monitor: isolated tempfile sandbox, audit-hook/monkey-patch collectors for filesystem/network/processes/env/executables/package/MCP/DNS/outbound
- SecurityEvent normalized model (source/category/action/subject/target/capability) → EventGraph
- Drift Analyzer: declared vs static vs runtime → MATCH/UNDER_DECLARED/OVER_DECLARED
- Correlation Engine: credential→file→subprocess→network attack paths (CRED_EXFIL, DATA_EXFIL)
- Policy-as-Code: YAML allow/deny → PASS/WARN/BLOCK (policy check)
- Regression Engine: security-diff old/ new/ → risk/grade delta + BLOCK decision

Integration:
- src/skillspector/security_inspection/* + src/skillspector/nodes/analyzers/offline_security_inspection.py (auto-discovered)
- CLI: offline-scan --runtime, runtime-scan, policy, security-diff, security-report/server
- pyproject: yara conditional for Windows, networkx/jinja2/fastapi/uvicorn, hatch templates/static
- Tests: 44 passed (plugin/tests/test_security_plugin.py + test_comprehensive.py)
- THIRD_PARTY_NOTICES.md for vendored cytoscape (offline, no CDN)

Storage: SQLite + SBOM + reports under ~/.skill-inspector/, loopback only.
…ine plugin

Signed-off-by: Kode Charya(Mukesh Choudhary) <Kodecharya@gmail.com>
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