feat(security): add artifact trust, capability sandbox, and audit log#46
feat(security): add artifact trust, capability sandbox, and audit log#46EffortlessSteven wants to merge 2 commits intomainfrom
Conversation
- ArtifactVerifier with checksum and manifest structure validation - CapabilitySet bitflag enforcement for plugin sandboxing - AuditLog with severity-based filtering and bounded ring buffer - TrustPolicy for configurable security requirements - AuditFilter for composite query support on audit entries - 30+ new tests covering verification, sandboxing, and audit trail Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review Summary by QodoAdd artifact trust, capability sandbox, and audit filtering
WalkthroughsDescription• Add ArtifactVerifier with SHA-256 checksum and manifest validation • Implement CapabilitySet bitflag-based plugin sandboxing enforcement • Extend AuditLog with AuditFilter for composite query support • Export new security modules and types in public API Diagramflowchart LR
AV["ArtifactVerifier<br/>Checksum & Manifest"]
TP["TrustPolicy<br/>Signature/Channel Control"]
CS["CapabilitySet<br/>Bitflag Enforcement"]
SP["SandboxPolicy<br/>Plugin Restrictions"]
AF["AuditFilter<br/>Composite Queries"]
AL["AuditLog<br/>Ring Buffer"]
AV --> TP
CS --> SP
AF --> AL
TP -.-> "Security Module"
SP -.-> "Security Module"
AL -.-> "Security Module"
File Changes1. crates/flight-security/src/artifact_trust.rs
|
Code Review by Qodo
1. Unknown capability bits allowed
|
| /// Create a set from a raw bitmask. | ||
| pub fn from_bits(bits: u32) -> Self { | ||
| Self(bits) | ||
| } |
There was a problem hiding this comment.
1. Unknown capability bits allowed 🐞 Bug ⛨ Security
CapabilitySet::from_bits accepts arbitrary u32 values, but iter()/enforce() only enumerate known Capability::ALL values, so unknown bits can be silently carried and omitted from denial messages. This can reduce auditability today and can become a forward-compat privilege escalation risk if new capability bits are added later (old manifests may already have those bits set).
Agent Prompt
### Issue description
`CapabilitySet::from_bits()` currently accepts any `u32` and stores it without validation. However, iteration (`iter()`) and denial reporting (`enforce()`) only enumerate capabilities listed in `Capability::ALL`, so unknown bits can be silently ignored in logs/messages.
### Issue Context
This is a security boundary. Unknown/unsupported bits should not be silently accepted because they can (a) hide what was actually denied, and (b) become granted later if new capability bits are introduced and old stored bitmasks already contain those bits.
### Fix Focus Areas
- crates/flight-security/src/capability_sandbox.rs[33-41]
- crates/flight-security/src/capability_sandbox.rs[76-79]
- crates/flight-security/src/capability_sandbox.rs[116-122]
- crates/flight-security/src/capability_sandbox.rs[210-223]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
…alation - Add KNOWN_BITS mask to CapabilitySet - from_bits() now strips unknown bits - Add from_bits_strict() that rejects unknown bits - Add tests for unknown bit handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Summary
Implements the security trust framework for OpenFlight's plugin and update verification pipeline.
Changes
Tests
30+ new tests covering:
All 99 unit tests + 12 integration tests pass. Zero clippy warnings.