Skip to content

feat: enterprise security gaps — RBAC, audit, exceptions, baseline, SIEM, dedup#127

Merged
andres-linero merged 9 commits intomainfrom
feat/enterprise-gaps
Mar 2, 2026
Merged

feat: enterprise security gaps — RBAC, audit, exceptions, baseline, SIEM, dedup#127
andres-linero merged 9 commits intomainfrom
feat/enterprise-gaps

Conversation

@msaad00
Copy link
Owner

@msaad00 msaad00 commented Mar 2, 2026

Summary

Addresses 10 critical enterprise gaps identified during the security team scenario evaluation:

# Gap Module Coverage
1 RBAC rbac.py admin/analyst/viewer roles, API key mapping, permission matrix
2 Immutable audit trail api/audit_log.py HMAC-signed entries, SQLite backend, tamper detection
3 Exception/waiver management api/exception_store.py PENDING→APPROVED→ACTIVE→EXPIRED lifecycle
4 Baseline comparison baseline.py New/resolved/persistent vulns, severity change detection
5 Trend analysis baseline.py Historical posture score + vuln count tracking
6 SIEM connectors siem/__init__.py Splunk HEC, Datadog Logs, Elasticsearch/OpenSearch
7 Alert dedup/suppression alerts/dedup.py SHA-256 fingerprinting, configurable suppression window
8 API endpoints api/server.py 12 new endpoints across audit, exceptions, baseline, trends, SIEM

New API Endpoints

  • GET /v1/audit — list audit entries (filterable by action, resource, timestamp)
  • GET /v1/audit/integrity — verify HMAC integrity of audit log
  • POST /v1/exceptions — request a vulnerability exception
  • GET /v1/exceptions — list all exceptions
  • GET /v1/exceptions/{id} — get specific exception
  • PUT /v1/exceptions/{id}/approve — approve pending exception
  • PUT /v1/exceptions/{id}/revoke — revoke active exception
  • DELETE /v1/exceptions/{id} — delete exception
  • POST /v1/baseline/compare — compare two scans for new/resolved vulns
  • GET /v1/trends — historical posture and vulnerability trends
  • GET /v1/siem/connectors — list available SIEM types
  • POST /v1/siem/test — test SIEM connectivity

Test plan

  • 57 new tests in test_enterprise_gaps.py
  • Full test suite: 2,097 tests pass
  • ruff check + ruff-format clean

…ine, SIEM, dedup

Address 10 critical enterprise gaps identified in security team evaluation:

1. RBAC (rbac.py) — admin/analyst/viewer roles with permission matrix,
   API key mapping, header-based resolution
2. Immutable audit trail (audit_log.py) — HMAC-signed append-only log,
   InMemory + SQLite backends, tamper detection
3. Exception/waiver management (exception_store.py) — CVE/package
   exceptions with PENDING→APPROVED→ACTIVE→EXPIRED lifecycle
4. Baseline comparison (baseline.py) — scan-to-scan diff showing new,
   resolved, persistent vulns and severity changes
5. Trend analysis (baseline.py) — historical posture score + vuln count
   tracking with InMemory + SQLite stores
6. SIEM connectors (siem/) — Splunk HEC, Datadog Logs, Elasticsearch
   with send_event, send_batch, health_check
7. Alert dedup (alerts/dedup.py) — content fingerprinting with
   configurable suppression window (default 24h)
8. API endpoints — /v1/audit, /v1/exceptions, /v1/baseline/compare,
   /v1/trends, /v1/siem/connectors, /v1/siem/test

57 new tests covering all features.
@msaad00 msaad00 requested a review from andres-linero as a code owner March 2, 2026 04:42
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

andres-linero
andres-linero previously approved these changes Mar 2, 2026
…store

Both SQL queries use parameterized values (?) with static column names —
Bandit flags the f-string WHERE clause construction but all user input
flows through parameter binding, not string interpolation.
msaad00 and others added 6 commits March 2, 2026 00:12
…w trust feedback

- Restructured to Agent Skills specification format (frontmatter + concise body)
- Added top-level metadata fields (homepage, source, pypi, scorecard) to fix
  OpenClaw "source: unknown, homepage: none" metadata mismatch
- Moved local-first installation to primary recommendation (before remote SSE)
- De-emphasized Railway endpoint to optional convenience section
- Added local MCP server config and self-host Docker instructions
- Kept OpenClaw metadata in metadata.openclaw for backward compatibility
- Condensed security boundaries and verification sections
The deployed Railway SSE server returned 404 on /, /health, and exposed
no discoverable metadata — causing OpenClaw to flag "source: unknown,
homepage: none". Now:

- GET / returns JSON with name, version, homepage, source, license, pypi
- GET /health returns status, name, version for monitoring
- Trust evaluators that probe HTTP paths (not just MCP initialize) can
  now discover server identity without establishing an SSE session
… format

Tests expected old-format phrases ("Remote MCP server", "does not read your
local files"). Updated to match restructured SKILL.md which uses "remote MCP
endpoint" and "Never send" security boundaries section.
…hrough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Replace raw str(exc) with sanitize_error() in HTTPException detail fields
to prevent stack trace information exposure to external users.
…string

Copilot autofix (cdb8c50) changed sanitize_error to always return a
constant generic message, breaking tests and removing useful error context
for validation errors. Restore original behavior: strip paths/URLs but
return the sanitized message so clients get actionable feedback.
andres-linero
andres-linero previously approved these changes Mar 2, 2026
…hrough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@andres-linero andres-linero merged commit fa18951 into main Mar 2, 2026
14 checks passed
@andres-linero andres-linero deleted the feat/enterprise-gaps branch March 2, 2026 15:43
@msaad00 msaad00 mentioned this pull request Mar 2, 2026
3 tasks
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.

2 participants