5.6.8.2. 원시 결과 가져오기
규정 준수 검사가 완료되면 결과 ComplianceCheckResult CR(사용자 정의 리소스)에 개별 검사 결과가 나열됩니다. 그러나 관리자 또는 감사자는 검사에 대한 전체 세부 정보가 필요할 수 있습니다. OpenSCAP 툴은 자세한 결과를 사용하여 AMQP(Advanced Recording Format) 포맷 파일을 생성합니다. 이 ARF 파일은 구성 맵 또는 기타 표준 Kubernetes 리소스에 저장하기에 너무 크므로 이를 포함할 영구 볼륨(PV)이 생성됩니다.
프로세스
Compliance Operator를 사용하여 PV에서 결과를 가져오는 작업은 4단계 프로세스입니다. 그러나
oc-compliance플러그인을 사용하면 단일 명령을 사용할 수 있습니다.$ oc compliance fetch-raw <object-type> <object-name> -o <output-path>-
<object-type>은 검사가 시작된 오브젝트에 따라scansettingbinding,compliancescan또는compliancesuite일 수 있습니다. <object-name>은 ARF 파일을 수집할 바인딩, 제품군 또는 검사 오브젝트의 이름이고<output-path>는 결과를 배치할 로컬 디렉터리입니다.예를 들면 다음과 같습니다.
$ oc compliance fetch-raw scansettingbindings my-binding -o /tmp/출력 예
Fetching results for my-binding scans: ocp4-cis, ocp4-cis-node-worker, ocp4-cis-node-master Fetching raw compliance results for scan 'ocp4-cis'....... The raw compliance results are available in the following directory: /tmp/ocp4-cis Fetching raw compliance results for scan 'ocp4-cis-node-worker'........... The raw compliance results are available in the following directory: /tmp/ocp4-cis-node-worker Fetching raw compliance results for scan 'ocp4-cis-node-master'...... The raw compliance results are available in the following directory: /tmp/ocp4-cis-node-master
디렉터리에서 파일 목록을 확인합니다.
$ ls /tmp/ocp4-cis-node-master/
출력 예
ocp4-cis-node-master-ip-10-0-128-89.ec2.internal-pod.xml.bzip2 ocp4-cis-node-master-ip-10-0-150-5.ec2.internal-pod.xml.bzip2 ocp4-cis-node-master-ip-10-0-163-32.ec2.internal-pod.xml.bzip2
결과를 추출합니다.
$ bunzip2 -c resultsdir/worker-scan/worker-scan-stage-459-tqkg7-compute-0-pod.xml.bzip2 > resultsdir/worker-scan/worker-scan-ip-10-0-170-231.us-east-2.compute.internal-pod.xml
결과를 확인합니다.
$ ls resultsdir/worker-scan/
출력 예
worker-scan-ip-10-0-170-231.us-east-2.compute.internal-pod.xml
worker-scan-stage-459-tqkg7-compute-0-pod.xml.bzip2
worker-scan-stage-459-tqkg7-compute-1-pod.xml.bzip2