amazon-cloudwatch-agent
Amazon CloudWatch Agent Overview
Secure your stack with a hardened Amazon CloudWatch Agent image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.
The Amazon CloudWatch Agent is a versatile tool designed to collect and export host-level metrics and logs from instances running on Linux or Windows servers. It integrates seamlessly with Amazon CloudWatch, enabling comprehensive monitoring and observability of your infrastructure.
Try It Out
Take the Minimus Amazon CloudWatch Agent image for a test run by creating a configuration file and running the agent.
Create Configuration File
Create a configuration file, for example config.json:
{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "root",
"region": "us-east-1"
},
"metrics": {
"namespace": "CWAgentTest",
"metrics_collected": {
"cpu": {
"resources": ["*"],
"measurement": ["usage_idle"],
"metrics_collection_interval": 60
}
}
}
}Update the region field to match your AWS region (for example us-west-2, eu-west-1, etc.).
Run the CloudWatch Agent
Run the agent and mount the shared credentials file at /home/cwagent/.aws/credentials with the profile AmazonCloudWatchAgent:
docker run --rm \
-e AWS_EC2_METADATA_DISABLED=true \
-v "$HOME/.aws:/home/cwagent/.aws:ro" \
-v "${CONFIG_FOLDER_PATH}/config.json:/etc/cwagentconfig/config.json:ro" \
reg.mini.dev/amazon-cloudwatch-agentReplace ${CONFIG_FOLDER_PATH} with the path to the directory containing your config.json file
Ensure the credentials file includes a profile named AmazonCloudWatchAgent as expected by the agent (ref). Example of a credentials file with the expected structure:
[AmazonCloudWatchAgent]
aws_access_key_id = AKIAEXAMPLE123456
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYThe agent will start collecting metrics according to your configuration and send them to Amazon CloudWatch.
Verify Metrics in CloudWatch
Navigate to the AWS CloudWatch console and check the Metrics section. You should see metrics being collected under the namespace specified in your configuration (e.g., CWAgentTest), such as:
- CPU metrics (usage_idle, etc.)
- System-level metrics based on your configuration
You can also view the agent logs in the Docker container output to verify it's running correctly and sending metrics to CloudWatch.
Technical Considerations
The Amazon CloudWatch Agent image provided by Minimus is a slim, security-hardened alternative to the public image. The images are largely interchangeable, with a few differences as noted below.
Amazon CloudWatch Agent built by Minimus:
- Runs as root to support required functions. The public image runs as root.
- Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.
The Payoff
A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.
- See the risk reduction dashboard for a detailed CVE comparison over the past 30 days.
- Review the compliance report to see the default hardening and security configurations for the image.
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.