This rule ensures the presence of log metric filter and alarm for unauthorized API calls.
Rule | Ensure a log metric filter and alarm exist for unauthorized API calls |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ Low |
Rule Description:
This rule ensures that a log metric filter and alarm exist to detect unauthorized API calls, based on the requirements of the NIST Cybersecurity Framework (CSF) v1. The CSF is a set of guidelines and best practices designed to improve the cybersecurity posture of organizations.
Troubleshooting Steps:
If the log metric filter and alarm for unauthorized API calls are not properly configured, here are a few troubleshooting steps to resolve the issue:
Necessary Code:
The following is an example CloudFormation template code snippet to create a log metric filter and alarm for unauthorized API calls. Modify the code as per your AWS CloudFormation configuration:
Resources:
LogMetricFilter:
Type: AWS::Logs::MetricFilter
Properties:
LogGroupName: /aws/apigateway/{your-log-group-name}
FilterPattern: '{your-filter-pattern}'
MetricTransformations:
- MetricName: UnauthorizedApiCalls
MetricNamespace: NIST/CSF
MetricValue: '1'
UnauthorizedApiCallsAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: UnauthorizedApiCallsAlarm
AlarmDescription: Unauthorized API Calls Alarm
MetricName: UnauthorizedApiCalls
Namespace: NIST/CSF
Statistic: SampleCount
Period: 300
EvaluationPeriods: 1
Threshold: 1
ComparisonOperator: GreaterThanOrEqualToThreshold
AlarmActions:
- arn:aws:sns:us-east-1:1234567890:your-sns-topic
AlarmDescription: Unauthorized API Calls Alarm
Dimensions:
- Name: LogGroupName
Value: /aws/apigateway/{your-log-group-name}
Note: Replace the placeholders
{your-log-group-name}
, {your-filter-pattern}
, and arn:aws:sns:us-east-1:1234567890:your-sns-topic
with your actual values.Remediation Steps:
Follow these steps to remediate the rule violation and ensure the log metric filter and alarm are in place for unauthorized API calls:
By following these steps, you will successfully implement the log metric filter and alarm for unauthorized API calls in accordance with the NIST Cybersecurity Framework (CSF) v1.