웹 소스(SpringPetClinic)를 대상으로 SCA, DAST 로컬 실습한 과정을 정리했다.
AWS 아키텍처

아키텍처와 같이 본래에는 전체 파이프라인을 통합하는 것이 목표였으나, 결과적으로 통합은 못하고 로컬 실습만 완료하였다.
SCA - Trivy
Trivy는 컨테이너 이미지, 파일 시스템, IaC 설정의 보안 취약점을 분석하는 오픈소스 보안 스캐너이다.
이미지에 포함된 OS 패키지와 라이브러리의 CVE 취약점을 탐지하며, CI/CD 파이프라인에 연동해 배포 전에 보안 검사를 자동으로 수행할 수 있다.
1. Docker Desktop 설치
컨테이너 환경에서 실행하기 위해 Docker Desktop을 설치한다.
Docker Desktop: The #1 Containerization Tool for Developers | Docker
Docker Desktop: The #1 Containerization Tool for Developers | Docker
Docker Desktop is collaborative containerization software for developers. Get started and download Docker Desktop today on Mac, Windows, or Linux.
www.docker.com

2. Trivy 설치
# Trivy 이미지 설치
docker pull aquasec/trivy:latest
# Trivy를 운영체제에 직접 설치
sudo snap install trivy
# GitHub에서 HTML 보고서용 템플릿 파일 다운로드 (trivy-html.tpl)
wget https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/html.tpl -O trivy-html.tpl
# 오픈 소스 (Spring-PetClinic) 스캔 및 html 템플릿으로 반환
trivy fs /mnt/c/Users/PCuser/spring-petclinic --format template --template "@trivy-html.tpl" --output /mnt/c/Users/PCuser/OneDrive/바탕\ 화면/trivy-report.html

DAST(OWASP ZAP)
OWASP ZAP에 대한 자세한 설명과 설치 과정은 다음 포스트를 참고
https://luckyd8.tistory.com/29
OWASP ZAP 설치 및 사용법(Active Scan)
OWASP ZAP의 설치 방법과 Acrive Scan을 사용법을 알아보겠습니다. OWASP ZAP(Zed Attack Proxy)은 웹 애플리케이션의 보안 취약점을 찾는 데 사용되는 무료 오픈 소스 웹 애플리케이션 보안 스캐너입니다.1. O
luckyd8.tistory.com
