2024-02-27 19:11:16 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								FROM alpine:3.19
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Include dist
							 | 
						
					
						
							
								
									
										
										
										
											2022-03-05 00:50:47 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								COPY dist/ /root/dist/
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							
								
									
										
										
										
											2024-09-11 10:42:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Install packages
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN	apk --no-cache -U add \
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										git \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										procps \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										py3-psutil \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										py3-requests \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										python3 && \
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-05 16:59:08 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Install adbhoney from git
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-02 15:18:32 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    git clone https://github.com/huuck/ADBHoney /opt/adbhoney && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    cd /opt/adbhoney && \
							 | 
						
					
						
							
								
									
										
										
										
											2022-10-12 11:52:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#    git checkout 2417a7a982f4fd527b3a048048df9a23178767ad && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    git checkout 42afd98611724ca3d694a48b694c957e8d953db4 && \
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    cp /root/dist/adbhoney.cfg /opt/adbhoney && \
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    cp /root/dist/cpu_check.py / && \
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    sed -i 's/dst_ip/dest_ip/' /opt/adbhoney/adbhoney/core.py && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    sed -i 's/dst_port/dest_port/' /opt/adbhoney/adbhoney/core.py && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-05 16:59:08 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Setup user, groups and configs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    addgroup -g 2000 adbhoney && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    adduser -S -H -s /bin/ash -u 2000 -D -g 2000 adbhoney && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    chown -R adbhoney:adbhoney /opt/adbhoney && \
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-05 16:59:08 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Clean up
							 | 
						
					
						
							
								
									
										
										
										
											2022-03-11 13:29:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    apk del --purge git && \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    rm -rf /root/* /opt/adbhoney/.git /var/cache/apk/*
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 12:46:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-05 16:59:08 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Set workdir and start adbhoney
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								STOPSIGNAL SIGINT
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Adbhoney sometimes hangs at 100% CPU usage, if detected container will become unhealthy and restarted by tpotinit
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								HEALTHCHECK --interval=5m --timeout=30s --retries=3 CMD python3 /cpu_check.py $(pgrep -of run.py) 99
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-05 16:59:08 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								USER adbhoney:adbhoney
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								WORKDIR /opt/adbhoney/
							 | 
						
					
						
							
								
									
										
										
										
											2024-09-05 19:49:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CMD ["/usr/bin/python3", "run.py"]
							 |