IT 정보

SCAP(Security Content Automation Protocol) compliance CentOS

aiproductmanager 2025. 6. 22. 08:00
728x90
반응형

 

SCAP(Security Content Automation Protocol)을 통해 CentOS를 보안 기준에 맞게 설정하고 자동 점검하기 위한 전반적인 가이드와 상세 절차를 정리해 드립니다. 👇


✅ 1. 주요 툴 설치

CentOS 7 기준으로 다음 명령으로 주요 도구를 설치합니다:

 
yum install -y openscap openscap-utils scap-security-guide
 

이 명령은 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 개요


🔍 3. 기본 SCAP 점검 수행

GUI 방식 (SCAP Workbench)

 
yum install scap-workbench

설치 후:

CLI 방식 (oscap)

oscap xccdf eval \
  --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 옵션을 지정:
oscap xccdf eval \
  --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. 결과 분석 및 대응


🎯 6. 정리 및 활용 요약

  1. openscap + scap-security-guide 설치
  2. CentOS용 정책 파일 및 CPE 설정 준비
  3. scap-workbench 또는 oscap xccdf eval을 통한 스캔 수행
  4. HTML 리포트 확인 및 미진 항목 대응 또는 자동 조치
  5. 주기적인 재점검으로 보안 유지 관리

아래는 CentOS 서버에 적용할 수 있는 STIG, CIS 등 특정 프로필 설정, Ansible/Bash 자동 보정, 그리고 멀티 서버 환경에서 스캔/보고 자동화 구성에 대한 실전 가이드입니다.


✅ 1. 특정 프로필 설정 예시 (STIG / CIS)

📘 STIG (DISA STIG)

oscap xccdf eval \
  --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

📘 CIS Benchmark (Level 1 Server)

oscap xccdf eval \
  --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 자동 생성 및 실행

  1. scap-workbench GUI 또는 CLI를 사용해 STIG/CIS 프로필로 스캔
  2. 다음 명령으로 자동 Playbook 생성:
oscap xccdf generate fix \
  --fix-type ansible \
  --profile stig \
  --output remediation-stig.yml \
  stig-results.xml
  1. 생성된 Ansible 플레이북 실행:
ansible-playbook -i "localhost," remediation-stig.yml

✅ 3. 멀티 서버 자동 스캔·보고 구성

A. Ansible 기반 중앙 실행 흐름

  • Inventory 파일에 대상 서버 목록 등록 → Playbook 실행 → 결과 수집 자동화 가능

B. Ansible Tower / AWX / Satellite 연동

  • Red Hat Satellite 또는 Ansible Automation Platform의 컴플라이언스 기능 활용
  • 스케줄 기반 주기적 SCAP 점검 + 중앙집중 보고 🌐 youtube.com

C. Foreman + openscap_client Role

D. Uyuni (Spacewalk 오픈소스 버전)


🔧 요약 및 권장 구성

기능 방법
STIG/CIS 스캔 oscap xccdf eval --profile ...
자동 보정 (single) oscap xccdf generate fix --fix-type ansible → Ansible 실행
멀티 서버 자동화 Ansible Tower / AWX / Foreman / Uyuni 등으로 원격 관리 및 스케줄 설정
 

 

이 글이 도움이 되셨다면
🔔 구독❤️ 좋아요  꾸우욱 눌러 주세요!🙏

그리고 💖커피 ☕, 💚차 🍵, 💛맥주 🍺, ❤️와인 🍷  중 마음에 드시는 한 잔으로 💰 후원해 주시면 큰 힘이 됩니다.

                                                                             👇 지금 바로 아래 🔘버튼을 꾸욱 눌러 📣 응원해 주세요! 👇  

728x90
반응형