pub struct AuditedAvc<A: Avc, S: AuditSink> { /* private fields */ }Expand description
An Avc that routes every decision through an AuditSink. This is the
S7 complete-mediation hook: because the PEP (S2) calls the AVC per op,
wrapping it here audits every decision with no bypass.
Fail-closed: if the audit write fails on what would otherwise be a
Permit, the wrapper downgrades to Deny (reason AuditFailClosed) and
attempts to record that deny (best-effort: if the sink is broken, the
enforced deny is still emitted as a tracing event so it is observable).
A decision that cannot be audited is never allowed through.
Implementations§
Source§impl<A: Avc, S: AuditSink> AuditedAvc<A, S>
impl<A: Avc, S: AuditSink> AuditedAvc<A, S>
Source§impl<A: Avc, S: AuditSink> AuditedAvc<A, S>
impl<A: Avc, S: AuditSink> AuditedAvc<A, S>
Sourcepub fn decide_delegated(
&self,
subject: SubjectCtx,
on_behalf_of: Option<SubjectCtx>,
object: ObjectCtx,
action: Action,
) -> Decision
pub fn decide_delegated( &self, subject: SubjectCtx, on_behalf_of: Option<SubjectCtx>, object: ObjectCtx, action: Action, ) -> Decision
Delegated (#680/#681) counterpart of Avc::decide: subject is the
effective, met context the PDP decides on (already meet(delegator, actor) from hyprstream_rpc::auth::mac::SecurityContext::delegated);
on_behalf_of is the delegator principal, recorded on the audit record
but never re-evaluated (the decision rests on the met subject
alone — the delegator cannot re-widen it).
The plain Avc::decide is the single-principal case (on_behalf_of = None); this is the two-principal case the (future) reference monitor
calls when a request arrived over a delegation. Kept off the Avc trait
so the hot-path cache key stays (subject, object, action) — delegation
is an audit-attribution concern, not a decision input.
Sourcepub fn decide_delegated_with_token(
&self,
subject: SubjectCtx,
on_behalf_of: Option<SubjectCtx>,
object: ObjectCtx,
action: Action,
token: &TokenScope,
) -> Decision
pub fn decide_delegated_with_token( &self, subject: SubjectCtx, on_behalf_of: Option<SubjectCtx>, object: ObjectCtx, action: Action, token: &TokenScope, ) -> Decision
Delegated counterpart of Avc::decide_with_token; see
Self::decide_delegated for the two-principal semantics.
Trait Implementations§
Source§impl<A: Avc, S: AuditSink> Avc for AuditedAvc<A, S>
impl<A: Avc, S: AuditSink> Avc for AuditedAvc<A, S>
Source§fn decide(
&self,
subject: SubjectCtx,
object: ObjectCtx,
action: Action,
) -> Decision
fn decide( &self, subject: SubjectCtx, object: ObjectCtx, action: Action, ) -> Decision
Source§fn decide_with_token(
&self,
subject: SubjectCtx,
object: ObjectCtx,
action: Action,
token: &TokenScope,
) -> Decision
fn decide_with_token( &self, subject: SubjectCtx, object: ObjectCtx, action: Action, token: &TokenScope, ) -> Decision
Permit only if the PDP permits AND the token authorizes the action.
The label-ceiling comparison requires the lattice and is done by the PDP-side floor;
this method applies the op-set + ttl gate. Default-deny.Auto Trait Implementations§
impl<A, S> Freeze for AuditedAvc<A, S>
impl<A, S> RefUnwindSafe for AuditedAvc<A, S>where
A: RefUnwindSafe,
S: RefUnwindSafe,
impl<A, S> Send for AuditedAvc<A, S>
impl<A, S> Sync for AuditedAvc<A, S>
impl<A, S> Unpin for AuditedAvc<A, S>
impl<A, S> UnsafeUnpin for AuditedAvc<A, S>where
A: UnsafeUnpin,
S: UnsafeUnpin,
impl<A, S> UnwindSafe for AuditedAvc<A, S>where
A: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request