Cnspec으로 PLCnext Control에서 구형 펌웨어 및 잘못된 구성 탐지하기
예로 Phoenix Contact의 ARM Cortex-A9 프로세서 기반 PLCnext Control AXC F 2125(IEC 61131 런타임 시스템 탑재)를 들어보겠습니다. Cnspec은 리눅스 기반 PLCnext Control을 스캔해 구형 펌웨어와 잘못된 구성을 탐지하는 다양한 옵션을 제공하는 오픈 소스 도구입니다. 이 가이드는 cnspec SSH 프로바이더를 통해 PLCnext Control을 스캔하는 단계별 지침을 제공합니다.
-
노트북에 cnspec을 설치합니다(설치 가이드 참조)
-
다음 명령으로 PLCnext Control에 연결하고 cnspec 쉘을 설정해 연결을 테스트합니다:
cnspec shell ssh admin@192.168.1.10 --ask-pass
-
cnspec 쉘 내에서 다음 MQL 명령을 실행합니다:
file("/etc/plcnext/arpversion").content
SSH를 통해 PLCnext Control에 연결하고 첫 번째 MQL 명령을 실행할 수 있음을 확인했습니다.
→ loaded configuration from /home/user/.config/mondoo/mondoo.yml using source default Enter password: → discover related assets for 1 asset(s) → resolved assets resolved-assets=1 ___ _ __ ___ _ __ ___ ___ / __| '_ \/ __| '_ \ / _ \/ __| | (__| | | \__ \ |_) | __/ (__ \___|_| |_|___/ .__/ \___|\___| mondoo™ |_| cnspec> file("/etc/plcnext/arpversion").content file.content: "Arpversion: 23.0.0.65 GIT Commit Hash: d755854b5b21ecb8dca26b0a560e6842a0c638d7 Build Job: \"jenkins-PLCnext-Yocto_Targets-Yocto_AXCF2152-release%2F23.0.x-65\" "
-
공개 cnspec-policies 저장소에서 PLCnext Technology 정책을 다운로드해 기본 보안 검사를 수행합니다:
git clone https://github.com/mondoohq/cnspec-policies Cloning into 'cnspec-policies'... remote: Enumerating objects: 1075, done. remote: Counting objects: 100% (149/149), done. remote: Compressing objects: 100% (84/84), done. remote: Total 1075 (delta 75), reused 115 (delta 61), pack-reused 926 Receiving objects: 100% (1075/1075), 699.81 KiB | 402.00 KiB/s, done. Resolving deltas: 100% (690/690), done.
-
다음 명령으로 SSH를 통해 PLCnext Control에 대한 완전한 보안 스캔을 실행합니다:
cnspec scan ssh admin@192.168.1.10 -f cnspec-policies/community/mondoo-phoenix-plcnext-security.mql.yaml --ask-pass
전체 출력은 다음과 같습니다:
cnspec scan ssh admin@192.168.1.10 -f cnspec-policies/community/mondoo-phoenix-plcnext-security.mql.yaml --ask-pass → loaded configuration from /home/user/.config/mondoo/mondoo.yml using source default Enter password: → using service account credentials → discover related assets for 1 asset(s) → resolved assets resolved-assets=1 axcf2152 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% score: F Asset: axcf2152 --------------- Controls: ✕ Fail: Ensure SSH MaxAuthTries is set to 4 or less ✓ Pass: Ensure secure permissions on SSH public host key files are set ✓ Pass: Ensure only strong MAC algorithms are used ✓ Pass: Ensure only strong ciphers are used ✓ Pass: Ensure SSH IgnoreRhosts is enabled ✓ Pass: Ensure SSH Idle Timeout Interval is configured ✕ Fail: Ensure SSH password authentication is disabled ✓ Pass: Ensure current system time is synchronized ✓ Pass: Ensure only strong Key Exchange algorithms are used ✓ Pass: Ensure SSH LoginGraceTime is set to one minute or less ✓ Pass: Ensure SSH Protocol is set to 2 ✓ Pass: Ensure SSH root login is disabled or set to prohibit-password ✓ Pass: Ensure SSH LogLevel is appropriate ✓ Pass: Ensure SSH PermitUserEnvironment is disabled ✓ Pass: Ensure SSH HostbasedAuthentication is disabled ✓ Pass: Ensure SSH access is limited ✓ Pass: Ensure secure permissions on SSH private host key files are set ✓ Pass: Ensure SSH warning banner is configured ✕ Fail: Ensure Firewall is active ✓ Pass: Ensure SSH PermitEmptyPasswords is disabled ✓ Pass: Ensure SSH X11 forwarding is disabled ✓ Pass: Ensure latest PLCnext Firmware is installed Scanned 1 assets For detailed output, run this scan with "-o full".
오픈 소스 cnspec 보안 솔루션은 IT와 OT 시스템 전반에 걸쳐 취약점과 잘못된 구성을 식별하는 포괄적인 접근 방식을 제공합니다. 정기적으로 시스템을 스캔하면 잠재적 보안 문제를 문제화되기 전에 선제적으로 식별하고 수정할 수 있습니다.
참고:
Makers Blog는 Phoenix Contact에서 테스트하거나 검토하지 않은 커뮤니티 구성원의 애플리케이션과 사용자 스토리를 보여줍니다. 자신의 책임 하에 사용하세요.