This rule ensures EC2 instances are properly managed by AWS Systems Manager.
Rule | EC2 instances should be managed by AWS Systems Manager |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ High |
Rule Description:
According to the NIST Cybersecurity Framework (CSF) v1, EC2 instances should be managed by AWS Systems Manager. AWS Systems Manager provides centralized visibility and control over your EC2 instances, helping you to maintain security and compliance.
By managing your EC2 instances with AWS Systems Manager, you can ensure that security patches and updates are regularly applied, enable centralized logging and monitoring, and enable compliance controls.
Troubleshooting Steps:
In case you encounter any issues while managing EC2 instances with AWS Systems Manager, you can follow these troubleshooting steps:
Check IAM Roles: Ensure that the EC2 instances have the necessary IAM roles attached to enable communication with AWS Systems Manager. Verify that the instance IAM role has the appropriate permissions to interact with Systems Manager.
Check Instance Connectivity: Make sure that the EC2 instances have proper network connectivity to reach AWS Systems Manager. Verify that the instances are in the correct subnet and have a route to the Systems Manager service.
Verify Systems Manager Agent: Confirm that the Systems Manager agent is installed and running on the EC2 instances. Check the agent version and ensure it is up to date.
Review Systems Manager Logs: Check the Systems Manager logs for any error messages or issues. The logs can provide insights into any failures or misconfigurations.
Necessary Codes:
In order to manage EC2 instances with AWS Systems Manager, you need to define appropriate IAM roles and attach them to the instances. Here is an example of how to create IAM roles using AWS CLI:
Create an IAM role for Systems Manager:
aws iam create-role --role-name MySystemsManagerRole --assume-role-policy-document file://trust-policy.json
Attach necessary policies to the role:
aws iam attach-role-policy --role-name MySystemsManagerRole --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
Associate the IAM role with the EC2 instance:
aws ec2 associate-iam-instance-profile --instance-id $INSTANCE_ID --iam-instance-profile Name=MySystemsManagerRole
Replace
$INSTANCE_ID
with the actual ID of your EC2 instance.Step-by-step Guide for Remediation:
To manage EC2 instances with AWS Systems Manager, follow these step-by-step instructions:
Create an IAM role for Systems Manager:
Attach necessary policies to the role:
Associate the IAM role with the EC2 instance:
Once these steps are completed, the EC2 instance will be managed by AWS Systems Manager. You can utilize Systems Manager features such as patch management, automation, and Run Command to maintain security and compliance.