Skip to Content
Asterrr's Handbook
Service cheat sheets

Application integration services

SNS and Step Functions in security automation, with encryption, key policy and workflow type facts.

SNS fans a message out to many subscribers. Step Functions runs a multi-step workflow with retries and branching. In security designs EventBridge matches a finding, SNS alerts people and Step Functions drives the response.

findingalertstarttaskfanoutencryptencryptGuardDutyEventBridge ruleSNS topicStep FunctionsLambda isolateSQS queueKMS key
A finding reaches EventBridge. One rule alerts through SNS and starts a Step Functions workflow that contains the instance. Customer managed KMS keys encrypt both services.

Service table

ServiceWhat it isExam factSecurity controls
Amazon SNSPub/sub topics with fanout to SQS, Lambda, HTTP/S, email and moreSSE encrypts only the message body. Subject, message attributes, topic name and metrics stay readableSSE with a symmetric KMS key. Topic policies and IAM. Requests to an SSE topic must use HTTPS and Signature V4. Message data protection scans and audits payloads. CloudTrail
AWS Step FunctionsState machine workflows written in Amazon States LanguageStandard runs up to one year, exactly-once. Express runs up to five minutesAlways encrypted at rest with an AWS owned key. Optional customer managed key adds a second layer. Execution role limits what each state can call. CloudWatch Logs and CloudTrail

SNS encryption rules

  • A message is encrypted only if it was sent after SSE was enabled. Backlogged messages stay as they were.
  • Only symmetric encryption KMS keys work. You can use the AWS managed key alias/aws/sns or your own key.
  • Publishers need kms:GenerateDataKey* and kms:Decrypt on the key plus sns:Publish on the topic.
  • AWS services that publish to an encrypted topic need a customer managed key whose key policy allows the service principal. Examples are CloudWatch, S3, Inspector and the events principal. A few sources, such as Config and Auto Scaling, need an IAM role in the key policy instead.
  • Do not add aws:SourceArn or aws:SourceAccount conditions to a key policy for EventBridge publishing to an encrypted topic. That form is not supported.

Exam trap

A CloudWatch alarm or S3 event cannot publish to a topic encrypted with the AWS managed alias/aws/sns key. The fix is a customer managed key that grants the service principal kms:GenerateDataKey* and kms:Decrypt.

Step Functions details

ItemStandardExpress
Maximum durationOne yearFive minutes
Execution modelExactly-onceAsynchronous is at-least-once. Synchronous is at-most-once
HistoryQueryable through the API for 90 daysNot kept by the service. Turn on CloudWatch Logs
Billing basisState transitionsExecutions, duration and memory
.sync and .waitForTaskToken patternsSupportedNot supported
FitsNon-idempotent steps such as payments or starting a clusterHigh-volume idempotent processing

Customer managed key behavior.

  • The key encrypts the state machine definition and execution history. An activity key encrypts activity input.
  • The key policy needs kms:DescribeKey and kms:GenerateDataKey for whoever creates the state machine. The execution role needs kms:Decrypt and kms:GenerateDataKey.
  • Data key reuse can be set from 60 to 900 seconds. The default is 300.
  • Step Functions passes an encryption context holding the state machine ARN. Use it in conditions to scope the key to one workflow.
  • If the key is disabled or deleted, running executions fail and new ones cannot start.
  • With a customer managed key, EventBridge execution status events omit input, output, error and cause.
  • Do not put a kms:ViaService condition on an execution role. It can stop executions.

Exam signal

"Automated, auditable, multi-step remediation with retries and human approval" is Step Functions Standard. "Notify several systems at once about the same finding" is SNS fanout.

GuardDuty shows the EventBridge response pattern in full. Compute services covers the Lambda target.

Further reading

On this page