In todayโs fastโmoving cloud environments, maintaining continuous compliance is as important as preventing breaches. AWS Security Hub aggregates findings from multiple services and scores your account against bestโpractice standards, making it a vital dashboard for security leaders. One of the recurring findings that appears even in accounts that have never touched Systems Manager Automation is the SSM.6 control, which flags missing CloudWatch Logs integration for aws:executeScript actions. This might seem like a minor configuration tweak, but it has outsized implications for auditability, incident response, and overall trust in automation pipelines. Understanding why this control exists, and what it protects, helps teams prioritize remediation without getting lost in the noise of hundreds of other findings.
Systems Manager Automation (often referred to simply as Automation) is the engine that lets you codify operational tasks into reusable Runbooks. These Runbooks orchestrate everything from patching EC2 instances to modifying IAM policies, and they can embed custom logic via the aws:executeScript action. When you invoke aws:executeScript, you can run Python, PowerShell, or shell scripts directly within the Automation workflow, capturing the output of those scripts as part of the Runbook execution. Without CloudWatch Logs enabled, the stdout and stderr from those scripts vanish into the ether once the Runbook finishes, leaving you with only a success/failure status and no visibility into what actually happened inside the script.
The SSM.6 control evaluates a single accountโlevel setting: whether the option to send aws:executeScript output to a CloudWatch Logs log group is turned on. By default, this setting is disabled for every AWS account and region, which means that as soon as you enable Security Hub in a region, the control will failโeven if you have never executed a single Automation Runbook. This design choice is intentional; it forces teams to consciously decide where they want automation output persisted, preventing accidental log sprawl while ensuring that any intentional automation is traceable.
Missing logs create a blind spot that can be costly during audits or security investigations. Imagine a scenario where an Automation Runbook unintentionally terminates a production database because of a typo in a variable. If logging is disabled, investigators have no way to see the exact script lines that ran, the values of variables at runtime, or any error messages that might have hinted at the mistake. Likewise, if a malicious actor gains access to an IAM role that can start Automation, they could embed harmful scripts in a Runbook and execute them without leaving a trace, making attribution and impact analysis extremely difficult.
While the security imperative is clear in production, there are legitimate reasons to leave the setting disabled in sandbox or development accounts. CloudWatch Logs ingestion carries a costโboth for data ingested and for storage retentionโso teams that run frequent, highโvolume Automation experiments may prefer to avoid unexpected charges. In such environments, the tradeโoff between visibility and expense can be justified, provided that the team documents the risk and ensures that any automation that could affect production is still tested in a logged, stagingโlike account before promotion.
Remediation begins with confirming the current state. Log into the AWS Management Console, navigate to Systems Manager โ Automation โ Settings (the gear icon in the upperโright of the Automation dashboard). Here you will see a toggle labeled โSend output to CloudWatch Logsโ. If it is grayed out or unchecked, the control will fail. Take note of the region displayed at the top of the console, because this setting is regionโspecific; you must repeat the check for each region where Security Hub is active.
To enable the setting via the console, simply click the toggle so it turns blue, then select a CloudWatch Logs log group where you want the Automation output to reside. You can either choose an existing log group or create a new one directly from the dropdown. After selecting the log group, click โSaveโ. The console will immediately update the setting, and Security Hub will reโevaluate the control during its next periodic scanโtypically within 30 minutes.
If you prefer automation or need to apply the change across many accounts, the AWS CLI offers a straightforward approach. First, ensure you have the latest version of the AWS CLI installed and that you have permission to put the SSM service setting. The command to enable CloudWatch Logs for Automation in a given region looks like this:
“`bash
aws ssm update-service-setting \
–setting-id arn:aws:ssm:${AWS_REGION}:${ACCOUNT_ID}:settings/automation/script-output/logging \
–setting-value {“isEnabled”:true,”logGroupName”:”automation-script-output”}
“`
Replace `${AWS_REGION}` and `${ACCOUNT_ID}` with your target values, and adjust the log group name as needed. If the log group does not yet exist, you can create it beforehand with `aws logs create-log-group –log-group-name automation-script-output –region ${AWS_REGION}`.
Enabling the toggle is only half the battle; the IAM principal that runs the Automation must also have permission to write logs to the chosen log group. The required permissions are `logs:CreateLogStream`, `logs:PutLogEvents`, and optionally `logs:DescribeLogStreams` for debugging. If you are using AWSโmanaged Runbooks, ensure that the serviceโlinked role for Systems Manager (AmazonSSMAutomationRole) includes these policies. For custom Runbooks, edit the IAM role assumed by the Automation (often called the AssumeRole) and attach an inline policy like:
“`json
{
“Version”: “2012-10-17”,
“Statement”: [
{
“Effect”: “Allow”,
“Action”: [
“logs:CreateLogStream”,
“logs:PutLogEvents”
],
“Resource”: “arn:aws:logs:${REGION}:${ACCOUNT_ID}:log-group:/aws/ssm/automation-script-output:*”
}
]
}
“`
Without these permissions, the setting will appear enabled in the console, but script output will never reach CloudWatch Logs, causing a false sense of security.
After you have applied the setting and verified the IAM permissions, it is wise to run a quick validation. Choose a simple Runbook that includes an aws:executeScript stepโperhaps one that prints “Hello Automation” and exits. Execute the Runbook, then navigate to CloudWatch Logs, locate the log group you specified, and check for a new log stream named after the Runbook execution ID. Inside that stream you should see the scriptโs stdout and stderr. Seeing the expected output confirms that the endโtoโend pipeline is working: the Automation service can invoke the script, capture its output, and deliver it to the log group where auditors and analysts can later retrieve it.
Because the SSM.6 control is evaluated per accountโperโregion, organizations with a multiโregion footprint must treat each region as a separate remediation task. Start by exporting a list of regions where Security Hub is enabled (e.g., via `aws account list-regions –opt-in-status ENABLED BY DEFAULT`). Then iterate over that list, applying the CLI command or console steps for each region. Communicate the plan to stakeholders early: explain that the change is lowโrisk, does not affect running Automation jobs, and is primarily an auditing enhancement. Provide a rollback procedure (simply disabling the toggle) in case any unforeseen cost concerns arise.
In summary, turning on CloudWatch Logs for SSM Automation is a small configuration change that yields outsized benefits for security governance, incident response, and compliance assurance. It transforms opaque automation runs into auditable events, enabling teams to answer critical questions like “What did the script actually do?” and “Did any unexpected errors occur?” While there may be cost considerations in nonโproduction accounts, the risk of operating without visibility far outweighs the modest logging expense in most production workloads. Take the action now: verify the setting per region, enable it with appropriate IAM permissions, validate with a test Runbook, and document the change in your runโbook of security hygiene practices. Your Security Hub score will improve, and your ability to trust and investigate Automation will be dramatically strengthened.