SCAP(Security Content Automation Protocol) compliance CentOS
SCAP(Security Content Automation Protocol)을 통해 CentOS를 보안 기준에 맞게 설정하고 자동 점검하기 위한 전반적인 가이드와 상세 절차를 정리해 드립니다. 👇
✅ 1. 주요 툴 설치
CentOS 7 기준으로 다음 명령으로 주요 도구를 설치합니다:
이 명령은 OpenSCAP 스캐너와 SCAP Security Guide(SSG) 정책 콘텐츠를 함께 설치합니다 forums.rockylinux.org+9securityhardening.com+9gist.github.com+9open-scap.org+3open-scap.org+3gist.github.com+3.
🧩 2. SCAP Security Guide 개요
- Red Hat, CentOS, Fedora 등 다양한 OS 지원: SSG에 포함된 정책 파일은 /usr/share/xml/scap/ssg/content/ 경로에 위치합니다 gist.github.com+3open-scap.org+3securityhardening.com+3.
- XCCDF, OVAL, CPE 등 형식으로 보안 기준과 검증 로직을 표현하며, 각 프로필별로 취약성 검사와 자동 보안 조치를 지원합니다 lists.fedorahosted.org+5open-scap.org+5github.com+5.
🔍 3. 기본 SCAP 점검 수행
GUI 방식 (SCAP Workbench)
설치 후:
- scap-workbench 실행 → /usr/share/xml/scap/ssg/content/*.xml 중 하나 선택 → 원하는 프로필 선택 → 스캔 실행 public.cyber.mil+13open-scap.org+13open-scap.org+13.
CLI 방식 (oscap)
--profile xccdf_org.ssgproject.content_profile_stig \
--results results.xml \
--report report.html \
/usr/share/xml/scap/ssg/content/ssg-centos7-ds.xml
CentOS 전용 정책(ssg-centos7-ds.xml)을 명시하여 실행합니다 youtube.com+8securityhardening.com+8gist.github.com+8.
🔧 4. CentOS에서 “Not Applicable” 오류 해결
CentOS에서 SSG 콘텐츠를 사용할 때 일부 항목이 'not applicable' 표시된다면, 이는 RHEL 전용 CPE가 원인이 될 수 있습니다 gist.github.com+1lists.fedorahosted.org+1.
해결 방법:
- CentOS 전용 CPE 사전(XML) 및 OVAL 파일을 준비하고,
- 스캔 시 다음처럼 --cpe 옵션을 지정:
--profile stig \
--cpe /usr/share/xml/scap/ssg/content/ssg-centos7-cpe-dictionary.xml \
/usr/share/xml/scap/ssg/content/ssg-centos7-ds.xml
또는 CentOS COPR(예: openscapmaint/openscap-latest) 저장소를 활성화해 필요한 정책을 자동 설치할 수 있습니다 redhat.com+4gist.github.com+4securityhardening.com+4.
📊 5. 결과 분석 및 대응
- results.xml과 report.html에 점검 결과가 저장됩니다.
- report.html 파일을 브라우저로 열면:
- 어떤 기준이 fail/passed/notapplicable인지
- 자동 복구 스크립트나 Ansible 플레이북은 무엇인지 확인할 수 있습니다 lists.fedorahosted.org+5open-scap.org+5securityhardening.com+5lists.fedorahosted.org+1gist.github.com+1redhat.com.
🎯 6. 정리 및 활용 요약
- openscap + scap-security-guide 설치
- CentOS용 정책 파일 및 CPE 설정 준비
- scap-workbench 또는 oscap xccdf eval을 통한 스캔 수행
- HTML 리포트 확인 및 미진 항목 대응 또는 자동 조치
- 주기적인 재점검으로 보안 유지 관리
아래는 CentOS 서버에 적용할 수 있는 STIG, CIS 등 특정 프로필 설정, Ansible/Bash 자동 보정, 그리고 멀티 서버 환경에서 스캔/보고 자동화 구성에 대한 실전 가이드입니다.
✅ 1. 특정 프로필 설정 예시 (STIG / CIS)
📘 STIG (DISA STIG)
--profile xccdf_org.ssgproject.content_profile_stig \
--results stig-results.xml \
--report stig-report.html \
/usr/share/xml/scap/ssg/content/ssg-centos7-ds.xml
- 결과 확인 후 GUI(scap-workbench) 또는 CLI 기반 보정 수행 github.com+14medium.com+14git.centos.org+14
📘 CIS Benchmark (Level 1 Server)
--profile xccdf_org.ssgproject.content_profile_cis_server_l1 \
--results cis-results.xml \
--report cis-report.html \
/usr/share/xml/scap/ssg/content/ssg-centos7-ds.xml
- CentOS 전용 프로필 존재하지 않으므로 RHEL 기반 사용함
✅ 2. Ansible / Bash 기반 자동 Remediation
🛠 Ansible Playbook 자동 생성 및 실행
- scap-workbench GUI 또는 CLI를 사용해 STIG/CIS 프로필로 스캔
- 다음 명령으로 자동 Playbook 생성:
--fix-type ansible \
--profile stig \
--output remediation-stig.yml \
stig-results.xml
- 생성된 Ansible 플레이북 실행:
- Bash 스크립트 버전도 /usr/share/scap-security-guide/bash/ 경로에 자동 생성 uyuni-project.org+15docs.redhat.com+15medium.com+15youtube.com
✅ 3. 멀티 서버 자동 스캔·보고 구성
A. Ansible 기반 중앙 실행 흐름
- Inventory 파일에 대상 서버 목록 등록 → Playbook 실행 → 결과 수집 자동화 가능
B. Ansible Tower / AWX / Satellite 연동
- Red Hat Satellite 또는 Ansible Automation Platform의 컴플라이언스 기능 활용
- 스케줄 기반 주기적 SCAP 점검 + 중앙집중 보고 🌐 youtube.com
C. Foreman + openscap_client Role
- Foreman/Yum 친화형 theforeman.foreman_scap_client Role 사용하여 agent 설치 → 중앙 정책 배포 + 리포트 redhatgov.io+7community.theforeman.org+7docs.redhat.com+7
D. Uyuni (Spacewalk 오픈소스 버전)
- 무료 중앙화 OpenSCAP 관리
- 정기 스캔 결과 웹 UI 조회 + CSV/PDF 리포트 제공 it.megocollector.com+15uyuni-project.org+15server-world.info+15
🔧 요약 및 권장 구성
기능 | 방법 |
STIG/CIS 스캔 | oscap xccdf eval --profile ... |
자동 보정 (single) | oscap xccdf generate fix --fix-type ansible → Ansible 실행 |
멀티 서버 자동화 | Ansible Tower / AWX / Foreman / Uyuni 등으로 원격 관리 및 스케줄 설정 |
이 글이 도움이 되셨다면
🔔 구독 과 ❤️ 좋아요 꾸우욱 눌러 주세요!🙏
그리고 💖커피 ☕, 💚차 🍵, 💛맥주 🍺, ❤️와인 🍷 중 마음에 드시는 한 잔으로 💰 후원해 주시면 큰 힘이 됩니다.
👇 지금 바로 아래 🔘버튼을 꾸욱 눌러 📣 응원해 주세요! 👇