AWS - Datapipeline Privesc
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
For more info about datapipeline check:
AWS - DataPipeline, CodePipeline & CodeCommit Enumiam:PassRole
, datapipeline:CreatePipeline
, datapipeline:PutPipelineDefinition
, datapipeline:ActivatePipeline
Users with these permissions can escalate privileges by creating a Data Pipeline to execute arbitrary commands using the permissions of the assigned role:
After pipeline creation, the attacker updates its definition to dictate specific actions or resource creations:
Note that the role in line 14, 15 and 27 needs to be a role assumable by datapipeline.amazonaws.com and the role in line 28 needs to be a role assumable by ec2.amazonaws.com with a EC2 profile instance.
Moreover, the EC2 instance will only have access to the role assumable by the EC2 instance (so you can only steal that one).
The pipeline definition file, crafted by the attacker, includes directives to execute commands or create resources via the AWS API, leveraging the Data Pipeline's role permissions to potentially gain additional privileges.
Potential Impact: Direct privesc to the ec2 service role specified.
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)