diff --git a/.github/workflows/docker-hub-base.yml b/.github/workflows/docker-hub-base.yml new file mode 100644 index 0000000..a99a43e --- /dev/null +++ b/.github/workflows/docker-hub-base.yml @@ -0,0 +1,43 @@ +name: Publish Docker Base image + +on: + schedule: + - cron: '0 0 * * MON' + workflow_dispatch: + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - + name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - + name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v1 + with: + images: ${{ secrets.DOCKER_REPO }} + + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile-base + push: true + platforms: linux/amd64,linux/arm64 + tags: mcnamee/huntkit-base:latest diff --git a/Dockerfile-base b/Dockerfile-base new file mode 100644 index 0000000..c82e9c3 --- /dev/null +++ b/Dockerfile-base @@ -0,0 +1,129 @@ +FROM ubuntu + +LABEL maintainer="Matt McNamee" + +# Environment Variables +ENV HOME=/root +ENV GO111MODULE=on +ENV GOROOT=/usr/local/go +ENV GOPATH=/go +ENV PATH=${HOME}/:${GOPATH}/bin:${GOROOT}/bin:${PATH} +ENV DEBIAN_FRONTEND=noninteractive + +# Create working dirs +WORKDIR /root + +# ------------------------------ +# --- Common Dependencies --- +# ------------------------------ + +# Install Essentials +RUN apt-get update && \ + apt-get install -y --no-install-recommends --fix-missing \ + apt-utils \ + awscli \ + build-essential \ + curl \ + dnsutils \ + gcc \ + git \ + iputils-ping \ + jq \ + libgmp-dev \ + libpcap-dev \ + make \ + nano \ + netcat \ + net-tools \ + nodejs \ + npm \ + perl \ + php \ + proxychains \ + python3 \ + python3-pip \ + ssh \ + tor \ + tmux \ + tzdata \ + wget \ + whois \ + zip \ + unzip \ + zsh && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install tools & dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends --fix-missing \ + brutespray \ + crunch \ + dirb \ + ftp \ + hping3 \ + hydra \ + nikto \ + nmap \ + smbclient \ + sqlmap \ + # johntheripper + libssl-dev \ + yasm \ + pkg-config \ + libbz2-dev \ + # Metasploit + gnupg2 \ + # OpenVPN + openvpn \ + easy-rsa \ + # wpscan + libcurl4-openssl-dev \ + libxml2 \ + libxml2-dev \ + libxslt1-dev \ + ruby-dev \ + zlib1g-dev \ + # zsh + fonts-powerline \ + powerline && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install go +RUN cd /opt && \ + ARCH=$( arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/ ) && \ + wget https://dl.google.com/go/go1.21.1.linux-${ARCH}.tar.gz && \ + tar -xvf go1.21.1.linux-${ARCH}.tar.gz && \ + rm -rf /opt/go1.21.1.linux-${ARCH}.tar.gz && \ + mv go /usr/local + +# Install Python common dependencies +RUN python3 -m pip install --upgrade setuptools wheel paramiko + +# Install ZSH +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \ + chsh -s $(which zsh) + +# ------------------------------ +# --- Config --- +# ------------------------------ + +# Set timezone +RUN ln -fs /usr/share/zoneinfo/Australia/Sydney /etc/localtime && \ + dpkg-reconfigure --frontend noninteractive tzdata + +# ZSH config +RUN sed -i 's^ZSH_THEME="robbyrussell"^ZSH_THEME="bira"^g' ~/.zshrc && \ + sed -i 's^# DISABLE_UPDATE_PROMPT="true"^DISABLE_UPDATE_PROMPT="true"^g' ~/.zshrc && \ + sed -i 's^# DISABLE_AUTO_UPDATE="true"^DISABLE_AUTO_UPDATE="true"^g' ~/.zshrc && \ + sed -i 's^plugins=(git)^plugins=(tmux nmap)^g' ~/.zshrc && \ + echo 'export EDITOR="nano"' >> ~/.zshrc && \ + git config --global oh-my-zsh.hide-info 1 + +# ------------------------------ +# --- Finished --- +# ------------------------------ + +# Start up commands +CMD ["/bin/zsh"]