pub struct PrivilegedAccessManager { /* private fields */ }Expand description
Privileged access manager
Manages privileged access requests, monitoring, and enforcement
Implementations§
Source§impl PrivilegedAccessManager
impl PrivilegedAccessManager
Sourcepub fn new(
config: PrivilegedAccessConfig,
mfa_storage: Option<Arc<dyn MfaStorage>>,
justification_storage: Option<Arc<dyn JustificationStorage>>,
) -> Self
pub fn new( config: PrivilegedAccessConfig, mfa_storage: Option<Arc<dyn MfaStorage>>, justification_storage: Option<Arc<dyn JustificationStorage>>, ) -> Self
Create a new privileged access manager
Sourcepub async fn request_privileged_access(
&self,
user_id: Uuid,
requested_role: PrivilegedRole,
justification: String,
business_need: Option<String>,
manager_approval: Option<Uuid>,
) -> Result<PrivilegedAccessRequest, Error>
pub async fn request_privileged_access( &self, user_id: Uuid, requested_role: PrivilegedRole, justification: String, business_need: Option<String>, manager_approval: Option<Uuid>, ) -> Result<PrivilegedAccessRequest, Error>
Request privileged access
Sourcepub async fn approve_manager(
&self,
request_id: Uuid,
approver_id: Uuid,
) -> Result<(), Error>
pub async fn approve_manager( &self, request_id: Uuid, approver_id: Uuid, ) -> Result<(), Error>
Approve privileged access request (manager approval)
Sourcepub async fn approve_security(
&self,
request_id: Uuid,
approver_id: Uuid,
expiration_days: u64,
) -> Result<(), Error>
pub async fn approve_security( &self, request_id: Uuid, approver_id: Uuid, expiration_days: u64, ) -> Result<(), Error>
Approve privileged access request (security approval)
Sourcepub async fn deny_request(
&self,
request_id: Uuid,
reason: String,
) -> Result<(), Error>
pub async fn deny_request( &self, request_id: Uuid, reason: String, ) -> Result<(), Error>
Deny privileged access request
Sourcepub async fn check_mfa_compliance(&self, user_id: Uuid) -> Result<bool, Error>
pub async fn check_mfa_compliance(&self, user_id: Uuid) -> Result<bool, Error>
Check MFA compliance for a user
Sourcepub async fn record_action(
&self,
user_id: Uuid,
action_type: PrivilegedActionType,
resource: Option<String>,
details: Option<String>,
ip_address: Option<String>,
user_agent: Option<String>,
session_id: Option<String>,
) -> Result<Uuid, Error>
pub async fn record_action( &self, user_id: Uuid, action_type: PrivilegedActionType, resource: Option<String>, details: Option<String>, ip_address: Option<String>, user_agent: Option<String>, session_id: Option<String>, ) -> Result<Uuid, Error>
Record a privileged action
Sourcepub async fn start_session(
&self,
session_id: String,
user_id: Uuid,
role: PrivilegedRole,
ip_address: Option<String>,
user_agent: Option<String>,
) -> Result<(), Error>
pub async fn start_session( &self, session_id: String, user_id: Uuid, role: PrivilegedRole, ip_address: Option<String>, user_agent: Option<String>, ) -> Result<(), Error>
Start a privileged session
Sourcepub async fn update_session_activity(
&self,
session_id: &str,
) -> Result<(), Error>
pub async fn update_session_activity( &self, session_id: &str, ) -> Result<(), Error>
Update session activity
Sourcepub async fn end_session(&self, session_id: &str) -> Result<(), Error>
pub async fn end_session(&self, session_id: &str) -> Result<(), Error>
End a privileged session
Sourcepub async fn cleanup_expired_sessions(&self) -> Result<Vec<String>, Error>
pub async fn cleanup_expired_sessions(&self) -> Result<Vec<String>, Error>
Check for expired sessions and clean them up
Sourcepub async fn get_user_actions(
&self,
user_id: Uuid,
) -> Result<Vec<PrivilegedAction>, Error>
pub async fn get_user_actions( &self, user_id: Uuid, ) -> Result<Vec<PrivilegedAction>, Error>
Get all privileged actions for a user
Sourcepub async fn get_active_sessions(&self) -> Result<Vec<PrivilegedSession>, Error>
pub async fn get_active_sessions(&self) -> Result<Vec<PrivilegedSession>, Error>
Get all active privileged sessions
Sourcepub async fn get_request(
&self,
request_id: Uuid,
) -> Result<Option<PrivilegedAccessRequest>, Error>
pub async fn get_request( &self, request_id: Uuid, ) -> Result<Option<PrivilegedAccessRequest>, Error>
Get access request by ID
Sourcepub async fn get_user_requests(
&self,
user_id: Uuid,
) -> Result<Vec<PrivilegedAccessRequest>, Error>
pub async fn get_user_requests( &self, user_id: Uuid, ) -> Result<Vec<PrivilegedAccessRequest>, Error>
Get all requests for a user
Auto Trait Implementations§
impl Freeze for PrivilegedAccessManager
impl !RefUnwindSafe for PrivilegedAccessManager
impl Send for PrivilegedAccessManager
impl Sync for PrivilegedAccessManager
impl Unpin for PrivilegedAccessManager
impl !UnwindSafe for PrivilegedAccessManager
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 more