A deploy role that can become admin
The CI role looks scoped to deploys, but one statement lets it hand any role to a new EC2 instance. Read the policy versions with the AWS CLI and find the escalation path.
- Terminal mission
- Advanced
- 4 questions
- 0 of 4 solved
Your goal
Your goalTrace how a deploy role could launch a server with full admin rights.
An access review flagged the ci-deploy role as "possibly over-privileged". You have read-only IAM access.
iam:PassRole lets a principal attach a role to a service, such as an EC2 instance profile. Combined with ec2:RunInstances on any resource, a CI job could start an instance with the admin role and use its credentials.
What’s on screen
- Briefing
- the story: what happened and what evidence you were handed.
- Terminal
- the dark box. It is a pretend Linux shell that runs in your browser. Type a command and press Enter. Nothing you type touches a real system.
- Walkthrough
- the numbered path. Each step says what to type and what you should see. Hints open one at a time.
- Answer boxes
- under each question step. Type what you found and press Check.
Words to know
- CI
- continuous integration, the server that builds and tests code
- EC2
- Amazon Elastic Compute Cloud, virtual machines in AWS
- AWS
- Amazon Web Services
- CLI
- command-line interface
- IAM
- identity and access management, who may do what in a cloud account
cloud-shell · Cloud CLI review
Type help for the command list and objectives for your tasks. Everything runs in this browser.
Up and down arrows walk your history. Ctrl+L clears the screen. Try help, ls, and objectives.
Read first
More in Cloud CLI review
The whole walkthrough
Every step in order: 297 words, about 2 min. It gives away every answer, so try the steps first.