aws sap 문제 풀이 4주차 문제풀이 1번

aws, sap, March 19, 2023

문제

질문 63

A company has several development teams using AWS CodeCommit to store their source code. With the number of code updates every day, the management is having difficulty tracking if the developers are adhering to company security policies. On a recent audit, the security team found several IAM access keys and secret keys in the CodeCommit repository. This is a big security risk so the company wants to have an automated solution that will scan the CodeCommit repositories for committed IAM credentials and delete/disable the IAM keys for those users. Which of the following options will meet the company requirements?

회사에는 AWS CodeCommit을 사용하여 소스 코드를 저장하는 여러 개발 팀이 있습니다. 매일 코드가 업데이트되는 횟수로 인해 경영진은 개발자가 회사 보안 정책을 준수하고 있는지 추적하는 데 어려움을 겪고 있습니다. 최근 감사에서 보안 팀은 CodeCommit 리포지토리에서 여러 IAM 액세스 키와 비밀 키를 발견했습니다. 이것은 큰 보안 위험이므로 회사는 CodeCommit 리포지토리에서 IAM 자격 증명을 스캔하고 해당 사용자의 IAM 키를 삭제/비활성화하는 자동화된 솔루션을 원합니다.

다음 중 회사 요구 사항을 충족하는 옵션은 무엇입니까?

  1. Scan the CodeCommit repositories for IAM credentials using Amazon Macie. Using machine learning, Amazon Macie can scan your repository for security violations. If violations are found, invoke an AWS Lambda function to notify the user and delete the IAM keys.

Amazon Macie를 사용하여 CodeCommit 리포지토리에서 IAM 자격 증명을 스캔합니다. Amazon Macie는 기계 학습을 사용하여 보안 위반이 있는지 리포지토리를 스캔할 수 있습니다. 위반이 발견되면 AWS Lambda 함수를 호출하여 사용자에게 알리고 IAM 키를 삭제합니다.

  1. Write a custom AWS Lambda function to search for credentials on new code submissions. Set the function trigger as AWS CodeCommit push events. If credentials are found, notify the user of the violation, and disable the IAM keys.

새 코드 제출에서 자격 증명을 검색하는 사용자 지정 AWS Lambda 함수를 작성합니다. 함수 트리거를 AWS CodeCommit 푸시 이벤트로 설정합니다. 자격 증명이 발견되면 사용자에게 위반 사실을 알리고 IAM 키를 비활성화합니다.

  1. Using a development instance, use the AWS Systems Manager Run Command to scan the AWS CodeCommit repository for IAM credentials on a daily basis. If credentials are found, rotate them using AWS Secrets Manager. Notify the user of the violation.

개발 인스턴스를 사용하여 AWS Systems Manager Run Command를 사용하여 매일 AWS CodeCommit 리포지토리에서 IAM 자격 증명을 검색합니다. 자격 증명이 발견되면 AWS Secrets Manager를 사용하여 교체합니다. 사용자에게 위반 사실을 알립니다.

  1. Download and scan the source code from AWS CodeCommit using a custom AWS Lambda function. Schedule this Lambda function to run daily. If credentials are found, notify the user of the violation, generate new IAM credentials and store them in AWS KMS for encryption.

사용자 지정 AWS Lambda 함수를 사용하여 AWS CodeCommit에서 소스 코드를 다운로드하고 스캔합니다. 매일 실행되도록 이 Lambda 함수를 예약합니다. 자격 증명이 발견되면 사용자에게 위반 사실을 알리고 새 IAM 자격 증명을 생성한 다음 암호화를 위해 AWS KMS에 저장합니다.

풀이 및 공부

codecommit 그냥 github, gitlab 같은 git 플랫폼(?) 이라고 생각하면 됨.

1번

AWS Macie ?

머신 러닝 기술을 활용해 민감한 데이터를 탐지하는 서비스

콘솔에서 한 번 보면 기억이 잘 난다.

Get started 클릭

S3 버킷의 정보가 요약해서 한눈에 보인다.

S3 buckets를 선택해서 들어가면 버킷 별 요약정보도 볼 수 있다

민감한 데이터 검사를 위해 job을 만들어보자.

버킷 선택

job 생성하는 화면

여기서 sampling depth는 전체 object를 다 검사하는 것이 아니라 일부 object만 검사해서 랜덤체크 같은 것을 할 때 유용하다고 한다.

그다음은 identifier는 정한다.

identifier가 이 서비스의 핵심인것 같다.

email, credit card, employee_id 뭐 이런 식별자를 정할 수 있다.

아래 사진의 identifier를 만드는 화면을 보면 바로 이해할 수 있다.

regex, keywords, ignore words 이런 것들로 식별자를 만들 수 있네.

개인적으로 위에 이 identifier를 만드는 화면을 보니 이 서비스가 무엇인지 바로 이해할 수 있었다.

식별자를 선택하고 넘어간다.

job 이름을 지정하고 다음으로 넘어간다.

review하고 submit

Finding은 job의 result라고 보면된다.

버킷별로도 볼 수 있다.

2번

람다 콘솔안에서 trigger 클릭

codecommit service를 선택하면 아래 detail한 설정을 할 수 있다.

이처럼 람다 서비스는 여러 서비스와 trigger 형태로 꼽아서 쓰기 좋다.

참고

  • https://www.youtube.com/watch?v=8piwEQJJXdo

Comments