Zum Hauptinhalt springen

Audit Log Strategy (DORA / NIS2)

Generated with Claude Code

Co-Authored-By: Claude (noreply@anthropic.com)

Strategy for Azure audit log infrastructure on the TOGETHER/CCA platform. Covers Azure platform logs, Entra ID logs, and resource-level diagnostic logs. Application-level logging is already in place and documented separately.

FieldValue
ScopeAzure platform + Entra ID + resource diagnostic logs (all subscriptions)
Regulatory basisDORA (EU 2022/2554), RTS 2024/1774 Art. 12; NIS2 IR 2024/2690 (reference)
SubscriptionsTogether-Prod, Together-Fachtest
Application loggingSee monitoring-logging.md
Windows Event LogsSee windows-event-log-baseline.md
Server onboardingSee azure-arc-onboarding-plan.md

Regulatory Requirements

DORA RTS 2024/1774 Article 12 — Logging

DORA applies directly to insurance undertakings. The RTS defines the technical logging requirements.

DORA RequirementRequired Log CategoriesAzure Source
Access control eventsSign-ins, conditional access, role assignmentsEntra ID: SignInLogs, AuditLogs
Identity managementUser/group/app creation, modification, deletionEntra ID: AuditLogs, ProvisioningLogs
User activityResource operations, admin actions, configuration changesAzure Activity Log (Administrative, Policy)
ICT anomaliesThreat detections, risky sign-ins, anomalous behaviorEntra ID: RiskyUsers, UserRiskEvents (P2)
ICT-related incidentsSecurity alerts, firewall events, intrusion attemptsDefender for Cloud, App Gateway WAF logs
Data accessKey/secret access, storage operations, DB queriesKey Vault AuditEvent, Storage logs, SQL audit
Network activityFirewall rules, NSG events, traffic flowsApp Gateway logs, NSG logs

Additional DORA Requirements

RequirementImplementationReference
Tamper protectionWorkspace RBAC + resource locks + optional immutable exportDORA RTS Art. 12(3)
Clock synchronizationw32tm (on-prem servers), Azure-managed (PaaS)DORA RTS Art. 12(4)
Retention periodRisk-based; minimum 18 months (NIS2 floor), target 2 yearsDORA RTS Art. 12(2), NIS2 IR 2024/2690
Incident reporting4h initial notification, 72h intermediate report, 1 month finalDORA Art. 19

NIS2 note: Insurance companies are carved out of NIS2 in favor of DORA. However, the NIS2 Implementing Regulation (EU 2024/2690) establishes an 18-month minimum retention period that serves as a practical floor for all regulated entities.

Current State

Logging LayerStatusDetails
Application Insights (APM)ActiveAll TOGETHER apps — see monitoring-logging.md
Structured App Logs (CLEF)ActiveSerilog to TisApplicationLogs_CL via Fluent Bit
IIS W3C LogsActiveAMA/DCR to W3CIISLog
Windows Event LogsActiveAMA/DCR per server role — see windows-event-log-baseline.md
Azure Arc OnboardingCompleteAll Fachtest + Prod servers — see azure-arc-onboarding-plan.md
Azure Activity Log to Log AnalyticsDoneaz-prod-auditTrailing (Prod), az-fachtest-auditTrailing (Fachtest)
Entra ID Diagnostic LogsDoneaz-entra-auditTrailing (tenant-level, routed to Prod workspace)
Resource Diagnostic LogsMissingNo diagnostic settings on Azure resources
Azure Policy enforcementMissingNo DINE policies for diagnostic settings
Log retention configurationMissingDefault retention on all tables (30 days interactive)
Tamper protectionMissingNo resource locks or RBAC restrictions on workspaces

Gap Summary

GapDORA ImpactPriority
Activity Log not routed to Log AnalyticsAdmin actions lost after 90 days; no KQL correlationCritical Done
Entra ID logs not routedSign-in/identity audit trail lost after 7–30 daysCritical Done
No diagnostic settings on Key VaultsSecret/certificate access not auditableCritical
Retention below 18 months on all tablesNIS2 minimum not met, DORA risk-based requirement unmetCritical
No diagnostic settings on App GatewayWAF/firewall events not retained or queryableHigh
No diagnostic settings on SQL resourcesSQL audit events not centralizedHigh
No diagnostic settings on NSGsNetwork security events not retainedHigh
No Azure Policy enforcementNew resources deployed without loggingHigh
No tamper protection on logsDORA Art. 12(3) non-complianceHigh
No diagnostic settings on Storage AccountsBlob/file access not auditableMedium

Target Architecture

Azure Platform                                   Log Analytics Workspaces
---------------------------------------------- -----------------------------------------
Together-Plattform-LogAnalyticsworkspace
Activity Log (Together-Prod) ──────────────────► (Prod)
Entra ID Diagnostic Logs (tenant-level) ───────► Workspace ID: 9ee01003-d32e-4110-ab57-
1f09be580fc3
Resource Diagnostic Settings: │
Key Vaults ──────── audit ───────────────────► │ Interactive retention: 90 days
App Gateway ─────── allLogs ─────────────────► │ Total retention: 730 days (2 yrs)
SQL Servers ─────── audit ───────────────────► │
NSGs ────────────── allLogs ─────────────────► │
Storage Accounts ── allLogs ─────────────────► │
VPN Gateway ─────── allLogs ─────────────────► │

Azure Policy (DINE) │
Enforces diagnostic settings ────────────────► (auto-applies to new resources)

---------------------------------------------- -----------------------------------------
Fachtest-LogAnalyticsworkspace
Activity Log (Together-Fachtest) ──────────────► (Fachtest)
Workspace ID: 87f6d081-015f-436f-b58b-
Resource Diagnostic Settings: add840d4be7a
Key Vaults ──────── audit ───────────────────►
... │ Same retention policy

Workspace Mapping

SubscriptionTarget WorkspaceResource Group
Together-ProdTogether-Plattform-LogAnalyticsworkspaceLogAnalytics-Prod
Together-FachtestFachtest-LogAnalyticsworkspaceLogAnalytics-Fachtest

Note: Entra ID diagnostic logs are configured at the tenant level — a single diagnostic setting covers both subscriptions. Route to the Prod workspace for centralized identity audit.

Azure Activity Log

Route the Activity Log from each subscription to the respective Log Analytics workspace. The Activity Log captures all subscription-level operations: resource creation/deletion, RBAC changes, policy evaluations, security alerts.

Configuration

SubscriptionDiagnostic Setting NameCategoriesTarget WorkspaceStatus
Together-Prodaz-prod-auditTrailingAdministrative, Security, Alert, PolicyProd workspaceDone
Together-Fachtestaz-fachtest-auditTrailingAdministrative, Security, Alert, PolicyFachtest workspaceDone

CLI Example

# Together-Prod
az monitor diagnostic-settings subscription create \
--name "diag-activitylog-to-law" \
--subscription "Together-Prod" \
--workspace "/subscriptions/<prod-sub-id>/resourceGroups/LogAnalytics-Prod/providers/Microsoft.OperationalInsights/workspaces/Together-Plattform-LogAnalyticsworkspace" \
--logs '[
{"category": "Administrative", "enabled": true},
{"category": "Security", "enabled": true},
{"category": "Alert", "enabled": true},
{"category": "Policy", "enabled": true}
]'

Repeat for Together-Fachtest with the Fachtest workspace.

Entra ID Diagnostic Logs

Entra ID logs are configured at the tenant level (not per subscription). The Azure portal retains sign-in logs for only 7 days (free) or 30 days (P1/P2). Routing to Log Analytics is required for DORA-compliant retention.

Log Categories

CategoryDORA RelevancePriorityLicense
AuditLogsIdentity management, access control changesCriticalFree / P1 / P2
SignInLogsUser authentication audit trailCriticalFree / P1 / P2
NonInteractiveUserSignInLogsBackground/automated auth on behalf of usersHighP1 / P2
ServicePrincipalSignInLogsApp/service principal authenticationHighP1 / P2
ManagedIdentitySignInLogsManaged identity authenticationHighP1 / P2
ProvisioningLogsUser provisioning to non-Microsoft appsMediumP1 / P2
RiskyUsersUsers flagged as at-riskCriticalP2 only
UserRiskEventsRisky sign-in event detailsCriticalP2 only
RiskyServicePrincipalsSuspicious service principal activityHighP2 only
ServicePrincipalRiskEventsService principal risk eventsHighP2 only
MicrosoftGraphActivityLogsAll HTTP requests via Microsoft GraphMediumP1 / P2

Action required: Determine the current Entra ID license tier. With P1, the top 6 categories are available. With P2, all 11 categories including the risk detection logs (critical for DORA Art. 10 — anomaly detection) become available.

CLI Example

# Tenant-level Entra ID diagnostic setting
az monitor diagnostic-settings create \
--name "diag-entraid-to-law" \
--resource "/providers/Microsoft.aadiam/diagnosticSettings" \
--workspace "/subscriptions/<prod-sub-id>/resourceGroups/LogAnalytics-Prod/providers/Microsoft.OperationalInsights/workspaces/Together-Plattform-LogAnalyticsworkspace" \
--logs '[
{"category": "AuditLogs", "enabled": true},
{"category": "SignInLogs", "enabled": true},
{"category": "NonInteractiveUserSignInLogs", "enabled": true},
{"category": "ServicePrincipalSignInLogs", "enabled": true},
{"category": "ManagedIdentitySignInLogs", "enabled": true},
{"category": "ProvisioningLogs", "enabled": true},
{"category": "RiskyUsers", "enabled": true},
{"category": "UserRiskEvents", "enabled": true},
{"category": "RiskyServicePrincipals", "enabled": true},
{"category": "ServicePrincipalRiskEvents", "enabled": true},
{"category": "MicrosoftGraphActivityLogs", "enabled": true}
]'

Note: Enabling a P2-only category without the license will fail silently or produce an error. Enable only the categories matching your license tier.

Resource Diagnostic Settings

Azure has no global "enable all diagnostics" switch. Each resource type must have diagnostic settings configured individually, selecting which log categories to send and to which destination. This is the largest gap in the current setup.

Resource Inventory

PriorityResource TypeResource Name(s)Log Category GroupTarget Workspace
CriticalKey Vaultat-tgca-tis-p-defaultauditProd
CriticalKey Vaultat-tgca-tis-d-default, at-tgca-tis-v-default, at-tgca-tis-f-default, at-tgca-tis-s-defaultauditFachtest
CriticalApplication GatewayTIS-PROD-CCA_Weblight-AppGwallLogsProd
HighNSGPer subnet (DMZ, VPN, APP, DB)allLogsRespective
HighSQL Server (IaaS)CCA-Hosting-SQL01, CCA-Hosting-SQL02See note belowProd
HighStorage AccountBackup storage, tisccacdnstorageallLogs (per sub-service)Respective
MediumVPN GatewayVPN / VNet Gateway (if deployed)allLogsProd
MediumBastion Host(if deployed)allLogsRespective
MediumLog Analytics WorkspaceBoth workspaces (meta-audit)auditRespective

SQL Server on VMs (IaaS): CCA-Hosting SQL Servers are IaaS VMs, not Azure SQL PaaS. Azure diagnostic settings don't apply to SQL on VMs. Instead, configure SQL Server Audit within SQL Server itself to write to a file share or Windows Event Log, which AMA can then forward. This is a separate task from Azure resource diagnostics.

Category Groups

Azure supports two category groups that simplify configuration:

Category GroupContentRecommended For
auditSecurity-relevant events only (access, changes, authentication)Key Vaults, Workspaces — lower volume, compliance-focused
allLogsAll available log categoriesApp Gateway, NSGs, Storage — need operational + security logs

Using category groups is preferred over selecting individual categories because Azure automatically includes new categories as they are added.

CLI Example (Key Vault)

az monitor diagnostic-settings create \
--name "diag-to-law" \
--resource "/subscriptions/<prod-sub-id>/resourceGroups/TIS-Secrets/providers/Microsoft.KeyVault/vaults/at-tgca-tis-p-default" \
--workspace "/subscriptions/<prod-sub-id>/resourceGroups/LogAnalytics-Prod/providers/Microsoft.OperationalInsights/workspaces/Together-Plattform-LogAnalyticsworkspace" \
--logs '[{"categoryGroup": "audit", "enabled": true}]'

Retention Strategy

Log Analytics supports two retention tiers:

  • Interactive (analytics) retention: Data available for KQL queries (4–730 days, default 30)
  • Total retention (archive): Data available via search jobs only (up to 12 years total)

Target Retention

TableContentInteractiveTotalRationale
AzureActivitySubscription operations90 days730 daysAdmin audit trail; 90 days free
SigninLogsUser sign-ins90 days730 daysAuthentication audit
AADNonInteractiveUserSignInLogsAutomated sign-ins90 days730 daysAuthentication audit
AADServicePrincipalSignInLogsService principal sign-ins90 days730 daysService authentication audit
AADManagedIdentitySignInLogsManaged identity sign-ins90 days730 daysService authentication audit
AuditLogsEntra ID changes90 days730 daysIdentity management audit
AADRiskyUsersRisky users (P2)90 days730 daysAnomaly detection
AZKVAuditLogsKey Vault access90 days730 daysSecret/cert access audit
AGWAccessLogsApp Gateway access90 days730 daysWAF/firewall audit
AGWFirewallLogsApp Gateway WAF90 days730 daysIntrusion detection
AZNSGFlowLogsNSG flow data30 days180 daysNetwork forensics (high volume)
StorageBlobLogsBlob access90 days730 daysData access audit
TisApplicationLogs_CLApplication logs90 days730 daysApplication audit
W3CIISLogIIS access logs90 days730 daysWeb access audit
EventWindows event logs90 days730 daysOS-level audit

Cost note: Interactive retention beyond the free tier (31 days, or 90 days for AzureActivity) costs ~$0.10/GB/month. Archive retention costs ~$0.02/GB/month. NSG flow logs have high volume — shorter interactive retention recommended.

CLI Example

# Set retention on a specific table
az monitor log-analytics workspace table update \
--resource-group LogAnalytics-Prod \
--workspace-name Together-Plattform-LogAnalyticsworkspace \
--name AzureActivity \
--retention-time 90 \
--total-retention-time 730

Repeat for each table in both workspaces.

Enforcement via Azure Policy

Azure Policy with DeployIfNotExists (DINE) effect automatically creates diagnostic settings on resources that lack them. This ensures new resources are never deployed without logging.

Use the built-in Azure Policy initiative: "Enable audit category group resource logging to Log Analytics". This initiative contains individual DINE policies for 100+ resource types. Each policy:

  1. Evaluates whether a resource has a diagnostic setting with the audit category group enabled
  2. If missing, deploys an ARM template to create one
  3. Automatically applies to new resources at creation time
  4. Requires a remediation task for existing resources

Assignment per Subscription

SubscriptionInitiative AssignmentWorkspace ParameterManaged IdentityStatus
Together-Proddiag-audit-to-law-prodProd workspace resource IDSystem-assigned (Contributor)Pending
Together-Fachtestdiag-audit-to-law-fachtestFachtest workspace resource IDSystem-assigned (Contributor)Pending

Implementation Steps

  1. Identify the initiative definition:

    az policy set-definition list \
    --query "[?contains(displayName, 'Enable audit category group resource logging to Log Analytics')].[name, displayName]" \
    -o table
  2. Assign at subscription scope:

    az policy assignment create \
    --name "diag-audit-to-law-prod" \
    --display-name "Audit logs to Log Analytics (Prod)" \
    --policy-set-definition "<initiative-definition-id>" \
    --scope "/subscriptions/<prod-sub-id>" \
    --params '{"logAnalytics": {"value": "/subscriptions/<prod-sub-id>/resourceGroups/LogAnalytics-Prod/providers/Microsoft.OperationalInsights/workspaces/Together-Plattform-LogAnalyticsworkspace"}}' \
    --mi-system-assigned \
    --location westeurope
  3. Grant Contributor role to managed identity:

    az role assignment create \
    --assignee-object-id "<managed-identity-principal-id>" \
    --role "Contributor" \
    --scope "/subscriptions/<prod-sub-id>"
  4. Trigger compliance evaluation:

    az policy state trigger-scan --subscription "<prod-sub-id>"
  5. Create remediation tasks for existing resources:

    az policy remediation create \
    --name "remediate-keyvault-diag" \
    --policy-assignment "diag-audit-to-law-prod" \
    --definition-reference-id "<keyvault-policy-reference-id>" \
    --resource-discovery-mode ReEvaluateCompliance
  6. Verify compliance:

    az policy state summarize \
    --subscription "<prod-sub-id>" \
    --policy-assignment "diag-audit-to-law-prod" \
    -o table

Important: DINE policies only auto-deploy on new resources. For existing resources, you must run remediation tasks (step 5) — one per resource type within the initiative.

Tamper Protection and Clock Synchronization

Tamper Protection

DORA RTS Art. 12(3) requires logs to be protected against tampering, deletion, and unauthorized access.

MeasureScopeImplementationPriority
Workspace RBACBoth workspacesRestrict Log Analytics Contributor to a dedicated security group; resource owners should not be able to modify/delete logsCritical
Resource LockBoth workspacesApply CanNotDelete lock to prevent accidental deletionCritical
Table-level RBACSensitive tablesUse table-level access control for SigninLogs, AuditLogs if neededMedium
Immutable exportLong-term archiveExport critical tables to Storage Account with immutability policies (WORM)Optional (Phase 3+)
# Apply CanNotDelete lock to Prod workspace
az lock create \
--name "do-not-delete" \
--lock-type CanNotDelete \
--resource-group LogAnalytics-Prod \
--resource-name Together-Plattform-LogAnalyticsworkspace \
--resource-type Microsoft.OperationalInsights/workspaces

Clock Synchronization

DORA RTS Art. 12(4) requires clock synchronization against a documented reliable time source.

EnvironmentMethodTime SourceStatus
On-prem servers (Arc-connected)Windows Time Service (w32tm)Domain Controllers (NTP hierarchy)Verify
Azure PaaS resourcesAzure-managedMicrosoft NTP infrastructureAutomatic
CCA-Hosting VMsWindows Time ServiceAzure time sync (VMICTimeProvider)Verify

Verification: check w32tm /query /status on all servers. For Arc-connected servers, this can be done remotely via Azure Arc Run Command.

Implementation Roadmap

Phase 1 — Activity Log + Entra ID (Week 1–2)

TaskScopeStatus
Create Activity Log diagnostic settingTogether-ProdDoneaz-prod-auditTrailing
Create Activity Log diagnostic settingTogether-FachtestDoneaz-fachtest-auditTrailing
Create Entra ID diagnostic setting (tenant-level)All categories matching license tierDoneaz-entra-auditTrailing
Verify Activity Log data in Prod workspaceKQL queryPending
Verify Entra ID data in Prod workspaceKQL queryPending

Phase 2 — Resource Diagnostic Settings (Week 3–4)

TaskResourceStatus
Diagnostic setting: Key Vault at-tgca-tis-p-defaultProdPending
Diagnostic setting: Key Vault at-tgca-tis-f-defaultFachtestPending
Diagnostic setting: Key Vault at-tgca-tis-d-defaultFachtestPending
Diagnostic setting: Key Vault at-tgca-tis-v-defaultFachtestPending
Diagnostic setting: Key Vault at-tgca-tis-s-defaultFachtestPending
Diagnostic setting: Application GatewayProdPending
Diagnostic setting: NSGs (all subnets)Both environmentsPending
Diagnostic setting: Storage AccountsBoth environmentsPending
Verify Key Vault audit logs in workspaceKQL queryPending
Verify App Gateway logs in workspaceKQL queryPending

Phase 3 — Azure Policy (Week 5–6)

TaskScopeStatus
Assign built-in audit initiativeTogether-ProdPending
Assign built-in audit initiativeTogether-FachtestPending
Grant managed identity Contributor roleBoth subscriptionsPending
Run remediation tasks for existing resourcesBoth subscriptionsPending
Verify policy complianceBoth subscriptionsPending

Phase 4 — Retention Configuration (Week 7)

TaskScopeStatus
Set retention on all tables in Prod workspace90 days interactive, 730 days totalPending
Set retention on all tables in Fachtest workspace90 days interactive, 730 days totalPending
Verify retention settingsCLI checkPending

Phase 5 — Tamper Protection (Week 8)

TaskScopeStatus
Apply CanNotDelete lock to Prod workspaceProdPending
Apply CanNotDelete lock to Fachtest workspaceFachtestPending
Review workspace RBAC — restrict Log Analytics ContributorBoth workspacesPending
Verify clock synchronization on all serversAll Arc-connected serversPending

Phase 6 — Verification (Week 9–10)

TaskScopeStatus
Run all verification queries (see below)Both workspacesPending
Document compliance statusThis documentPending
Review open questionsAll stakeholdersPending

Verification

Activity Log

AzureActivity
| where TimeGenerated > ago(24h)
| summarize count() by CategoryValue
| order by count_ desc

Entra ID Sign-In Logs

SigninLogs
| where TimeGenerated > ago(24h)
| summarize count() by ResultType
| order by count_ desc

Key Vault Audit Logs

AZKVAuditLogs
| where TimeGenerated > ago(24h)
| summarize count() by OperationName
| order by count_ desc

Application Gateway Access Logs

AGWAccessLogs
| where TimeGenerated > ago(24h)
| summarize count() by RuleName
| order by count_ desc

Policy Compliance Check

az policy state summarize \
--subscription "<prod-sub-id>" \
--policy-assignment "diag-audit-to-law-prod" \
--query "policyAssignments[0].{compliant: results.resourceDetails[?complianceState=='compliant'].count | [0], nonCompliant: results.resourceDetails[?complianceState=='noncompliant'].count | [0]}"

Retention Verification

# Check retention on key tables
for table in AzureActivity SigninLogs AuditLogs AZKVAuditLogs TisApplicationLogs_CL W3CIISLog Event; do
echo "--- $table ---"
az monitor log-analytics workspace table show \
--resource-group LogAnalytics-Prod \
--workspace-name Together-Plattform-LogAnalyticsworkspace \
--name "$table" \
--query "{table: name, retention: retentionInDays, totalRetention: totalRetentionInDays}" \
-o table 2>/dev/null || echo "Table not yet provisioned"
done

Clock Synchronization (on Arc-connected servers)

Event
| where TimeGenerated > ago(7d)
| where Source == "Microsoft-Windows-Time-Service"
| where EventID in (35, 36, 37, 134)
| project TimeGenerated, Computer, EventID, RenderedDescription

Open Questions

QuestionContextNeeded By
Entra ID license tier (P1 vs P2)?Determines whether risk detection logs (RiskyUsers, UserRiskEvents) are available. P2 is strongly recommended for DORA Art. 10 (anomaly detection).Phase 1
Domain Controllers (TISDC01, TISDC02) — include in Arc onboarding?DC security logs are critical for identity audit. Open question from azure-arc-onboarding-plan.md.Phase 2
TISWAP01 + TISADFS01 — assign DCRs?Currently Arc-onboarded with AMA but no DCR applied. ADFS logs are particularly important for authentication audit.Phase 2
SQL Server on-VM audit configuration?CCA-Hosting SQL Servers (SQL01, SQL02) are IaaS — need SQL Server Audit configured within the engine, not via Azure diagnostic settings.Phase 2
Microsoft Sentinel evaluation?SIEM/SOAR capabilities for automated threat detection, incident response, and DORA compliance workbooks. Budget approval required.After Phase 6
Immutable blob export for long-term archive?DORA tamper protection — workspace RBAC may be sufficient, but immutable storage export provides a stronger guarantee. Cost/complexity trade-off.Phase 5