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.
Service table
| Service | What it is | Exam fact | Security controls |
|---|---|---|---|
| Amazon SNS | Pub/sub topics with fanout to SQS, Lambda, HTTP/S, email and more | SSE encrypts only the message body. Subject, message attributes, topic name and metrics stay readable | SSE 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 Functions | State machine workflows written in Amazon States Language | Standard runs up to one year, exactly-once. Express runs up to five minutes | Always 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/snsor your own key. - Publishers need
kms:GenerateDataKey*andkms:Decrypton the key plussns:Publishon 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:SourceArnoraws:SourceAccountconditions 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
| Item | Standard | Express |
|---|---|---|
| Maximum duration | One year | Five minutes |
| Execution model | Exactly-once | Asynchronous is at-least-once. Synchronous is at-most-once |
| History | Queryable through the API for 90 days | Not kept by the service. Turn on CloudWatch Logs |
| Billing basis | State transitions | Executions, duration and memory |
.sync and .waitForTaskToken patterns | Supported | Not supported |
| Fits | Non-idempotent steps such as payments or starting a cluster | High-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:DescribeKeyandkms:GenerateDataKeyfor whoever creates the state machine. The execution role needskms:Decryptandkms: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:ViaServicecondition 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.
Related
GuardDuty shows the EventBridge response pattern in full. Compute services covers the Lambda target.
Further reading
- https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
- https://docs.aws.amazon.com/sns/latest/dg/sns-key-management.html
- https://docs.aws.amazon.com/sns/latest/dg/sns-security.html
- https://docs.aws.amazon.com/step-functions/latest/dg/choosing-workflow-type.html
- https://docs.aws.amazon.com/step-functions/latest/dg/encryption-at-rest.html
- https://docs.aws.amazon.com/step-functions/latest/dg/security.html