analyzing-azure-activity-logs-for-threats
Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query
它会碰到什么
扫了多少4 个文本文件,22 KB
它会碰到什么读凭据写文件
命中总数5 处
命中统计严重 0 · 高 4 · 中 1 · 低 0
逐条看命中(4 条严重或高危)
- 高
scripts/agent.py:134cred-envreadparser.add_argument("--workspace-id", default=os.getenv("AZURE_WORKSPACE_ID")) - 高
scripts/agent.py:135cred-envreadparser.add_argument("--tenant-id", default=os.getenv("AZURE_TENANT_ID")) - 高
scripts/agent.py:136cred-envreadparser.add_argument("--client-id", default=os.getenv("AZURE_CLIENT_ID")) - 高
scripts/agent.py:137cred-envreadparser.add_argument("--client-secret", default=os.getenv("AZURE_CLIENT_SECRET"))
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
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.
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:
- Role assignment changes (privilege escalation)
- Resource group and subscription modifications
- Key vault secret access from new IPs
- Network security group rule changes
- Conditional access policy modifications
Examples
# Detect new Global Admin role assignments
query = '''
AuditLogs
| where OperationName == "Add member to role"
| where TargetResources[0].modifiedProperties[0].newValue has "Global Administrator"
'''想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
星标★ 32,865
本站分层T1
该仓技能数818
原文件路径
skills/analyzing-azure-activity-logs-for-threats/SKILL.md同一个仓库里的其他技能
- abusing-dpapi-for-credential-access
- abusing-shadow-credentials-for-privesc
- achieving-cmmc-level-2-compliance
- acquiring-disk-image-with-dd-and-dcfldd
- analyzing-active-directory-acl-abuse
- analyzing-android-malware-with-apktool
- analyzing-api-gateway-access-logs
- analyzing-apt-group-with-mitre-navigator
- analyzing-bootkit-and-rootkit-samples
- analyzing-browser-forensics-with-hindsight
- analyzing-campaign-attribution-evidence
- analyzing-certificate-transparency-for-phishing