Skip to content

Conversation

@w0rk3r
Copy link
Contributor

@w0rk3r w0rk3r commented Mar 17, 2025

Proposed commit message

entityanalytics_ad: fix UAC attribute bit table Previous implementation used the MS-SAMR, but the active directory objects use the adschema[1][2][3]. [1]https://learn.microsoft.com/en-us/windows/win32/adschema/a-useraccountcontrol [2]https://learn.microsoft.com/en-us/windows/win32/api/iads/ne-iads-ads_user_flag_enum [3]https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties 

Summary

Fix the bit table to be compatible with the AD Schema (https://learn.microsoft.com/en-us/windows/win32/adschema/a-useraccountcontrol) instead of MS-SAMR, as it is the implementation used in active directory objects.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

elastic-package test pipeline -v

Related issues

Part of https://github.com/elastic/ia-trade-team/issues/537

@w0rk3r w0rk3r added bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Integration:entityanalytics_ad Active Directory Entity Analytics labels Mar 17, 2025
@w0rk3r w0rk3r self-assigned this Mar 17, 2025
@w0rk3r w0rk3r requested a review from a team as a code owner March 17, 2025 16:52
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@efd6
Copy link
Contributor

efd6 commented Mar 17, 2025

Can you provide a screenshot showing the correspondence between the values and the string representation for the cases that have changed so that we can see that the change is correct, or alternatively/additionally, a link that states that this is the table that should be used?

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
@w0rk3r w0rk3r requested a review from efd6 March 17, 2025 21:42
@efd6
Copy link
Contributor

efd6 commented Mar 17, 2025

Suggest this for commit message (pending additional information)

entityanalytics_ad: fix UAC attribute bit table Previous implementation used the MS-SAMR, but the active directory objects use the adschema[1][2][3]. [1]https://learn.microsoft.com/en-us/windows/win32/adschema/a-useraccountcontrol [2]https://learn.microsoft.com/en-us/windows/win32/api/iads/ne-iads-ads_user_flag_enum [3]https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties 
@w0rk3r
Copy link
Contributor Author

w0rk3r commented Mar 17, 2025

@efd6 we can use the krbtgt useraccountcontrol value (514) as an example to check this. It should be "ACCOUNTDISABLE" & "NORMAL_ACCOUNT"

It is the same example from the documentation: https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties

The flags are cumulative. To disable a user's account, set the UserAccountControl attribute to 0x0202 (0x002 + 0x0200). In decimal, it's 514 (2 + 512).

And if we check the table:

ACCOUNTDISABLE 0x0002 2
NORMAL_ACCOUNT 0x0200 512
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @w0rk3r

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I added the link for PARTIAL_SECRET_ACCOUNT to the proposed commit message as well.

@efd6 efd6 merged commit a38fc74 into main Mar 17, 2025
7 checks passed
@efd6 efd6 deleted the rt_uac_list branch March 17, 2025 22:30
@elastic-vault-github-plugin-prod

Package entityanalytics_ad - 0.10.1 containing this change is available at https://epr.elastic.co/package/entityanalytics_ad/0.10.1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:entityanalytics_ad Active Directory Entity Analytics Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants