mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Begin integration of honeyaml
This commit is contained in:
40
docker/honeyaml/Dockerfile
Normal file
40
docker/honeyaml/Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM rust:latest AS builder
|
||||
#
|
||||
# Detect architecture and set target accordingly
|
||||
RUN arch=$(arch) && \
|
||||
if [ "$arch" = "x86_64" ]; then \
|
||||
rustup target add x86_64-unknown-linux-musl; \
|
||||
echo "TARGET_ARCH=x86_64-unknown-linux-musl" > /target_arch.env; \
|
||||
elif [ "$arch" = "aarch64" ]; then \
|
||||
rustup target add aarch64-unknown-linux-musl; \
|
||||
echo "TARGET_ARCH=aarch64-unknown-linux-musl" > /target_arch.env; \
|
||||
else \
|
||||
echo "Unsupported architecture: $arch"; \
|
||||
exit 1; \
|
||||
fi
|
||||
#
|
||||
RUN apt update && apt install -y git musl-tools musl-dev
|
||||
RUN update-ca-certificates
|
||||
RUN git clone https://github.com/t3chn0m4g3/honeyaml /opt/honeyaml
|
||||
#
|
||||
WORKDIR /opt/honeyaml
|
||||
# Load target architecture from file and build
|
||||
RUN . /target_arch.env && \
|
||||
cargo build --target "$TARGET_ARCH" --release && \
|
||||
cp target/"$TARGET_ARCH"/release/honeyaml /opt/honeyaml/
|
||||
#
|
||||
FROM alpine:3.20
|
||||
#
|
||||
COPY --from=builder /opt/honeyaml/honeyaml /opt/honeyaml/
|
||||
COPY --from=builder /opt/honeyaml/api.yml /opt/honeyaml/
|
||||
#
|
||||
# Setup user, groups and configs
|
||||
RUN <<EOF
|
||||
addgroup -g 2000 honeyaml
|
||||
adduser -S -s /bin/ash -u 2000 -D -g 2000 honeyaml
|
||||
EOF
|
||||
#
|
||||
STOPSIGNAL SIGINT
|
||||
USER honeyaml:honeyaml
|
||||
WORKDIR /opt/honeyaml
|
||||
CMD ["./honeyaml", "-d", "/opt/honeyaml/log"]
|
20
docker/honeyaml/docker-compose.yml
Normal file
20
docker/honeyaml/docker-compose.yml
Normal file
@ -0,0 +1,20 @@
|
||||
networks:
|
||||
honeyaml_local:
|
||||
|
||||
services:
|
||||
|
||||
# Honeyaml service
|
||||
honeyaml:
|
||||
build: .
|
||||
container_name: honeyaml
|
||||
restart: always
|
||||
# cpu_count: 1
|
||||
# cpus: 0.25
|
||||
networks:
|
||||
- honeyaml_local
|
||||
ports:
|
||||
- "8080:8080"
|
||||
image: dtagdevsec/honeyaml:24.04
|
||||
read_only: true
|
||||
volumes:
|
||||
- $HOME/tpotce/data/honeyaml/log/:/opt/honeyaml/log/
|
Reference in New Issue
Block a user