DECEPTION CHECK / SKYKICK RESPONSE / BASE LOGIC AND STANDARD RULES / 2026-10-19

Purpose
Two experimental Sigma rules provide narrower event-match review leads for Entra
directory audit data. They supplement the broad access-change queues in KQL 03,
SPL SP02, CrowdStrike CQL CS02, and Sophos Data Lake L02. They are not conversions and do not replace
service-principal sign-in review, credential inventory, or the full audit timeline.
Sigma is a rule format; it does not collect logs or guarantee backend compatibility.
Read these mapping and result limitations before converting or enabling a rule.

EXACT BASE PREDICATES
Within the verified tenant and selected UTC investigation window:

APP_ACTOR(e) :=
  a nonempty string at e.InitiatedBy.app.appId
  OR a nonempty string at e.InitiatedBy.app.servicePrincipalId

S01(e) := APP_ACTOR(e)
  AND case_insensitive_contains(e.OperationName, "member to role")

S02(e) := APP_ACTOR(e)
  AND (case_insensitive_contains(e.OperationName, "Certificates and secrets")
       OR case_insensitive_contains(e.OperationName, "service principal credentials"))

In Sigma, the list of actor maps means OR; the condition joins actor and operation
with AND. The '?*' wildcard requires at least one character. Missing, null, and empty
actor strings do not match. It is not a GUID validator; whitespace-only or malformed
nonempty strings can match, so validate source field quality. These rules do not
filter Result, compare actor and target IDs, limit to the incident app/IP list,
select only privileged roles, or correlate multiple events. Tenant and time scoping
belong to the verified backend query, not to these portable event predicates.

S01 matches an operation-name family, including eligible/scoped additions, requests,
completions, and cancellations when the phrase is present. It does not establish
that the change completed. Inspect the operation, result, role, principal, and
approval context. Other role operations whose names lack the phrase are excluded.

S02 selects credential-related operation names. Matching ignores case and does not
depend on the dash before 'Certificates and secrets'. It can match removal and
rotation, and does not prove that a credential was added. Generic 'Update application'
without a matching phrase is excluded even when its nested properties describe a
credential change. Review such events in the broader queue. Inspect all target
resources and their modifiedProperties, compare old/new credential metadata, and
verify the current application/service-principal object before drawing conclusions.

REQUIRED SOURCE FIELDS AND MAPPING
Rule input spelling is Microsoft's Azure Monitor AuditLogs schema:

  OperationName                       string; operation-name predicate
  InitiatedBy.app.appId                nested string; application/client ID
  InitiatedBy.app.servicePrincipalId   nested string; tenant service-principal ID

At least one of the two actor IDs must be available for an app-actor match. Preserve
both when present. Preserve user initiator information too; an app identity recorded
here does not by itself establish that authentication was app-only. Microsoft also
represents some system initiators as apps. Events with only an app display name or
with only user-actor data are outside this rule pair and remain in the broad hunt.

For investigation, retain TimeGenerated, AADTenantId, Id, CorrelationId, OperationName,
Result, ResultReason, the complete InitiatedBy object, and every TargetResources
entry, including modifiedProperties. Do not assume the first target is the principal
or that a top-level ModifiedProperties column exists. Do not compare an application
client ID directly to a service-principal object ID. Establish the object types and
tenant before evaluating self-assignment or an actor/target difference.

The Sigma logsource is product: azure / service: auditlogs, from Sigma's taxonomy.
The nested field spellings describe actual Microsoft source properties. They are
not promises that every SIEM stores or resolves dotted fields in this form. A
Log Analytics conversion must resolve, for example, InitiatedBy.app.appId from the
dynamic InitiatedBy object as a string. A backend that quotes the whole dotted name
as an unrelated flat column needs a mapping/extraction fix before use.

Raw Microsoft Graph directoryAudit JSON uses initiatedBy (lowercase i) and
activityDisplayName. Map those source fields explicitly if that is your feed.
Do not silently equate them to a different connector's normalized fields. Sophos
xdr_identity_o365 uses its own Microsoft 365 Management Activity schema and is not
the direct input to these rules. Confirm the actual source, tenant identifiers,
field types, parser, and conversion pipeline against a known event.

TRUTH FIXTURES / EXPECTED EVENT MATCHES
These are synthetic predicate examples, not observed incident records.

Operation or condition                                 App identity       S01 S02
Add member to role                                    appId populated      Y   N
Add member to role completed.                         SP ID only           Y   N
Add eligible member to role                           appId populated      Y   N
Add member to role canceled (PIM activation)           appId populated      Y   N
Remove member from role                               appId populated      N   N
Add member to role                                    user only            N   N
Add member to role                                    IDs null/empty       N   N
Update application - Certificates and secrets management  appId populated   N   Y
Same operation with an en dash before Certificates    appId populated      N   Y
Add service principal credentials                     SP ID only           N   Y
Remove service principal credentials                  appId populated      N   Y
Update application; keyCredentials in properties only appId populated      N   N
Matching operation; result=failure or unknown          appId populated      same
Matching operation; absent targets                    appId populated      same
Matching operation; actor and target equal/different   appId populated      same

VALIDATION RECORD
PyYAML 6.0.3 and pySigma 1.5.1 parsed both rules. The author checked 38 synthetic
records, yielding 76 predicate assertions against the parsed Sigma conditions;
all passed. An independent reviewer checked 32 synthetic predicate scenarios;
all passed, including a rerun against the compact rule files supplied here.
These checks use declared nested-field mapping and test predicate behavior. They
are not backend conversion, target-SIEM execution, or customer-tenant validation.
No alert rule was enabled or changed. Local mapping, telemetry, runtime, and
approved alert tuning still require validation before operational deployment.

DEPLOYMENT AND INTERPRETATION
Validate conversion output, table selection, case handling, '?*' wildcard behavior,
JSON extraction, null/empty handling, and tenant/time scope in the actual backend.
Run positive, negative, and missing-field samples before production use. Establish
coverage and retention separately; zero hits cannot clear a tenant. Tune approved
automation with tenant, actor, operation, target, and change context; blanket vendor
app allowlists can hide abuse of an otherwise legitimate identity. A match is a
review lead. Human-initiated abuse, alternate operation names, missing audit data,
and absent actor IDs can be missed. No customer-tenant or target-SIEM execution is
represented by the supplied rule files. ATT&CK tags describe investigative relevance,
not proof that a technique occurred.

YARA: NOT INCLUDED
The supplied package contains cloud-identity/API evidence and no recovered file or
memory artifact with distinctive content from which to author a useful YARA rule.
YARA can examine file or process-memory content, but it does not provide the Entra
event, actor, target, and result semantics used here. A rule matching public app IDs,
IP addresses, generic OAuth text, or library user-agent strings in arbitrary files
would not establish this abuse. Reassess YARA if a relevant artifact is recovered.
This assessment does not claim that no malware exists anywhere in the incident.

PRIMARY REFERENCES
Sigma specification, including list/map, wildcard, and condition semantics:
https://sigmahq.io/sigma-specification/specification/sigma-rules-specification.html
Sigma taxonomy (azure / auditlogs):
https://sigmahq.io/sigma-specification/specification/sigma-appendix-taxonomy.html
Microsoft AuditLogs:
https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/auditlogs
Microsoft auditActivityInitiator:
https://learn.microsoft.com/en-us/graph/api/resources/auditactivityinitiator?view=graph-rest-1.0
Microsoft appIdentity:
https://learn.microsoft.com/en-us/graph/api/resources/appidentity?view=graph-rest-1.0
Microsoft directoryAudit:
https://learn.microsoft.com/en-us/graph/api/resources/directoryaudit?view=graph-rest-1.0
Microsoft audit activity names:
https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
Microsoft Sentinel credential analytic (operation examples and target-property logic):
https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft%20Entra%20ID/Analytic%20Rules/NewAppOrServicePrincipalCredential.yaml
YARA documentation:
https://yara.readthedocs.io/en/stable/commandline.html
