aws-stepfunctions-tasks: Add IAM policy condition to the auto-generated IAM policy document #29944
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the feature
We have been setting up a new AWS account that uses EventBridge with step functions. While using
EventBridgePutEvents
state to directly emit events from the state machines, we notice that it will automatically create an IAM policy withevents:putEvents
action and the specifiedeventBus
in props.In our setup we wanted to add an additional IAM policy condition on
events:source
key to ensure each state machine is allowed to act as that source. That's to have better integrity over who can put what events on the shared event bus.Use Case
Have control over the auto-generated IAM policies of step functions state constructs.
This ensures that even if the step functions object is tinkered with intentionally or unintentionally, it won't be able to emit events as any other source. As long as the IAM policy is restricting it.
This will allow us to monitor IAM policies, create verification aspects on them, etc.
Proposed Solution
Add an extra property in
EventBridgePutEventsProps
or even the parentTaskStateBaseProps
called conditions. Then when constructing the state, use can pass additional conditions if needed.Other Information
The alternative we have been using is doing this through a lambda function which has this policy configured manually. So it would be step functions has lambda:invoke policy, lambda as events:putEvents policy with the source condition.
Acknowledgements
CDK version used
2.133.0
Environment details (OS name and version, etc.)
The text was updated successfully, but these errors were encountered: