↳ GitHub sourceAnalytics ruleHigh

Secret Exposure with Anomalous SPN Sign-In

Description

Detects applications with open hardcoded-secret findings (CWE-798, CWE-259, CWE-321, CWE-522) that have associated service principal sign-in anomalies. Correlates StratoSecure secret findings with AAD SPN sign-in failures.
Rule type
Scheduled
Version
1.0.0
Declared status
Available
Query frequency
1h
Query period
1455m
Trigger
gt 0

Declared MITRE coverage

Declared sources

Metadata from the source file. No dependencies inferred from KQL.

Connectors

Data types

KQL query

Original query, unchanged.

let lookback = 1d;
let SecretFindings = StratoSecure_Findings_CL
    | where TimeGenerated >= ago(lookback)
    | where FixStatus =~ "open"
    | where CweId in ("CWE-798", "CWE-259", "CWE-321", "CWE-522")
    | where Severity in ("Critical", "High")
    | summarize FindingCount = count(), RuleIds = make_set(RuleId), Repos = make_set(Repository)
        by ApplicationId, StraTenantId;
let AnomalousSignins = AADServicePrincipalSignInLogs
    | where TimeGenerated >= ago(lookback)
    | where ResultType != "0" or ConditionalAccessStatus =~ "failure"
    | summarize FailedAttempts = count(), DistinctIPs = dcount(IPAddress),
        FirstAttempt = min(TimeGenerated), LastAttempt = max(TimeGenerated)
        by ServicePrincipalId, ServicePrincipalName
    | where FailedAttempts > 5 or DistinctIPs > 3;
SecretFindings
    | join kind=inner AnomalousSignins on $left.ApplicationId == $right.ServicePrincipalId
    | project TimeGenerated = LastAttempt, ApplicationId, ServicePrincipalName, StraTenantId,
        FindingCount, RuleIds, Repos, FailedAttempts, DistinctIPs

Declared entities

CloudApplication

Related content

Links established from declared identifiers and solution manifests.

Source provenance

GitHub

Displayed values come from files in Azure/Azure-Sentinel. They describe the published template, not your workspace configuration.

Source identifier
a91e677a-46b5-428e-8a7d-29a2bb33bb6f
Additional source files 2Solutions/StratoSecure/Analytic Rules/S2_Secret_AnomalousCredential.yamlsource ↗Solutions/StratoSecure/Data/Solution_StratoSecure.jsonsolution-membership ↗
GSTEP / CATALOG TRACKING

Added to catalog : 16 Sept 2026 · 05:49 UTC
Last change observed : 16 Sept 2026 · 05:49 UTC

GSTEP sync dates, separate from the source content’s publication dates.