Programming/IaC

[IaC] Terrascan

Hayley Shim 2023. 12. 17. 21:10

안녕하세요. 이번에는 다양한 IaC로 작성한 template의 취약점을 점검해주는 오픈소스로 terrascan을 사용해보겠습니다.

 

Terrascan

Terrascan은 코드형 인프라(Infrastructure as Code)를 위한 정적 코드 분석기입니다. 

  • 잘못된 구성이 있는지 코드형 인프라를 스캔
  • 보안 취약점 및 규정 준수 위반을 탐지
  • 클라우드 네이티브 인프라를 프로비저닝하기 전에 위험 완화
  • 로컬로 실행하거나 CI\CD와 통합할 수 있는 유연성 제공

[참고]

https://github.com/tenable/terrascan

 

GitHub - tenable/terrascan: Detect compliance and security violations across Infrastructure as Code to mitigate risk before prov

Detect compliance and security violations across Infrastructure as Code to mitigate risk before provisioning cloud native infrastructure. - GitHub - tenable/terrascan: Detect compliance and securit...

github.com

 

 

설치(참고)

$ curl -L "$(curl -s https://api.github.com/repos/tenable/terrascan/releases/latest | grep -o -E "https://.+?_Darwin_x86_64.tar.gz")" > terrascan.tar.gz
$ tar -xf terrascan.tar.gz terrascan && rm terrascan.tar.gz
$ install terrascan /usr/local/bin && rm terrascan
$ terrascan

 

 

설치 후 Scan

간단하게 아래 명령어로 Scan을 할 수 있습니다.

$ git clone https://github.com/tenable/KaiMonkey
...
$ cd KaiMonkey/terraform/aws
$ terrascan scan

 

 

아래와 같이 Summary로 현재 IaC Template의 취약성을 나타내줍니다.