TMAegisBeta
More rules for exchange

Microsoft Exchange Server

TMA-EXCHANGE-4.2

Ensure 'Turn on administrator audit logging' is set to '<values>'

HighLevel 1Automatedexchange

Description

Administrator audit logging is used to provide a log of the settings that are changed by administrators anywhere in the system. This recommendation incorporates the following parameters into one setting: • AdminAuditLogEnabled • AdminAuditLogCmdlets • AdminAuditLogParameters • AdminAuditLogExcludedCmdlets • AdminAuditLogAgeLimit • LogLevel Note: Changes to the audit log configuration may take up... Prints compliant when AdminAuditLogEnabled is True, AdminAuditLogCmdlets and AdminAuditLogParameters are '*', AdminAuditLogExcludedCmdlets is empty, AdminAuditLogAgeLimit is at least 90 days and LogLevel is Verbose. Run on each Edge Transport and Mailbox server. Run from an Exchange Management Shell or after `Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn`; the audit loads the snap-in itself when Get-ExchangeServer is missing and fails if it cannot.

How it is checked

Audit method: Shell command

shell
$ErrorActionPreference = 'Stop'; if (-not (Get-Command Get-ExchangeServer -ErrorAction SilentlyContinue)) { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn -ErrorAction Stop }; if (-not (Get-Command Get-ExchangeServer -ErrorAction SilentlyContinue)) { throw 'Exchange Management Shell cmdlets are not available' }; $ts = { param($v) $s = "$v"; if (-not $s -or $s -eq 'Unlimited') { $null } else { [timespan]$s } }; $c = Get-AdminAuditLogConfig -ErrorAction Stop; $age = & $ts $c.AdminAuditLogAgeLimit; if ($c.AdminAuditLogEnabled -eq $true -and (@($c.AdminAuditLogCmdlets) -join ',') -eq '*' -and (@($c.AdminAuditLogParameters) -join ',') -eq '*' -and @($c.AdminAuditLogExcludedCmdlets | Where-Object { "$_" -ne '' }).Count -eq 0 -and $null -ne $age -and $age.TotalDays -ge 90 -and "$($c.LogLevel)" -eq 'Verbose') { 'compliant' } else { 'noncompliant' }
Expected output
compliant

How it is fixed

Fix method: Guidance or infrastructure patch

Set-AdminAuditLogConfig -AdminAuditLogEnabled $true -AdminAuditLogCmdlets '*' -AdminAuditLogParameters '*' -AdminAuditLogExcludedCmdlets $null -AdminAuditLogAgeLimit '90.00:00:00' -LogLevel Verbose

Properties

Operating systems
Any
Tags
exchangelogging
Reference
CIS Microsoft Exchange Server 2019 Benchmark v1.0.1 - 4.2 Ensure 'Turn on administrator audit logging' is set to '<values>'

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target exchange