aws / aws/aws-cdk

BastionHost: Use managed policy AmazonSSMManagedInstanceCore

Open
#21,803 1 comment 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-iam effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Hello,

I would like to request that BastionHost uses arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore instead of
https://github.com/aws/aws-cdk/blob/4303dca8ab1f690147d6a64d333118ac90297035/packages/%40aws-cdk/aws-ec2/lib/bastion-host.ts#L193

This would result in reduces privileged (No need to create or delete parameters, windows, associations, etc).

Regards,

### Use Case

Implement least privilege for EC2 instance.

### Proposed Solution

Create role separately similar to
https://github.com/aws-samples/secure-bastion-cdk/blob/main/lib/aws-bastion-ec2-cdk-stack.ts#L44

### Other Information

Alternative solution:
Copying SSMManagedInstanceCorePolicy (may break when new features are added to SSMº

### Acknowledgements

- [X] I may be able to implement this feature request
- [X] This feature might incur a breaking change

### CDK version used

2.39.0

### Environment details (OS name and version, etc.)

OSX

Contributor guide

Open the contributing guide

Research direction

Start in packages/@aws-cdk/aws-ec2/lib/bastion-host.ts at the referenced policy setup, then compare the separate-role approach in aws-samples/secure-bastion-cdk/lib/aws-bastion-ec2-cdk-stack.ts. The change is complete when BastionHost uses arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore while preserving the requested least-privilege behavior and accounting for the possible breaking change.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
authorization, cloud, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.