pub struct TimestampPolicy { /* private fields */ }Expand description
Timestamp validation policy
Validates timestamps in provenance data to prevent:
- Time-based attacks (using old vulnerable versions)
- Timestamp manipulation to hide malicious activity
- Future-dated timestamps (clock skew attacks)
Implementations§
Source§impl TimestampPolicy
impl TimestampPolicy
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new timestamp policy with default settings
- No maximum age limit
- 5 minutes future tolerance (for clock skew)
- Timestamps required
Sourcepub fn with_max_age_seconds(self, seconds: i64) -> Self
pub fn with_max_age_seconds(self, seconds: i64) -> Self
Set maximum age for timestamps Compositions/builds older than this are rejected
Sourcepub fn with_max_age_days(self, days: i64) -> Self
pub fn with_max_age_days(self, days: i64) -> Self
Set maximum age in days
Sourcepub fn with_future_tolerance_seconds(self, seconds: i64) -> Self
pub fn with_future_tolerance_seconds(self, seconds: i64) -> Self
Set future tolerance for clock skew
Sourcepub fn require_timestamps(self, require: bool) -> Self
pub fn require_timestamps(self, require: bool) -> Self
Set whether timestamps are required
Trait Implementations§
Source§impl Clone for TimestampPolicy
impl Clone for TimestampPolicy
Source§fn clone(&self) -> TimestampPolicy
fn clone(&self) -> TimestampPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimestampPolicy
impl Debug for TimestampPolicy
Auto Trait Implementations§
impl Freeze for TimestampPolicy
impl RefUnwindSafe for TimestampPolicy
impl Send for TimestampPolicy
impl Sync for TimestampPolicy
impl Unpin for TimestampPolicy
impl UnwindSafe for TimestampPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more