@@ -134,9 +134,18 @@ csrutil status
134134
135135** Kandji 컴플라이언스 스크립트** :
136136
137- > ``` bash
138- > #! /bin/bash...
139- > ` ` `
137+ ``` bash
138+ #! /bin/bash
139+ # SIP 상태 검증 및 컴플라이언스 보고
140+ SIP_STATUS=$( csrutil status)
141+ if echo " $SIP_STATUS " | grep -q " enabled" ; then
142+ echo " PASS: SIP 활성화 확인"
143+ exit 0
144+ else
145+ echo " FAIL: SIP 비활성화 감지 - 조치 필요"
146+ exit 1
147+ fi
148+ ```
140149
141150
142151### 2.4 TCC (Transparency, Consent, and Control)
@@ -188,9 +197,27 @@ Kandji에서 권장하는 핵심 보안 설정:
188197
189198#### ISMS-P 컴플라이언스 스크립트
190199
191- > ``` bash
192- > #! /bin/bash...
193- > ` ` `
200+ ``` bash
201+ #! /bin/bash
202+ # ISMS-P 핵심 통제 항목 자동 점검
203+ echo " === ISMS-P 컴플라이언스 점검 ==="
204+
205+ # 2.5.1 암호화: FileVault 상태
206+ fv_status=$( fdesetup status)
207+ echo " [2.5.1] FileVault: $fv_status "
208+
209+ # 2.4.1 패스워드 정책 확인
210+ pw_min=$( pwpolicy -getaccountpolicies 2> /dev/null | grep -c " minLength" )
211+ echo " [2.4.1] 패스워드 정책 적용: $pw_min 항목"
212+
213+ # 2.6.1 Gatekeeper 상태
214+ gk_status=$( spctl --status)
215+ echo " [2.6.1] Gatekeeper: $gk_status "
216+
217+ # 2.7.1 마지막 업데이트 확인
218+ last_update=$( softwareupdate --history | tail -1)
219+ echo " [2.7.1] 최근 업데이트: $last_update "
220+ ```
194221
195222
196223### 4.2 CIS macOS Benchmark
@@ -213,9 +240,26 @@ CIS macOS 14.0 Benchmark 주요 통제:
213240
214241#### Kandji 차단 스크립트
215242
216- > ` ` ` bash
217- > #! /bin/bash...
218- > ` ` `
243+ ``` bash
244+ #! /bin/bash
245+ # CIS Benchmark 핵심 항목 자동 감사
246+ echo " === CIS macOS Benchmark 감사 ==="
247+
248+ # CIS 1.1: 자동 업데이트
249+ auto_update=$( defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled 2> /dev/null)
250+ [ " $auto_update " = " 1" ] && echo " PASS [1.1] 자동 업데이트 활성화" || echo " FAIL [1.1] 자동 업데이트 비활성화"
251+
252+ # CIS 2.3.1: 방화벽
253+ fw_state=$( defaults read /Library/Preferences/com.apple.alf globalstate 2> /dev/null)
254+ [ " $fw_state " != " 0" ] && echo " PASS [2.3.1] 방화벽 활성화" || echo " FAIL [2.3.1] 방화벽 비활성화"
255+
256+ # CIS 2.5.1: FileVault
257+ fv=$( fdesetup status)
258+ echo " $fv " | grep -q " On" && echo " PASS [2.5.1] FileVault 활성화" || echo " FAIL [2.5.1] FileVault 비활성화"
259+
260+ # CIS 2.10.1: SIP
261+ csrutil status | grep -q " enabled" && echo " PASS [2.10.1] SIP 활성화" || echo " FAIL [2.10.1] SIP 비활성화"
262+ ```
219263
220264
221265## 5. 패치 관리
@@ -224,16 +268,29 @@ CIS macOS 14.0 Benchmark 주요 통제:
224268
225269#### 자동 업데이트 정책
226270
227- > ` ` ` bash
228- > # softwareupdate 설정...
229- > ` ` `
271+ ``` bash
272+ # macOS 자동 업데이트 설정 (Kandji 스크립트로 배포)
273+ sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
274+ sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
275+ sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
276+ sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true
277+
278+ # 설정 확인
279+ defaults read /Library/Preferences/com.apple.SoftwareUpdate
280+ ```
230281
231282
232283#### 패치 지연 배포 (Deferral)
233284
234- > ` ` ` json
235- > {...
236- > ` ` `
285+ ``` json
286+ {
287+ "PayloadType" : " com.apple.SoftwareUpdate" ,
288+ "enforcedSoftwareUpdateDelay" : 14 ,
289+ "enforcedSoftwareUpdateMajorOSDeferredInstallDelay" : 30 ,
290+ "enforcedSoftwareUpdateMinorOSDeferredInstallDelay" : 14 ,
291+ "enforcedSoftwareUpdateNonOSDeferredInstallDelay" : 7
292+ }
293+ ```
237294
238295
239296## 6. 2025년 엔드포인트 보안 및 MDM 트렌드
@@ -287,16 +344,40 @@ CIS macOS 14.0 Benchmark 주요 통제:
287344
288345#### Okta 연동
289346
290- > ` ` ` bash
291- > # Okta Device Trust 연동...
292- > ` ` `
347+ ``` bash
348+ # Okta Device Trust 연동 확인 스크립트
349+ # Kandji 관리 디바이스에서 Okta Device Trust 인증서 상태 점검
350+
351+ # 1. Okta Device Trust 인증서 확인
352+ security find-certificate -a -Z /Library/Keychains/System.keychain \
353+ | grep -A 5 " Okta Device Trust"
354+
355+ # 2. MDM 등록 상태 확인
356+ profiles status -type enrollment
357+
358+ # 3. Okta Verify 앱 설치 확인
359+ ls /Applications/ | grep -i " Okta Verify"
360+ ```
293361
294362
295363#### Azure AD Conditional Access
296364
297- > ` ` ` json
298- > {...
299- > ` ` `
365+ ``` json
366+ {
367+ "conditionalAccessPolicy" : {
368+ "displayName" : " Kandji Managed Mac - Require Compliant Device" ,
369+ "state" : " enabled" ,
370+ "conditions" : {
371+ "platforms" : { "includePlatforms" : [" macOS" ] },
372+ "clientAppTypes" : [" all" ]
373+ },
374+ "grantControls" : {
375+ "operator" : " AND" ,
376+ "builtInControls" : [" compliantDevice" , " domainJoinedDevice" ]
377+ }
378+ }
379+ }
380+ ```
300381
301382
302383### 8.2 SASE 통합
@@ -307,9 +388,32 @@ CIS macOS 14.0 Benchmark 주요 통제:
307388
308389### 9.1 공공기관 보안 설정
309390
310- > ` ` ` json
311- > {...
312- > ` ` `
391+ ``` json
392+ {
393+ "PayloadDisplayName" : " 공공기관 보안 정책" ,
394+ "PayloadType" : " Configuration" ,
395+ "PayloadContent" : [
396+ {
397+ "PayloadType" : " com.apple.security.firewall" ,
398+ "EnableFirewall" : true ,
399+ "EnableStealthMode" : true ,
400+ "BlockAllIncoming" : false
401+ },
402+ {
403+ "PayloadType" : " com.apple.screensaver" ,
404+ "loginWindowIdleTime" : 300 ,
405+ "askForPassword" : true ,
406+ "askForPasswordDelay" : 0
407+ },
408+ {
409+ "PayloadType" : " com.apple.password-policy" ,
410+ "minLength" : 12 ,
411+ "requireAlphanumeric" : true ,
412+ "maxPINAgeInDays" : 90
413+ }
414+ ]
415+ }
416+ ```
313417
314418
315419## 10. 경영진 보고 형식
@@ -332,9 +436,20 @@ CIS macOS 14.0 Benchmark 주요 통제:
332436
333437** 원인 및 해결** :
334438
335- > ` ` ` bash
336- > # 1. APNs 연결 확인...
337- > ` ` `
439+ ``` bash
440+ # 1. APNs 연결 확인
441+ nc -zv gateway.push.apple.com 2195
442+ nc -zv feedback.push.apple.com 2196
443+
444+ # 2. MDM 등록 상태 확인
445+ sudo /usr/libexec/mdmclient dep nag
446+
447+ # 3. ABM 서버 접근 확인
448+ curl -sv https://deviceenrollment.apple.com/ping
449+
450+ # 4. Kandji 에이전트 재시작
451+ sudo launchctl kickstart -k system/com.kandji.agent
452+ ```
338453
339454
340455** 방화벽 예외 규칙** :
@@ -354,9 +469,19 @@ deviceenrollment.apple.com
354469
355470** 해결 절차** :
356471
357- > ``` bash
358- > # 1. Kandji에서 복구키 조회...
359- > ` ` `
472+ ``` bash
473+ # 1. Kandji API로 복구키 조회
474+ curl -X GET " https://api.kandji.io/api/v1/devices/{device_id}/filevault" \
475+ -H " Authorization: Bearer YOUR_API_TOKEN" \
476+ | jq -r ' .recovery_key'
477+
478+ # 2. 복구키로 macOS 복구 모드 진입 후 잠금 해제
479+ # - 재시작 후 Command+R 또는 전원 버튼 길게 눌러 복구 모드 진입
480+ # - Disk Utility → 디스크 잠금 해제 시 복구키 입력
481+
482+ # 3. 복구키 회전 (해제 후 즉시 실행)
483+ sudo fdesetup changerecovery -personal
484+ ```
360485
361486
362487### 11.3 MDM 프로파일 제거 불가
@@ -367,9 +492,20 @@ deviceenrollment.apple.com
367492
368493** 해결** :
369494
370- > ` ` ` bash
371- > # 1. Recovery Mode 부팅...
372- > ` ` `
495+ ``` bash
496+ # 1. MDM 등록 상태 확인
497+ profiles status -type enrollment
498+
499+ # 2. UAMDM(사용자 승인 MDM) 활성화 여부 확인
500+ sudo /usr/libexec/mdmclient QuerySecurityInfo | grep -i " user approved"
501+
502+ # 3. 사용자 승인 유도 (시스템 설정 → 개인 정보 보호 및 보안 → 프로파일)
503+ open " x-apple.systempreferences:com.apple.preferences.security"
504+
505+ # 4. DEP 재등록 (Recovery Mode에서 실행)
506+ # csrutil disable ← Apple Silicon: Startup Security Utility에서 변경
507+ sudo /usr/libexec/mdmclient dep nag
508+ ```
373509
374510
375511### 11.4 앱 배포 실패
@@ -378,9 +514,23 @@ deviceenrollment.apple.com
378514
379515** 체크리스트** :
380516
381- > ` ` ` bash
382- > # 1. VPP 토큰 유효성 확인...
383- > ` ` `
517+ ``` bash
518+ # 1. VPP 토큰 유효성 확인 (Kandji Console → Integrations → Apple Business Manager)
519+ curl -X GET " https://api.kandji.io/api/v1/integrations/vpp" \
520+ -H " Authorization: Bearer YOUR_API_TOKEN" \
521+ | jq ' .token_expiry'
522+
523+ # 2. 앱 라이선스 잔여 확인
524+ curl -X GET " https://api.kandji.io/api/v1/apps" \
525+ -H " Authorization: Bearer YOUR_API_TOKEN" \
526+ | jq ' .[] | {name: .name, available_licenses: .available_licenses}'
527+
528+ # 3. 디바이스 ABM 연결 확인
529+ sudo /usr/libexec/mdmclient QueryDeviceInformation | grep -i " EnrolledViaDEP"
530+
531+ # 4. Kandji 에이전트 로그 확인
532+ log show --predicate ' subsystem == "com.kandji.agent"' --last 1h | grep -i " app install"
533+ ```
384534
385535
386536### 11.5 성능 저하 (디바이스 느림)
@@ -389,9 +539,19 @@ deviceenrollment.apple.com
389539
390540** 진단** :
391541
392- > ` ` ` bash
393- > # 1. mdmclient 프로세스 확인...
394- > ` ` `
542+ ``` bash
543+ # 1. mdmclient 프로세스 CPU/메모리 사용량 확인
544+ top -l 1 -s 0 | grep -i mdmclient
545+
546+ # 2. Kandji 에이전트 리소스 사용량 확인
547+ ps aux | grep -E " kandji|mdmclient" | awk ' {print $1, $2, $3, $4, $11}'
548+
549+ # 3. 최근 1시간 에이전트 로그 오류 확인
550+ log show --predicate ' subsystem == "com.kandji.agent"' --last 1h --level error
551+
552+ # 4. 과도한 스크립트 실행 여부 확인
553+ log show --predicate ' process == "bash" OR process == "python3"' --last 30m | wc -l
554+ ```
395555
396556
397557** 최적화** :
@@ -413,9 +573,20 @@ sudo log config --mode "level:default" --subsystem com.kandji
413573
414574** 해결** :
415575
416- > ``` bash
417- > # 1. 인증서 확인...
418- > ` ` `
576+ ``` bash
577+ # 1. 802.1X 인증서 키체인 확인
578+ security find-certificate -a -Z /Library/Keychains/System.keychain \
579+ | grep -B 5 " 802.1X\|RADIUS\|WPA"
580+
581+ # 2. Wi-Fi 프로파일 설치 상태 확인
582+ profiles list -verbose | grep -i " Wi-Fi\|802.1X"
583+
584+ # 3. 인증서 유효기간 확인
585+ security find-certificate -c " Your-Corp-CA" -p | openssl x509 -noout -dates
586+
587+ # 4. 네트워크 연결 진단 로그
588+ log show --predicate ' subsystem == "com.apple.eap"' --last 30m | tail -50
589+ ```
419590
420591
421592## 12. 참고 자료
0 commit comments