Description | This article describes step-by-step instructions on how to configure the AWS CloudWatch Agent on an EC2 instance to send logs to CloudWatch, which FortiSIEM can then pull via the AWS CloudWatch method. |
Scope | FortiSIEM. |
Solution |
Pre-requisites:
Log into the EC2 instance and run the following:
sudo yum install amazon-cloudwatch-agent
Launch the configuration wizard:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard Below are all non-default options that can be selected as required:
Using the last option will create a JSON file like the following:
{
If configuration was saved as a file (e.g. file_config.json), use:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \ -a fetch-config -m ec2 \ -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/file_config.json -s
Check that the agent is running:
sudo systemctl status amazon-cloudwatch-agent
Check logs:
sudo tail -f /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log
Ensure log files are accessible by the cwagent user:
sudo -u cwagent tail /var/log/audit/audit.log
Modify the file or directory permission (chmod) or ACLs. Ensure logs are not restricted to root-only access.
Make sure that the instance has been attached with the IAM role with attached policy which requires for the instances to fetch the data from cloudwatch stream logs if that doesn't have it don't have the right to call other aws services.
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a status
fsm740 phAgentManager[1165131]: [PH_AGENTMGR_UPDATE_AGENT]:[eventSeverity]=PHL_INFO,[procName]=phAgentManager,[fileName]=phAwsFlowLogAgent.cpp,[lineNumber]=112,[phLogDetail]=Update phAwsFlowLogAgent agent for Account: 1234, LogGroupName: /fortisiem/audit, LogStreamName: FortiSIEM-test-logs fsm740 phAgentManager[1165131]: [PH_JOB_STAT]:[eventSeverity]=PHL_INFO,[procName]=phAgentManager,[fileName]=phJobExecuteStatus.cpp,[lineNumber]=235,[jobId]=4567404,[jobType]=2,[jobDetail]=Success,[hostIpAddr]=52.239.28.85,[hostName]=amazon.com,[jobName]=AWS_CLOUDWATCH,[jobDesc]=AWS Flow log Pull,[jobStatus]=0,[pollIntv]=300,[eventTime]=1756726952,[phLogDetail]= See the screenshot below for AWS-Ec2-Integration:
Ensure that the EC2 instance has an attached IAM role with the minimum required permissions as per FortiSIEM DOC. Without these, CloudWatch Agent will not be able to send logs or FortiSIEM will not be able to pull them. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.