How-To: Export your Cloud PKI Logs to CloudWatch
Prerequisites
How To Export Your Cloud PKI Audit Logs To CloudWatch
How To Enable Log Export in EZCA Portal
-
Go to the EZCA Portal.
-
Click on Settings.
-
Expand your subscription’s Advanced Settings.
-
Enable the Send Audit Logs to SIEM option.
How To Configure CloudWatch Logs in the CloudWatch Portal
-
Open your CloudWatch Portal in a new browser tab.
-
In the top right corner, locate your AWS Region and make a note of it.
-
From the left-hand menu, under Setup, click on Settings.
-
Go to the Logs tab. In the API Keys section, click Create.
-
Choose your preferred API key expiration, then click Generate.
-
After the key is generated, copy and save it immediately. You will not be able to view it again after leaving this page.
-
Navigate to Log Management under Logs in the left-hand menu. Select the Log Group where you want to deliver your logs.
-
Click the Actions dropdown, then select Edit bearer token authentication.
-
When prompted, enable bearer token authentication by selecting Yes.
-
Confirm that bearer token authentication is enabled.
-
Identify and note the log stream where you want your logs delivered.
How To Configure the CloudWatch SIEM in EZCA Portal
-
Go back to the EZCA tab.
-
From the SIEM Provider dropdown, select CloudWatch.
-
Select your AWS Region, then enter your Log Group, Log Stream, and the API key you generated as the Bearer Token. Then click Test Connection. This sends a test log to your CloudWatch log stream (allow a few minutes for it to show up).
-
If the connection test succeeds, scroll up and click Save Changes to apply your SIEM configuration.
-
Done! EZCA will now send your audit logs to Amazon CloudWatch.
How To Create Alerts in CloudWatch to Monitor Your Cloud PKI Activity
We recommend setting up alerts for any high criticality event, and closely monitor medium and low events. To setup alerts in CloudWatch go to Actions -> Create metric filter within your log group. Here are some example filters to get you started:
Certificate Request Denied (Event ID 4888)
Certificate request denied is an event that is created when a user requests a certificate that they do not have permission to request. It is important to alert on this event since it can be an attacker attempting to escalate privileges by requesting a certificate.
{ $.event.EventID = 4888 && $.source = "EZCA" }
CA Permission Changed (Event ID 4882)
CA Permission Changed is an event that is created when a user changes the security permissions for a CA. This event should be monitored since it is a low frequency high impact action that could indicate a compromise to your PKI administrator’s accounts.
{ $.event.EventID = 4882 && $.source = "EZCA" }
CA Changes Denied (Event ID 92)
CA Permission Denied is an event that is created when a user attempts to change the security permissions for a CA without having the proper security permissions. It is important to alert on this event since it can be an attacker attempting to escalate privileges by changing the security configuration of your certificate authority.
{ $.event.EventID = 92 && $.source = "EZCA" }
Deleted CA (Event ID 19)
CA Deleted is an event that is created when a user deletes a CA. This event should be monitored since it is a low frequency high impact action that could indicate a compromise to your PKI administrator’s accounts.
{ $.event.EventID = 19 && $.source = "EZCA" }
What Logs are Sent to CloudWatch?
EZCA sends the following log types to your SIEM:
CA Operation Events
| Event ID | Event Summary | Description | Potential Criticality |
|---|---|---|---|
| 4882 | The security permissions for Certificate Services changed | A change in CA settings that might give or remove critical permissions | High |
| 92 | CA change denied due to insufficient permissions | A user attempted to change CA settings without the proper permissions | High |
| 23 | Intermediate CA request rejected | A new Intermediate CA request has been rejected | High |
| 19 | CA deleted | This indicates that a CA was deleted | High |
| 28 | Intermediate CA was imported | A new Intermediate CA has been created chaining to an external CA | Medium |
| 22 | Intermediate CA created with EZCA Root | A new Intermediate CA has been created chaining to an EZCA CA | Medium |
| 12 | CA was renewed | A CA has been renewed | Low |
Certificate Operation Events
| Event ID | Event Summary | Description | Potential Criticality |
|---|---|---|---|
| 4888 | Certificate request denied due to insufficient permissions | A user attempted to request a certificate without the proper permissions | High |
| 4870 | A certificate has been revoked | This can cause an outage if it was done by mistake or the new certificate is not added to all the endpoints that use the certificate | Medium |
| 4872 | Publish CRL | This is an event that the CRL has been published, this does not have to be tracked as we take care of it for you. | Low |
| 4887 | Certificate was created | This event indicates a certificate was created successfully | Low |