Skip to content
System hardening
ASD ISMISM-1624

ASD ISM 1624 Protect PowerShell script block logs

What it says

PowerShell script block logs are protected by Protected Event Logging functionality.

Quoted as published. Everything else on this page is written by Control Stack.

In plain English

Encrypt PowerShell script block logs with Protected Event Logging, so their contents, which can include credentials, can be read only with the private key.

PowerShell script block logs must be protected by Protected Event Logging, a feature that encrypts sensitive event log content with a public key, so only the matching private key can decrypt it. Script block logging (ISM-1623) records the code PowerShell processes, which can include credentials. The control names this feature, so access permissions on the logs (ISM-1985) do not replace it. It covers script block logs only, not module logs or transcripts.

Why it matters

Script block logs can capture credentials and other sensitive data that scripts use, so on a compromised device readable logs could give a malicious actor what they need to reach further. Encrypted entries hide the script text from anyone without the private key.

How to implement

  1. Issue a certificate for encrypting the logs.

    It needs the Document Encryption enhanced key usage and either the Data Encipherment or Key Encipherment key usage. Create it with your certificate authority or a certificate tool, then separate the public certificate from the private key.

  2. Keep the private key off the devices that log.

    Hold it only where logs are decrypted, such as a secured central log collector, and restrict who can use it. Back it up, because losing it makes the protected logs unreadable.

  3. Set up and test decryption on a pilot group before deploying Protected Event Logging widely.

    The script text in encrypted events cannot be searched or alerted on until decrypted. Decrypt at the collector, for example with Unprotect-CmsMessage on event ID 4104, before your analysis tool reads them, and protect the decrypted copies from unauthorised access (ISM-1985).

  4. Deploy the policy to every workstation and server.

    In Group Policy, under Administrative Templates, Windows Components, Event Logging, turn on the policy named Enable Protected Event Logging and supply the public certificate by thumbprint, path or encoded content. Devices outside Group Policy need the same setting through your device management tool or powershell.config.json.

  5. Close gaps you cannot configure directly.

    Ask a provider that runs a server to apply this setting. A Windows version without the feature needs upgrading (ISM-1407 requires the latest or previous release). Until then, record a known shortfall for the authorising officer.

Keep it running

Keep each private key for as long as logs encrypted with it are retained (ISM-1988). Replacing the certificate, rebuilding the log collector or changing the analysis tool should trigger a fresh test from device to decryption.

Evidence and audit

  1. Check 1 of 3What an auditor asks for

    Ask for

    A harmless test script containing a unique marker word, run on a sample of workstations and servers drawn from the IT equipment registers (ISM-0336, ISM-1869) and a discovery scan, and the script block event (ID 4104) it creates on each.

    Look at

    Whether the event holds readable script text or an encrypted message in Cryptographic Message Syntax, and whether searching the device's script block events finds the marker word.

    Good evidence

    On every sampled device the event holds an encrypted message, and the marker word cannot be found in the device's script block events.

  2. Check 2 of 3What an auditor asks for

    Ask for

    A decryption of those events at the collector, and the location of the private key.

    Look at

    Whether the marker word can be read after decryption, and whether any sampled logging device holds the private key.

    Good evidence

    The marker word appears after decryption at the collector, and no sampled logging device holds the private key.

  3. Check 3 of 3What an auditor asks for

    Ask for

    The Protected Event Logging policy state for all Windows workstations and servers from your management tool, with the IT equipment registers and a discovery scan to compare it with.

    Look at

    Devices on those lists missing from the report, or without the policy or the current certificate.

    Good evidence

    Every Windows workstation and server on those lists has the policy on with the current certificate. A recorded gap is a shortfall, not a pass.

Mappings

Closest match in ASD Essential Eight: E8-AH-ML2.13, Protect event logs from unauthorised changes or deletion, which this control covers in full and more.

Essential Eight

ASD Essential Eight: 5 mappings

Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.