Skip to content

Commit

Permalink
Setup a base image
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnamee committed Mar 12, 2024
1 parent dccb715 commit fa9b68d
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-hub-base.yml
Original file line number Diff line number Diff line change
@@ -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
129 changes: 129 additions & 0 deletions Dockerfile-base
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit fa9b68d

Please sign in to comment.