JEA endpoint for Windows servers

certmon reads Windows servers over WinRM, restricted to this JEA endpoint: a connection can run exactly two read-only functions (Get-CertmonInventory: public certificates, service bindings, autoenrollment state; Get-CertmonVersion). Nothing on the server is changed.

  1. Create an AD group (e.g. CONTOSO\certmon-Reader) containing the certmon server account (computer account or gMSA). So that its Kerberos ticket contains the new group: with the default service account (NT SERVICE\certmon, the computer account on the network) run klist -li 0x3e7 purge as administrator on the certmon server or reboot it – restarting only the service is not enough; with a gMSA, restart the certmon service.
  2. Copy the whole jea folder of the certmon installation (C:\Program Files\certmon\jea on the certmon server) to every server to monitor – not just the script: it installs the module from the certmon.Reader subfolder next to it. E.g. Copy-Item '0CERTMON01\c$\Program Files\certmon\jea' 'C:\temp\jea' -Recurse.
  3. On that server, as administrator (Windows PowerShell 5.1): & 'C:\temp\jea\Install-CertmonJea.ps1' -Account 'CONTOSO\certmon-Reader'. It copies the module to C:\Program Files\WindowsPowerShell\Modules and registers the endpoint; the copied folder can be deleted afterwards. Repeatable; for many servers put the folder on a share and run it from a GPO startup script or software distribution. WinRM must be running.
  4. Check from the certmon server: Test-CertmonJea.ps1 -ComputerName srv01.contoso.local (Restricted = True). It connects with your own account, which must (temporarily) be a member of the group; otherwise check in certmon with the Windows server source → "Check now".

Member servers use a temporary virtual account (local administrator, limited to the two functions); domain controllers don't (it would be a Domain Admin) and run with the rights of the certmon account. Firewall: TCP 5985 or 5986 from the certmon server, plus the service ports for the TLS cross-check. Remove with Install-CertmonJea.ps1 -Uninstall.

Deploying by Group Policy (startup script)

  1. Put the whole jea folder on a share every computer account can read, e.g. NETLOGON: Copy-Item 'C:\Program Files\certmon\jea' '0contoso.local\NETLOGON\certmon-jea' -Recurse.
  2. Edit a GPO: Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown) > Startup, tab "Scripts" (not "PowerShell Scripts") → Add…; script name powershell.exe, parameters (one line): -NoProfile -ExecutionPolicy Bypass -File "0contoso.local\NETLOGON\certmon-jea\Install-CertmonJea.ps1" -Account "CONTOSO\certmon-Reader". The "PowerShell Scripts" tab applies the server's execution policy, which may block a script from a network share.
  3. Link the GPO to the servers' OU (and to "Domain Controllers" for DCs; the script sets up DCs without a virtual account by itself).
  4. Startup scripts run only at boot: gpupdate /force and restart, or wait for the next restart. Then use "Check now" in certmon under Servers. The script's output is not visible; on a server that stays unread, Get-PSSessionConfiguration -Name certmon.Reader shows whether the endpoint is registered.

The script runs at every start and updates module and endpoint (WinRM restarts briefly). After a certmon update, replace the folder on the share with the new jea folder; certmon reports servers with an older module as SRV_JEA_OUTDATED.

More documents

  • Installation and setup

    Requirements, firewall, service account, permissions, setup (also silent), initial setup, update, backup and troubleshooting.

  • Notifications

    Alert logic, email over SMTP or Microsoft 365, Microsoft Teams and webhooks with an HMAC signature.

  • Findings

    Every finding id with its meaning and severity: network scan, PKI and Windows servers.

  • Windows event log

    Event ids of the certmon source for RMM and SIEM systems, with query examples.