Skip to content

[New Rule] Azure Conditional Access Policy Modified#237

Merged
threat-punter merged 15 commits intoelastic:mainfrom
threat-punter:new-rule-azure-conditional-access-policy-modified
Sep 22, 2020
Merged

[New Rule] Azure Conditional Access Policy Modified#237
threat-punter merged 15 commits intoelastic:mainfrom
threat-punter:new-rule-azure-conditional-access-policy-modified

Conversation

@threat-punter
Copy link
Copy Markdown
Contributor

Issues

Resolves #143

Summary

Identifies when an Azure Conditional Access policy is modified. Azure Conditional Access policies control access to resources via if-then statements. For example, if a user wants to access a resource, then they must complete an action such as using multi-factor authentication to access it. An adversary may modify a Conditional Access policy in order to weaken their target's security controls.

Contributor checklist

Copy link
Copy Markdown
Contributor

@bm11100 bm11100 left a comment

Choose a reason for hiding this comment

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

Could we add a technique like Account Manipulation to this? event.outcome didn't appear to populate when I looked at the results during our test, not sure if that is everytime though. What about adding azure.activitylogs.properties.result:success?

update - event outcome doesn't populate with all activitylogs

…dified.toml


Update maturity to production

Co-authored-by: Justin Ibarra <brokensound77@users.noreply.github.com>
@threat-punter
Copy link
Copy Markdown
Contributor Author

Could we add a technique like Account Manipulation to this? event.outcome didn't appear to populate when I looked at the results during our test, not sure if that is everytime though. What about adding azure.activitylogs.properties.result:success?

update - event outcome doesn't populate with all activitylogs

I added the ATT&CK metadata to the rule. Let me check on the ECS mapping before I include that non-ECS field in the rule. Thanks

@threat-punter
Copy link
Copy Markdown
Contributor Author

See Beats issue elastic/beats#20990 re an update that's required for us to use event.outcome in this rule.

Confirmed that the updated query matches the expected events, but the tests are failing when I add and azure.activitylogs.properties.result:success to the query. 🤔

event.module:azure and event.dataset:azure.activitylogs and event.category:Administrative and azure.activitylogs.operation_name:"Update policy" and azure.activitylogs.properties.result:success

image

@threat-punter
Copy link
Copy Markdown
Contributor Author

This rule can be merged when elastic/beats#20990 is resolved.

@threat-punter
Copy link
Copy Markdown
Contributor Author

PR elastic/beats#20998 has been merged to ensure that field azure.activitylogs.properties.result is renamed to event.outcome. This PR can be merged. When a Filebeat 7.10 BC is available, I'll make this it's working as expected.

@bm11100
Copy link
Copy Markdown
Contributor

bm11100 commented Sep 22, 2020

We should update this to account for the AuditLogs as well

event.module:azure and (event.dataset:azure.activitylogs or event.dataset:azure.auditlogs) and (azure.activitylogs.operation_name:"Update policy" or azure.auditlogs.operation_name:"Update policy")

Amending the query in rule, "Possible Consent Grant Attack via Azure-Registered Application" to search both the Azure activity and audit logs
@threat-punter
Copy link
Copy Markdown
Contributor Author

I took the liberty of tweaking rule, Possible Consent Grant Attack via Azure-Registered Application in this PR too. This rule was just merged. I amended the query so that it searches both the Azure audit logs and activity logs, as this event appears in both of those logs.

I'll request a review of this PR again, but I did confirm that both queries in this PR match the intended events.

Copy link
Copy Markdown
Contributor

@bm11100 bm11100 left a comment

Choose a reason for hiding this comment

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

lgtm, with the changes going into 7.10 the activity logs will eval true as well

Copy link
Copy Markdown
Contributor

@bm11100 bm11100 left a comment

Choose a reason for hiding this comment

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

🔥

@threat-punter threat-punter merged commit cedb2e1 into elastic:main Sep 22, 2020
@threat-punter threat-punter deleted the new-rule-azure-conditional-access-policy-modified branch September 22, 2020 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Rule] Azure Conditional Access Policy Modified

5 participants