6.6.5.2. FileIntegrityNodeStatus CR 실패 상태의 예
실패 조건을 시뮬레이션하려면 AIDE가 추적하는 파일 중 하나를 수정하십시오. 예를 들어 작업자 노드 중 하나에서 /etc/resolv.conf를 수정합니다.
$ oc debug node/ip-10-0-130-192.ec2.internal
출력 예
Creating debug namespace/openshift-debug-node-ldfbj ...
Starting pod/ip-10-0-130-192ec2internal-debug ...
To use host binaries, run `chroot /host`
Pod IP: 10.0.130.192
If you don't see a command prompt, try pressing enter.
sh-4.2# echo "# integrity test" >> /host/etc/resolv.conf
sh-4.2# exit
Removing debug pod ...
Removing debug namespace/openshift-debug-node-ldfbj ...
잠시 후 해당 FileIntegrityNodeStatus 오브젝트의 결과 배열에 Failed 조건이 보고되었습니다. 이전의 Succeeded 조건이 유지되므로 검사가 실패한 시간을 정확히 찾을 수 있습니다.
$ oc get fileintegritynodestatuses.fileintegrity.openshift.io/worker-fileintegrity-ip-10-0-130-192.ec2.internal -ojsonpath='{.results}' | jq -r
또는 오브젝트 이름을 언급하지 않는 경우 다음을 실행합니다.
$ oc get fileintegritynodestatuses.fileintegrity.openshift.io -ojsonpath='{.items[*].results}' | jq
출력 예
[
{
"condition": "Succeeded",
"lastProbeTime": "2020-09-15T12:54:14Z"
},
{
"condition": "Failed",
"filesChanged": 1,
"lastProbeTime": "2020-09-15T12:57:20Z",
"resultConfigMapName": "aide-ds-worker-fileintegrity-ip-10-0-130-192.ec2.internal-failed",
"resultConfigMapNamespace": "openshift-file-integrity"
}
]
Failed 조건은 정확히 무엇이 실패하고 왜 실패했는지에 대한 자세한 정보를 제공하는 구성 맵을 가리킵니다.
$ oc describe cm aide-ds-worker-fileintegrity-ip-10-0-130-192.ec2.internal-failed
출력 예
Name: aide-ds-worker-fileintegrity-ip-10-0-130-192.ec2.internal-failed
Namespace: openshift-file-integrity
Labels: file-integrity.openshift.io/node=ip-10-0-130-192.ec2.internal
file-integrity.openshift.io/owner=worker-fileintegrity
file-integrity.openshift.io/result-log=
Annotations: file-integrity.openshift.io/files-added: 0
file-integrity.openshift.io/files-changed: 1
file-integrity.openshift.io/files-removed: 0
Data
integritylog:
------
AIDE 0.15.1 found differences between database and filesystem!!
Start timestamp: 2020-09-15 12:58:15
Summary:
Total number of files: 31553
Added files: 0
Removed files: 0
Changed files: 1
---------------------------------------------------
Changed files:
---------------------------------------------------
changed: /hostroot/etc/resolv.conf
---------------------------------------------------
Detailed information about changes:
---------------------------------------------------
File: /hostroot/etc/resolv.conf
SHA512 : sTQYpB/AL7FeoGtu/1g7opv6C+KT1CBJ , qAeM+a8yTgHPnIHMaRlS+so61EN8VOpg
Events: <none>
구성 맵 데이터 크기 제한으로 인해 1MB 이상의 AIDE 로그가 실패 구성 맵에 base64로 인코딩된 gzip 아카이브로 추가됩니다. 다음 명령을 사용하여 로그를 추출합니다.
$ oc get cm <failure-cm-name> -o json | jq -r '.data.integritylog' | base64 -d | gunzip
압축 로그는 구성 맵에 file-integrity.openshift.io/compressed 주석 키가 있는 것으로 표시됩니다.