← All projects

Dynamic Security Posture Automation

Security automation

Automated active-device tagging and tag removal to give the SOC a current view of endpoint exposure in Microsoft Defender.

Accepted for production

Outcome

Vulnerability reviews focus on active endpoints, with stale device records excluded from the tagged assessment view.

Azure Logic AppsKusto Query Language (KQL)Microsoft Defender for Endpoint APIMicrosoft Entra ID

The task

Microsoft Defender inventories contain both active endpoints and stale or decommissioned device records. A combined view makes it harder to focus vulnerability reviews on assets currently in use.

My contribution

Designed and deployed a serverless Azure Logic Apps workflow, developed activity queries and implemented the tag lifecycle through the Defender for Endpoint API with Microsoft Entra ID integration.

Implementation

  • Developed KQL queries that identify endpoint heartbeats within rolling activity windows and select active, onboarded devices.
  • Configured Azure Logic Apps to run the workflow on a schedule and process the devices returned by the activity queries.
  • Used the Defender for Endpoint API to apply custom metadata tags to active endpoints and remove tags from endpoints that no longer meet the activity criteria.
  • Created tag-based Defender device groups and exposure views for operational vulnerability reviews.
  • Tested tagging and untagging behaviour and documented implementation, testing and rollback considerations.

Result

The automation improves vulnerability dashboard accuracy by maintaining an active-device scope, reducing stale-record noise and helping the SOC focus on active security risks.

Project scope

Device tagging changes which endpoints appear in an assessment view. Exposure values for different device groups are not a before-and-after measurement of vulnerability remediation.

Discuss this project