
CVE-2021-44228용 Docker화된 허니팟.
포괄적인 보안 기능, 모니터링 및 알림 기능을 갖춘 CVE-2021-44228을 위한 향상된 도커화된 허니팟입니다.
# Generate SSL certificates
./generate-ssl.sh
# Start with docker-compose
docker-compose up -d
# Monitor logs
./monitor.py --tail
# Run as root for fail2ban setup
sudo ./deploy.sh
# x86_64
docker run -d -p 8080:8080 \
-e HONEYPOT_NAME="log4shell-honeypot" \
-e LOG_FORMAT="json" \
-e RATE_LIMIT_REQUESTS="100" \
--name="log4shell-honeypot" \
msanford/log4shell-honeypot:latest
# ARM (예: Raspberry Pi)
docker run -d -p 8080:8080 \
-e HONEYPOT_NAME="log4shell-honeypot" \
--name="log4shell-honeypot" \
msanford/log4shell-honeypot:arm-latest
# Load from config file
docker-compose --env-file config.env up -d
허니팟은 다음 Log4Shell 패턴을 탐지합니다:
${jndi: - JNDI 조회 (주요 공격 벡터)${ldap: - LDAP 디렉터리 조회${rmi: - RMI 원격 메서드 호출${dns: - DNS 조회${env: - 환경 변수 접근${sys: - 시스템 속성 접근${java: - Java 런타임 정보# Tail logs with formatted output
./monitor.py --tail
# Analyze last 24 hours
./monitor.py --hours 24
# Analyze last hour
./monitor.py --hours 1
curl http://localhost/health
curl http://localhost/metrics
sudo fail2ban-client status log4shell-honeypot
향상된 JSON 로그 형식은 다음을 포함합니다:
{
"timestamp": "2024-01-15T10:30:45Z",
"honeypot": "log4shell-honeypot",
"event_type": "log4shell_attempt",
"source_ip": "192.168.1.100",
"real_ip": "10.0.0.5",
"method": "POST",
"url": "http://honeypot.local/",
"user_agent": "Mozilla/5.0...",
"detected_patterns": ["${jndi:", "${env:"],
"detection_source": "form_field:username",
"headers": {...},
"form_data": {...},
"query_params": {...},
"content_length": 45
}
구조화된 JSON 로그는 다음에서 쉽게 수집할 수 있습니다:
다음을 기반으로 알림 설정:
# Build container
docker build -t log4shell-honeypot:latest .
# Build with specific tag
docker build -t log4shell-honeypot:v2.0 .
docker-compose ps
docker-compose logs log4shell-honeypot
curl -f http://localhost/health || echo "Health check failed"
sudo fail2ban-client status
sudo tail -f /var/log/fail2ban.log
# Check for recent attacks
./monitor.py --hours 1
# View raw logs
tail -f /var/log/log4shell-honeypot.log
RATE_LIMIT_REQUESTS 증가MAX_LOG_SIZE 및 LOG_BACKUP_COUNT 조정# In docker-compose.yml
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 128M
이것은 BinaryDefense/log4shell-honeypot-flask의 향상된 포크로, 상당한 보안 및 운영 개선이 포함되어 있습니다.
| 변수 | 기본값 | 설명 |
|---|
HONEYPOT_NAME | log4shell-honeypot | 허니팟의 이름 식별자 |
LOG_LEVEL | INFO | 로깅 수준 (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
LOG_FORMAT | json | 로그 형식 (json 또는 text) |
MAX_LOG_SIZE | 10485760 | 최대 로그 파일 크기 (바이트, 10MB) |
LOG_BACKUP_COUNT | 5 | 유지할 백업 로그 파일 수 |
RATE_LIMIT_REQUESTS | 100 | 창당 IP당 최대 요청 수 |
RATE_LIMIT_WINDOW | 3600 | 속도 제한 창 (초, 1시간) |