Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-azure-activity-logs-for-threats -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/analyzing-azure-activity-logs-for-threats/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/analyzing-azure-activity-logs-for-threats/

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

Similar skills

Everything for Security →

From the same set89

exploiting-sql-injection-vulnerabilities Guides SQL injection testing across web applications during authorized security assessments. It helps audit database input handling and verify protection mechanisms. CX Codex +1 504installs analyzing-bootkit-and-rootkit-samples Analyzes bootkits and rootkits in MBR, VBR, and UEFI firmware. Use it when compromise signs remain after an OS reinstall. CX Codex +1 486installs reverse-engineering-android-malware-with-jadx A skill that walks the agent through a malicious Android APK: JADX decompilation, manifest review, and hunting for data theft and C2. CX Codex +1 486installs testing-api-authentication-weaknesses Tests REST API authentication for bypasses, broken JWT implementations, and unprotected endpoints. Useful for security auditing before production. CX Codex +1 484installs analyzing-indicators-of-compromise Scores IPs, domains, hashes, URLs and email artifacts for maliciousness, then sorts them into block, monitor or whitelist. CX Codex +1 466installs analyzing-campaign-attribution-evidence A skill that scores cyber-campaign evidence against competing hypotheses and returns a confidence level for attribution. Useful when an incident report has to defend its conclusion. CX Codex +1 464installs testing-cors-misconfiguration Audits API endpoints for Cross-Origin Resource Sharing vulnerabilities during authorized penetration tests. It identifies weak Origin reflection and misconfigured credentials. CX Codex +1 463installs analyzing-linux-system-artifacts Walks an agent through Linux system artifacts after a breach: auth logs, cron and systemd persistence, shell history, SSH keys. Built for incident response. CX Codex +1 461installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor