티스토리 뷰
AWS Security Token Service(STS) 는 임시적인 제한된 credential을 제공하기 위해서 사용되며 IAM user혹은 Federated User을 위해서 사용된다.
사용이 필요한 이유와 use cases.
1) 코드 안에 embed token이 필요없다.
2) lifetime을 제한할 수 있으며 15분에서 36시간 까지 가능하다.
3) Identity federation 회사 AD, Web, Google, Facebook 접속을 가능하게 한다.
4) EC2 instance의 앱에서 접근이 가능하게 한다.
세팅
Step1
IAM User를 만든다.
Access Type으로는 Programmatic access만 체크를 하면 되며 여기서는 특정 그룹이나 policy를 붙이지 않아도 된다.
Step2
Roles을 만들고 두번째인 Another AWS account을 선택한다.
Policy를 붙인다. (AmazonS3ReadOnlyAccess)
Review and create role
Step3:
Trust Relationships 탭으로 가서
The current trust relation only allow root account to assume this role
Modify it with the arn of the user(myteststsuser) we have just created
Step4
Add inline policy to the user we have created
Service: STS
Action: AssumeRole
Resource: ARN of the role we created earlier
This is making our user assume the role
Step5:
Testing
$ aws configure --profile ststestprofile
AWS Access Key ID [None]: XXXXXXXX
AWS Secret Access Key [None]: XXXXXX
Default region name [None]: us-west-2
Default output format [None]: json
Also, export this profile for the time being
$ export AWS_PROFILE=ststestprofile
아래와 같은 코드를 통해서 access key id, access key, token값을 얻어낸다. 아래서 expiration date가 있는 것을 확인하자.
$ aws sts assume-role --role-arn arn:aws:iam::XXXXXX:role/sts-s3-read-only --role-session-name "mytestsession"
{
"AssumedRoleUser": {
"AssumedRoleId": "XXXXXXX:mytestsession",
"Arn": "arn:aws:sts::XXXXXXX:assumed-role/sts-s3-read-only/mytestsession"
},
"Credentials": {
"SecretAccessKey": "XXXXXXX",
"SessionToken": "XXXXXXX",
"Expiration": "2018-12-18T06:47:21Z",
"AccessKeyId": "XXXXXXXXX"
}
}
export가 된 아래 값을 확인하고, 아래 같은 temporary한 키값으로 여길 수 있다.
export AWS_ACCESS_KEY_ID="XXXXXXX"
export AWS_SECRET_ACCESS_KEY="XXXXXXX"
export AWS_SECURITY_TOKEN="XXXXXXX"
Try to access S3 bucket
$ aws s3 ls
2018-12-13 20:53:05 mytestXXXXXX
OR
$ aws s3 cp bucketest s3://mytestXXXXXX
upload failed: ./bucketest to s3://mytestXXXXXX/bucketest An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
- Total
- Today
- Yesterday
- ORACLE 트러블 슈팅(성능 고도화 원리와 해법!)
- directory copy 후 startup 에러
- 우분투
- Oracle
- 버쳐박스
- 오라클 홈디렉토리 copy 후 startup 에러
- MSA
- ubuntu
- 코로나19
- 5.4.0.1072
- [오라클 튜닝] sql 튜닝
- 테라폼
- 오라클
- (InstantClient) 설치하기(HP-UX)
- 트리이스
- 앤시블
- [오라클 튜닝] instance 튜닝2
- CVE 취약점 점검
- 쿠버네티스
- 커널
- 오라클 인스턴트클라이언트(InstantClient) 설치하기(HP-UX)
- 오라클 트러블 슈팅(성능 고도화 원리와 해법!)
- 여러서버 컨트롤
- 튜닝
- pod 상태
- K8s
- 스토리지 클레스
- startup 에러
- 키알리
- 설치하기(HP-UX)
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |