macOS Tahoe 26.4 터미널 보안 신기능

2026년 3월 macOS Tahoe 26.4 업데이트에서 터미널 앱에 새로운 보안 기능이 추가되었다. 악성 명령어를 클립보드에서 붙여넣기할 때 자동으로 감지하여 차단하는 기능으로, "Possible malware, Paste blocked"라는 경고를 표시한다. 소셜 엔지니어링 공격("이 명령어를 터미널에 붙여넣기하세요"류)을 근본적으로 차단한다.

1. 시스템 업데이트 관리

# 사용 가능한 업데이트 확인
softwareupdate -l

# 모든 업데이트 다운로드 및 설치
sudo softwareupdate -i -a -R

# 특정 업데이트만 설치
sudo softwareupdate -i "macOS Tahoe 26.4-26D81"

# 자동 업데이트 상태 확인
sudo softwareupdate --schedule

# 자동 업데이트 활성화/비활성화
sudo softwareupdate --schedule on
sudo softwareupdate --schedule off

2. XProtect (내장 맬웨어 방어)

# XProtect 현재 버전 확인
sudo xprotect check

# XProtect 강제 업데이트
sudo xprotect update

# XProtect 데이터 파일 위치 확인
ls -la /Library/Apple/System/Library/CoreServices/XProtect.bundle/

# 맬웨어 제거 도구(MRT) 버전 확인
defaults read /Library/Apple/System/Library/CoreServices/MRT.app/Contents/Info.plist CFBundleVersion

# 게이트키퍼 상태 확인
spctl --status
# 결과: assessments enabled (정상)

3. 디스크 및 스토리지 관리

# 디스크 사용량 요약
df -h

# 특정 디렉토리 용량 확인 (상위 10개)
du -sh ~/* 2>/dev/null | sort -rh | head -10

# APFS 볼륨 상태 확인
diskutil apfs list

# 디스크 검증 (First Aid)
diskutil verifyVolume /

# 퍼지 가능한 공간 확인
diskutil apfs listSnapshots /

# Time Machine 로컬 스냅샷 정리
tmutil thinlocalsnapshots / 9999999999 4

# 시스템 캐시 정리
sudo rm -rf /Library/Caches/*
rm -rf ~/Library/Caches/*

4. 네트워크 진단

# 현재 네트워크 인터페이스 상태
ifconfig en0

# Wi-Fi 정보 상세 확인
system_profiler SPAirPortDataType

# DNS 캐시 초기화
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
echo "DNS 캐시 초기화 완료"

# 포트 사용 현황 확인
lsof -i -P -n | grep LISTEN

# 특정 포트 사용 프로세스 찾기
lsof -i :8080

# 네트워크 연결 상태
nettop -m tcp -J bytes_in,bytes_out -n

# 라우팅 테이블 확인
netstat -rn

# Wi-Fi 비밀번호 조회 (키체인에서)
security find-generic-password -wa "WiFi이름"

5. 프로세스 관리

# CPU/메모리 상위 프로세스 (실시간)
top -o cpu -n 10

# 메모리 사용량 기준 정렬
ps aux --sort=-%mem | head -20

# 특정 프로세스 찾기
pgrep -fl "Chrome"

# 응답 없는 앱 강제 종료
killall -9 "Google Chrome"

# 시스템 메모리 상태
vm_stat | perl -ne "/page size of (\d+)/ and \$s=\$1; /Pages\s+(\w+)[^:]+:\s+(\d+)/ and printf \"%-20s %6.1f MB\n\", \$1, \$2*\$s/1048576;"

# launchctl로 데몬/에이전트 관리
launchctl list | grep com.apple
launchctl print system/com.apple.bluetoothd

6. 보안 관련 명령어

# 방화벽 상태 확인
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate

# 방화벽 활성화
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on

# 스텔스 모드 활성화 (핑 응답 차단)
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on

# FileVault 암호화 상태
fdesetup status

# SIP(System Integrity Protection) 상태
csrutil status

# 최근 로그인 기록
last -10

# 실패한 로그인 시도 확인
log show --predicate "eventMessage contains \"Authentication failed\"" --last 24h

# 앱 권한 확인 (TCC 데이터베이스)
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "SELECT client, auth_value FROM access"

7. Homebrew 패키지 관리

# Homebrew 업데이트
brew update

# 업그레이드 가능한 패키지 확인
brew outdated

# 전체 업그레이드
brew upgrade

# 불필요한 캐시/구버전 정리
brew cleanup -s
brew autoremove

# 설치된 패키지 의존성 트리
brew deps --tree --installed

# 헬스 체크
brew doctor

8. 자동화: crontab과 LaunchAgent

# crontab 편집
crontab -e

# 매일 새벽 3시에 스크립트 실행
# 0 3 * * * /usr/local/bin/backup.sh

# LaunchAgent 생성 (더 macOS 친화적)
# ~/Library/LaunchAgents/com.my.task.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.my.task</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/my-script.sh</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key>
    <integer>3</integer>
    <key>Minute</key>
    <integer>0</integer>
  </dict>
  <key>KeepAlive</key>
  <false/>
</dict>
</plist>

# LaunchAgent 로드/언로드
launchctl load ~/Library/LaunchAgents/com.my.task.plist
launchctl unload ~/Library/LaunchAgents/com.my.task.plist

macOS의 터미널은 시스템 관리, 보안 설정, 자동화를 위한 강력한 도구다. 특히 2026년 추가된 붙여넣기 보안 기능은 터미널을 이용한 소셜 엔지니어링 공격을 원천 차단하는 중요한 보안 강화이다.