AWS - Codepipeline Privesc
Reading time: 3 minutes
tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:
HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 Discord 그룹 또는 텔레그램 그룹에 참여하거나 Twitter 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
codepipeline
For more info about codepipeline check:
AWS - DataPipeline, CodePipeline & CodeCommit Enum
iam:PassRole, codepipeline:CreatePipeline, codebuild:CreateProject, codepipeline:StartPipelineExecution
When creating a code pipeline you can indicate a codepipeline IAM Role to run, therefore you could compromise them.
Apart from the previous permissions you would need access to the place where the code is stored (S3, ECR, github, bitbucket...)
I tested this doing the process in the web page, the permissions indicated previously are the not List/Get ones needed to create a codepipeline, but for creating it in the web you will also need: codebuild:ListCuratedEnvironmentImages, codebuild:ListProjects, codebuild:ListRepositories, codecommit:ListRepositories, events:PutTargets, codepipeline:ListPipelines, events:PutRule, codepipeline:ListActionTypes, cloudtrail:<several>
During the creation of the build project you can indicate a command to run (rev shell?) and to run the build phase as privileged user, that's the configuration the attacker needs to compromise:
.png)
.png)
?codebuild:UpdateProject, codepipeline:UpdatePipeline, codepipeline:StartPipelineExecution
It might be possible to modify the role used and the command executed on a codepipeline with the previous permissions.
codepipeline:pollforjobs
이 API가 호출되면, CodePipeline은 파이프라인의 아티팩트를 저장하는 S3 버킷에 대해 해당 액션이 입력 또는 출력 아티팩트에 접근해야 하는 경우 그 S3 버킷에 대한 임시 자격 증명을 반환합니다. 이 API는 또한 해당 액션에 정의된 모든 secret 값을 반환합니다.
tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:
HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 Discord 그룹 또는 텔레그램 그룹에 참여하거나 Twitter 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
HackTricks Cloud