-
Notifications
You must be signed in to change notification settings - Fork 19
feat(pedm): account tracking #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This commit adds tracking of user accounts and domain accounts. Changes to accounts on the system such as name change, creation, removal, and even SID change are captured. Accounts now use an internally generated stable ID. This stable ID can be used to build policies in a robust manner. The functionality has been tested with real account creation, deletion, and removal on Windows for both DB backends. This commit also includes query helpers for parametrization and bulk insertion. A basic endpoint, `/accounts`, is added for displaying info about existing accounts in a fashion similar to `Get-LocalUser`.
Let maintainers know that an action is required on their side
|
The function works as expected. The expected side of the test was wrong.
/// | ||
/// `LookupAccountNameW` must be called to enable `ConvertSidToStringSidW` to work. | ||
#[cfg(target_os = "windows")] | ||
#[allow(clippy::multiple_unsafe_ops_per_block)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Do not allow this. Put a SAFETY
comment for each unsafe operation.
/// `LookupAccountNameW` must be called to enable `ConvertSidToStringSidW` to work. | ||
#[cfg(target_os = "windows")] | ||
#[allow(clippy::multiple_unsafe_ops_per_block)] | ||
#[allow(clippy::cast_possible_truncation)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Justify why this lint is disabled.
#[cfg(target_os = "windows")] | ||
#[allow(clippy::multiple_unsafe_ops_per_block)] | ||
#[allow(clippy::cast_possible_truncation)] | ||
pub(crate) unsafe fn list_accounts() -> Result<Vec<Account>, ListAccountsError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why this function is marked as unsafe? What are the safety preconditions to uphold in order to call it? It seems to me that it is wrapping unsafe operations in a way that can be proven safe locally (unless there are other "ambient" preconditions?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: This sounds similar, but slightly different from the primitives provided by the identity
module of win-api-wrappers
. Can you elaborate why you had to implement a different abstraction?
This commit adds tracking of user accounts and domain accounts. Changes to accounts on the system such as name change, creation, removal, and even SID change are captured.
Accounts now use an internally generated stable ID. This stable ID can be used to build policies in a robust manner.
The functionality has been tested with real account creation, deletion, and removal on Windows for both DB backends.
This commit also includes query helpers for parametrization and bulk insertion.
A basic endpoint,
/accounts
, is added for displaying info about existing accounts in a fashion similar toGet-LocalUser
.