Skip to content
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

[Rule Tuning] User Added to Privileged Group #3373

Closed
s-bt opened this issue Jan 7, 2024 · 5 comments
Closed

[Rule Tuning] User Added to Privileged Group #3373

s-bt opened this issue Jan 7, 2024 · 5 comments
Assignees
Labels
backlog community OS: Windows windows related rules Rule: Tuning tweaking or tuning an existing rule

Comments

@s-bt
Copy link

s-bt commented Jan 7, 2024

Link to rule

https://github.com/elastic/detection-rules/blob/main/rules/windows/persistence_user_account_added_to_privileged_group_ad.toml

Description

I've just started testing Elastic Security, and during my first test I have found that the rule User Added to Privileged Group is using names instead of SIDs/RIDs. This is probelmatic for example in non-english environments. I would suggest switching to well known RIDs

Example Data

THIS RULE WILL ALSO INCLUDE CHANGES TO LOCAL GROUPS ON NON-DOMAIN CONTROLLER MACHINES, SO IDEALLY IT WILL TO BE FURTHER FILTERED TO RUN ONLY ON DOMAIN CONTROLLERS (IF THAT'S POSSIBLE). OTHERWISE, CREATE A NEW RULE THAT JUST CONTAINS THE DOMAIN SIDs

EQL

iam where winlog.api:"wineventlog" and event.action == "added-member-to-group" and
  group.name : ("Admin*",
                "Local Administrators",
                "Domain Admins",
                "Enterprise Admins",
                "Backup Admins",
                "Schema Admins",
                "DnsAdmins",
                "Exchange Organization Administrators")
 or group.id : (
		// BUILTIN_ADMINISTRATORS
		"S-1-5-32-544",
		// ACCOUNT_OPERATORS
		"S-1-5-32-548",
		// SERVER_OPERATORS
		"S-1-5-32-549",
		// PRINTER_OPERATORS
		"S-1-5-32-550",
		// BACKUP_OPERATORS
		"S-1-5-32-551",
		// REMOTE_DESKTOP
		"S-1-5-32-555",
		// Domain Admins
		"S-1-5-21-*-512",
		// Domain Controllers
		"S-1-5-21-*-516",
		// Cert Publishers
		"S-1-5-21-*-517",
		// Schema Admins
		"S-1-5-21-*-518",
		// Enterprise Admins
		"S-1-5-21-*-519",
		// Key Admins
		"S-1-5-21-*-526",
		// Key Admins
		"S-1-5-21-*-527"
)
@s-bt s-bt added the Rule: Tuning tweaking or tuning an existing rule label Jan 7, 2024
@w0rk3r w0rk3r self-assigned this Jan 7, 2024
@w0rk3r w0rk3r added the OS: Windows windows related rules label Jan 7, 2024
@w0rk3r
Copy link
Contributor

w0rk3r commented Jan 12, 2024

Hey @s-bt, thanks for the contribution! Do you want to create a PR for this one? I can do it if you want

@s-bt
Copy link
Author

s-bt commented Jan 12, 2024

I wouldn't mind if you did :)

@s-bt
Copy link
Author

s-bt commented Jan 22, 2024

Made a mistake in the rule :(. It should be:

iam where winlog.api:"wineventlog" and event.action == "added-member-to-group" and
(group.name : ("Admin*",
"Local Administrators",
"Domain Admins",
"Enterprise Admins",
"Backup Admins",
"Schema Admins",
"DnsAdmins",
"Exchange Domain Servers",
"Exchange Enterprise Servers",
"Exchange Organization Administrators")
or group.id : (
// BUILTIN_ADMINISTRATORS
"S-1-5-32-544",
// ACCOUNT_OPERATORS
"S-1-5-32-548",
// SERVER_OPERATORS
"S-1-5-32-549",
// PRINTER_OPERATORS
"S-1-5-32-550",
// BACKUP_OPERATORS
"S-1-5-32-551",
// REMOTE_DESKTOP
"S-1-5-32-555",
// Domain Admins
"S-1-5-21--512",
// Domain Controllers
"S-1-5-21-
-516",
// Cert Publishers
"S-1-5-21--517",
// Schema Admins
"S-1-5-21-
-518",
// Enterprise Admins
"S-1-5-21--519",
// Key Admins
"S-1-5-21-
-526",
// Key Admins
"S-1-5-21-*-527"
))

@botelastic
Copy link

botelastic bot commented Mar 22, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the stale 60 days of inactivity label Mar 22, 2024
@w0rk3r w0rk3r added the backlog label Mar 22, 2024
@botelastic botelastic bot removed the stale 60 days of inactivity label Mar 22, 2024
@w0rk3r
Copy link
Contributor

w0rk3r commented Jun 20, 2024

Resolved by #3763, thanks for bringing this to our attention

@w0rk3r w0rk3r closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog community OS: Windows windows related rules Rule: Tuning tweaking or tuning an existing rule
Projects
None yet
Development

No branches or pull requests

3 participants