analyzing-azure-activity-logs-for-threats — Claude Code skill
Runs KQL queries against Azure Monitor activity and sign-in logs to surface suspicious admin operations and sign-in anomalies.
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a claude-codeWhat analyzing-azure-activity-logs-for-threats does
The skill wires your agent to Azure logs through the azure-monitor-query library. It ships KQL queries aimed at a Log Analytics workspace: role assignment changes, resource group and subscription edits, Key Vault secret access from new IPs, network security group rule changes, conditional access policy edits. One example hunts for new Global Administrator assignments in AuditLogs.
You need access to the workspace and permission to read its logs. Auth goes through DefaultAzureCredential, so credentials have to be reachable from the environment — without them the query never leaves. Python 3.8+ and the dependencies are required, and it makes sense to point the queries at a test tenant first: they only read, but a sloppy filter gives you a wrong picture.
Use it when you are working an Azure incident or writing detections for a cloud SIEM. It hands you a result set, not a verdict.
What it helps with
- find new Global Administrator role assignments in a tenant
- build a KQL query against AzureActivity for the last day
- spot Key Vault secret access from unfamiliar IPs
- track changes to network security group rules
- map detections to MITRE ATT&CK cloud techniques
Example prompts for the agent
- write a KQL query against AzureActivity to show role assignment changes in the last 24 hours
- check sign-in logs for impossible travel between countries
- build a detection for conditional access policy changes
How to install analyzing-azure-activity-logs-for-threats
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a claude-code2Manually: put the files in place
~/.claude/skills/analyzing-azure-activity-logs-for-threats/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/analyzing-azure-activity-logs-for-threats/
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a codex2Manually: put the files in place
.agents/skills/analyzing-azure-activity-logs-for-threats/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a cursor2Manually: put the files in place
.cursor/skills/analyzing-azure-activity-logs-for-threats/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install mukul975/Anthropic-Cybersecurity-Skills analyzing-azure-activity-logs-for-threats2Manually: put the files in place
.github/skills/analyzing-azure-activity-logs-for-threats/SKILL.md1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a gemini-cli2Platform CLI
gemini skills install https://github.com/mukul975/Anthropic-Cybersecurity-Skills --path skills/analyzing-azure-activity-logs-for-threatsManually: put the files in place
.devin/skills/analyzing-azure-activity-logs-for-threats/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about analyzing-azure-activity-logs-for-threats
How do I install analyzing-azure-activity-logs-for-threats in Claude?
Run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a claude-code. The skill file then sits at ~/.claude/skills/analyzing-azure-activity-logs-for-threats/SKILL.md.
What does analyzing-azure-activity-logs-for-threats do?
It builds and runs KQL queries against Azure Monitor activity logs and sign-in logs to detect suspicious administrative operations, privilege escalation and resource modifications.
What do I need before running it?
Python 3.8+ with the dependencies installed and access to a Log Analytics workspace. Authentication uses DefaultAzureCredential, so your Azure credentials must be available from the environment.
Source text
SKILL.md · Apache-2.0
---
name: analyzing-azure-activity-logs-for-threats
description: 'Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query
to detect suspicious administrative operations, impossible travel, privilege escalation,
and resource modifications. Builds KQL queries for threat hunting in Azure environments.
Use when investigating suspicious Azure tenant activity or building cloud SIEM detections.
'
domain: cybersecurity
subdomain: security-operations
tags:
- azure
- cloud-security
- azure-monitor
- kql
- threat-hunting
- activity-logs
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- DE.CM-01
- RS.MA-01
- GV.OV-01
- DE.AE-02
mitre_attack:
- T1078.004
- T1098.003
- T1538
- T1556.009
- T1580
---
# Analyzing Azure Activity Logs for Threats
## When to Use
- When investigating security incidents that require analyzing azure activity logs for threats
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
## Prerequisites
- Familiarity with security operations concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
## Instructions
Use azure-monitor-query to execute KQL queries against Azure Log Analytics workspaces,
detecting suspicious admin operations and sign-in anomalies.
```python
from azure.identity import DefaultAzureCredential
from azure.monitor.query import LogsQueryClient
from datetime import timedelta
credential = DefaultAzureCredential()
client = LogsQueryClient(credential)
response = client.query_workspace(
workspace_id="WORKSPACE_ID",
query="AzureActivity | where OperationNameValue has 'MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITE' | take 10",
timespan=timedelta(hours=24),
)
```
Key detection queries:
1. Role assignment changes (privilege escalation)
2. Resource group and subscription modifications
3. Key vault secret access from new IPs
4. Network security group rule changes
5. Conditional access policy modifications
## Examples
```python
# Detect new Global Admin role assignments
query = '''
AuditLogs
| where OperationName == "Add member to role"
| where TargetResources[0].modifiedProperties[0].newValue has "Global Administrator"
'''
```
© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills