Prisma Cloud Compute: 재귀적 파일 무결성 관리 규칙이 적용된 경우 메모리 부족 문제 발생

Prisma Cloud Compute: 재귀적 파일 무결성 관리 규칙이 적용된 경우 메모리 부족 문제 발생

3954
Created On 09/09/22 14:01 PM - Last Modified 12/27/24 08:35 AM


Symptom


>>> 트위스트락이 활성화되어 있으면 CPU 사용량이 꾸준히 증가하고, 트위스트락을 중지하면 CPU 그래프가 정상으로 돌아갑니다.

1번째 증상 :

  • Prisma Cloud Compute 없이
  1. 낮은 한계를 가진 시작 포드
  2. Pod는 문제없이 작동합니다.
  3. 모든 것이 괜찮습니다.

  • Prisma Cloud Compute(Twistlock)를 사용하여
  1. 저한계 포드 시작
  2. 메모리 부족으로 인해 Pod가 종료됩니다.
  3. 포드가 작동하지 않습니다.


2번째 증상 :

  • 커널 로그는 리소스가 부족하여 컨테이너 생성이 중단되었음을 보여줍니다.
runc create failed: unable to start container process: container init was OOM-killed (memory limit too low?)



3번째 증상 :

image-20220823-072505.png

4번째 증상 :

  • 예를 들어 " ps aufx "로 프로세스를 확인하면 crio 프로세스가 무거운 로드 를 받고 있지만 " fsmon "이라는 특정 프로세스가 많은 리소스를 소비하고 있다는 것을 알 수 있습니다. 프로세스의 PID를 grep하여 종료하면 리소스 사용량이 정상으로 돌아올 것입니다.

Screenshot 2022-09-09 at 15.55.30.png

5h 증상:
  • CRI-O가 컨테이너 시작에 실패하거나 상당한 지연이 발생함을 나타내는 journalctl 출력 오류:
Kubelet may be retrying requests that are timing out in CRI-O due to system load: context deadline exceeded
  • 특히 다음과 같은 "이름이 예약됨" 오류가 많이 발생합니다.
Aug 19 06:40:49 muc9-4wtp8-worker-b-gen9-mbxcv crio[2252]: time="2022-08-19 06:40:49.510901803Z" level=warning msg="error reserving ctr name k8s_frontoffice-analytics-domain_frontoffice-analytics-deployment-1-zz5s8_reef-an-maxi-uat_ea9c7d33-8fea-4165-a534-106ce6c33e29_17 for id 90615636aa18fdc2a17bfef076500dfd14932a7109ca8e662c45b4708f0364bf: name is reserved"



관심 있는 기타 증상 기록:

Aug 19 10:30:46 muc9-4wtp8-worker-b-gen9-mbxcv crio[2252]: time="2022-08-19 10:30:45.691591825Z" level=error msg="Container creation error: time="2022-08-19T10:30:42Z" level=warning msg="unable to get oom kill count" error="open /sys/fs/cgroup/memory/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-podff7a0d7a_17b4_4777_9146_94fc41681318.slice/crio-fd00abb205097e9244014a63265fb0f656dab4ebd9dfe1e800d0a10ec55fc42d.scope/memory.oom_control: no such file or directory"\ntime="2022-08-19T10:30:44Z" level=error msg="runc create failed: unable to start container process: unable to apply cgroup configuration: Timeout waiting for systemd to create crio-fd00abb205097e9244014a63265fb0f656dab4ebd9dfe1e800d0a10ec55fc42d.scope"\n" id=dff10a34-f28e-4370-9fff-8e895148d11d name=/runtime.v1.RuntimeService/CreateContainer
Aug 19 10:30:46 muc9-4wtp8-worker-b-gen9-mbxcv crio[2252]: time="2022-08-19 10:30:46.086315234Z" level=info msg="createCtr: deleting container ID fd00abb205097e9244014a63265fb0f656dab4ebd9dfe1e800d0a10ec55fc42d from idIndex" id=dff10a34-f28e-4370-9fff-8e895148d11d name=/runtime.v1.RuntimeService/CreateContainer



Environment


  • 프리즈마 클라우드 컴퓨팅
  • 클러스터 디펜더
  • 오픈시프트/크리오


Cause


  • 이 문제의 근본 원인은 fsmon 프로세스(파일 시스템 모니터링 프로세스)가 많은 CPU 리소스를 소모하여 전체 클러스터 환경의 성능에 심각한 영향을 미치기 때문입니다.

  • In particular, if the customer has a lot of ?File Integrity? rules set up on his/her Cconsole, especially if recursive (i.e., tracking recursively an entire file-system tree like this "path": "/bin", "recursive": true, ...), then this feature can have severe performance impact, depending on the configured rules, when tracking lots of directories recursively.

  • In this case, the file system monitor needs to track and scan many files using fsmon, naturally introducing delays for the containers creation (containers created with runc), as these fail (or timeout as we saw above), the container runtime (crio) continues trying to spawn the containers again and again, making the system extremely busy.


Resolution


  • 콘솔에서 호스트 런타임 규칙을 사용하여 fsmon 프로세스를 종료하거나 재귀적 파일 무결성 관리 규칙을 삭제/축소할 수 있습니다.
  • 노드의 CPU 리소스 증가


Additional Information


FIM을 구성 다음을 감지할 수 있습니다.
  • 인증서, 비밀, 구성 파일 등의 중요한 파일을 읽거나 씁니다.
  • 파일 시스템 에 쓰여진 바이너리.
  • 비정상적으로 설치된 소프트웨어. 예를 들어, apt-get 이외의 프로그램이 파일 시스템 에 쓴 파일.

자세한 내용: 호스트를 위한 런타임 방어


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000sZ3NCAU&lang=ko&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language