SCAP 는 Security Content Automation Protocol 의 약자 로 시스템의 취약점 점검이나 보안 수준 측정, 정책 준수 여부등을 자동으로 검사하기 위한 표준입니다.

운영해야할 시스템이 방대해지고 보안에 대한 품질 기준이 높아지나 다양한 보안 요구 사항을 만족하기가 어려워져서 자동화된 프로토콜이 필요해서 대두된 표준인 것 같습니다.


SCAP 의 최신 버전은 2018년 2월에 발표된 1.3이며 방대한 내용을 다루고 있으므로 전문가가 아니면 이를 이해하고 적용하기 어려워 보입니다.


OpenSCAP 는 SCAP 를 구현한 제품으로 RedHat 이 주도있으며 RedHat Enterprise Linux 계열에서 사용 가능합니다.


OpenSCAP scanner 사용하기

OpenSCAP 웹 사이트에서는 복잡한 SCAP 를 이해하기 위한 첫 단계로 scanner 를 사용하는 예제를 보여주고 있습니다.

CLI 용 스캐너 설치

GUI 환경도 지원하지만 보통 서버는 Command line 에서 관리하므로 CLI 용 스캐너를 설치하는 게 좋습니다.

다음 명령으로 RHEL 계열에 CLI scanner 인 openscap-scanner 를 설치할 수 있습니다.

yum install openscap-scanner
BASH


ubuntu 는 libopenscap8 패키지를 설치하면 됩니다.

sudo apt install libopenscap8
BASH


설치가 완료되면 oscap 라는 명령어로 시스템을 스캔할 수 있습니다.

$ oscap

Usage:    oscap [options] module operation [operation-options-and-arguments]
Commands: ds oval xccdf cvss cpe cve cvrf info
Help:     oscap -h
BASH


정책 선택

oscap 는 보안 정책을 제공하지 않으므로 추가 패키지를 설치해야 합니다. 

$ yum install scap-security-guide
BASH


설치가 완료되면 SSG(SCAP Security Guide) 파일이 생기는데 이 파일이 정책 프로파일입니다.

$ ls -1 /usr/share/xml/scap/ssg/content/ssg-*-ds.xml

/usr/share/xml/scap/ssg/content/ssg-firefox-ds.xml
/usr/share/xml/scap/ssg/content/ssg-jre-ds.xml
/usr/share/xml/scap/ssg/content/ssg-rhel6-ds.xml
/usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
BASH


개별 SSG 정책마다 security baseline  에 부합하는 정책을 구현한 여러 프로파일을 제공합니다. 모든 프로파일은 다른 규칙과 값을 갖고 있으며 다음 명령어로 포함하고 있는 프로파일 목록을 확인할 수 있습니다.

$ oscap info --fetch-remote-resources /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml

Document type: Source Data Stream
Imported: 2020-11-13T17:59:18

Stream: scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml
Generated: (null)
Version: 1.3
Checklists:
        Ref-Id: scap_org.open-scap_cref_ssg-rhel8-xccdf-1.2.xml
Downloading: https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml ... ok
                Status: draft
                Generated: 2020-11-13
                Resolved: true
                Profiles:
                        Title: [DRAFT] DISA STIG for Red Hat Enterprise Linux 8
                                Id: xccdf_org.ssgproject.content_profile_stig
                        Title: Protection Profile for General Purpose Operating Systems
                                Id: xccdf_org.ssgproject.content_profile_ospp
                        Title: PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 8
                                Id: xccdf_org.ssgproject.content_profile_pci-dss
                        Title: Australian Cyber Security Centre (ACSC) Essential Eight
                                Id: xccdf_org.ssgproject.content_profile_e8
                        Title: Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171)
                                Id: xccdf_org.ssgproject.content_profile_cui
BASH


평가(evaluation)

정책 준수 여부를 평가하려면 사용할 프로파일과 정책을 지정하면 됩니다.

$ oscap xccdf eval --fetch-remote-resources  \
	--profile xccdf_org.ssgproject.content_profile_pci-dss \
	 --results-arf arf.xml  --report report.html \
	 /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
BASH



Ref