Ensure all EC2 instances are managed by AWS Systems Manager for enhanced security and compliance.
Rule | EC2 instances should be managed by AWS Systems Manager |
Framework | FedRAMP Moderate Revision 4 |
Severity | ✔ High |
AWS Systems Manager and FedRAMP Moderate Revision 4 Compliance for EC2 Instances
AWS Systems Manager is a management service that helps you automatically collect software inventory, apply OS patches, create system images, and configure Windows and Linux operating systems. Its relevance to Amazon EC2 instances in the context of FedRAMP Moderate Revision 4 is significant, particularly for organizations operating within or servicing U.S. federal agencies.
Rule Description
Purpose
The objective is to establish a secure and auditable environment by ensuring AWS EC2 instances are managed by AWS Systems Manager, meeting FedRAMP Moderate Revision 4 compliance.
Scope
Requirements
Troubleshooting Steps
1. Verification of SSM Agent Installation
Check whether the AWS Systems Manager Agent is installed on the EC2 instances.
Command:
# For Linux systems sudo systemctl status amazon-ssm-agent # For Windows systems Get-Service -Name "AmazonSSMAgent"
2. Validate IAM Roles and Permissions
Ensure that the EC2 instance has an IAM role attached with the correct permissions for Systems Manager.
3. Network Configuration
Check the security group and network ACLs are not blocking the traffic to and from AWS Systems Manager endpoints.
4. Systems Manager Activation
Verify that the instance has been activated and is visible in the Systems Manager console.
Remediation Guide
Step-by-Step Compliance Enforcement:
Step 1: Attach the Required IAM Role
Create the IAM role with the necessary permissions for Systems Manager.
aws iam create-role --role-name SSMRoleForEC2 --assume-role-policy-document file://TrustPolicyForSSM.json
Attach the policy to the role.
aws iam attach-role-policy --role-name SSMRoleForEC2 --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
Associate the IAM role with the EC2 instances.
aws ec2 associate-iam-instance-profile --instance-id i-1234567890abcdef0 --iam-instance-profile Name=SSMRoleForEC2
Step 2: Install the SSM Agent
For systems not preinstalled with the SSM Agent:
Download and install the SSM Agent.
# For Amazon Linux sudo yum install -y amazon-ssm-agent # For Ubuntu wget https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb sudo dpkg -i amazon-ssm-agent.deb
Start the agent service.
# For Linux systems sudo systemctl start amazon-ssm-agent # For Windows systems Start-Service AmazonSSMAgent
Step 3: Verify EC2 Instance Registration with Systems Manager
aws ssm describe-instance-information --output table
Check the output for your instance ID to confirm it is being managed by Systems Manager.
Step 4: Enforce FedRAMP Compliance Policies
Step 5: Monitor and Log
Enable Amazon CloudWatch and AWS CloudTrail to monitor and log SSM operations for auditing.
Automating Remediation
For automation of processes, AWS Lambda functions and Amazon EventBridge can be used to trigger remediation actions when non-compliant instances are detected.
By following these guidelines, your EC2 instances should be managed in a FedRAMP Moderate Revision 4 compliant manner through AWS Systems Manager. Always ensure you are regularly reviewing AWS and FedRAMP documentation for the latest guidance and policy updates.