-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
# Start from the official Python slim image | ||
FROM python:3.8-slim | ||
|
||
# Arguments for non-interactive installation and setting timezone | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ENV CONTAINER_TIMEZONE=UTC | ||
ENV TZ=${CONTAINER_TIMEZONE} | ||
ENV SHELL /bin/bash | ||
|
||
# Install basic dependencies and set up environment in one RUN command | ||
RUN apt-get update && apt-get install -y \ | ||
libcurl4-nss-dev libssl-dev git sudo ssh rubygems python3-pip \ | ||
npm php default-jdk pipenv rsync jo libpq-dev curl wget unzip \ | ||
ca-certificates curl tar gnupg dirmng && \ | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
tar \ | ||
gnupg \ | ||
dirmngr \ | ||
libcurl4-nss-dev \ | ||
libssl-dev \ | ||
git \ | ||
sudo \ | ||
ssh \ | ||
rubygems \ | ||
python3-pip \ | ||
npm \ | ||
php \ | ||
default-jdk \ | ||
pipenv \ | ||
rsync \ | ||
jo \ | ||
libpq-dev \ | ||
wget \ | ||
unzip && \ | ||
ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && \ | ||
echo $CONTAINER_TIMEZONE > /etc/timezone && \ | ||
ssh-keyscan github.com >> /etc/ssh/ssh_known_hosts && \ | ||
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config | ||
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Set Go version | ||
ARG GO_VERSION=latest | ||
|
||
# Download and install Go based on the architecture | ||
RUN ARCH=$(dpkg --print-architecture) && \ | ||
if [ "$ARCH" = "amd64" ]; then \ | ||
GO_ARCH=amd64; \ | ||
|
@@ -34,6 +59,8 @@ RUN ARCH=$(dpkg --print-architecture) && \ | |
# Set up Go environment variables | ||
ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
||
# Verify Go installation | ||
RUN go version | ||
|
||
# Install Ruby gem, Python, and Node.js packages | ||
RUN gem install brakeman && \ | ||
|
@@ -42,7 +69,8 @@ RUN gem install brakeman && \ | |
npm install -g jshint | ||
|
||
# Clone repositories and set up projects | ||
RUN --mount=type=ssh git clone -b checkmate3-cli [email protected]:topcodersonline-solutions/checkmate-ce /checkmate && \ | ||
|
||
RUN --mount=type=ssh git clone -b checkmate3-cli [email protected]:topcodersonline-solutions/checkmate-ce /checkmate && --mount=type=ssh git clone [email protected]:topcodersonline-solutions/betterscan-ce /srv/betterscan \ | ||
cd /checkmate && \ | ||
python3 setup.py install && \ | ||
--mount=type=ssh git clone [email protected]:topcodersonline-solutions/trufflehog3-oss.git /root/trufflehog3-oss && \ | ||
|
@@ -53,7 +81,7 @@ RUN gem install brakeman && \ | |
--mount=type=ssh git clone [email protected]:topcodersonline-solutions/ptpt /root/ptpt && \ | ||
cd /root/ptpt && \ | ||
go build && \ | ||
cp /root/ptpt/ptpt /root/bin/ptpt | ||
cp /root/ptpt/ptpt /usr/local/bin/ptpt | ||
|
||
# Set up additional tools | ||
RUN wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.41.0/pmd-bin-6.41.0.zip && \ | ||
|
@@ -69,14 +97,13 @@ RUN wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.41.0/pmd- | |
mkdir /root/yara && \ | ||
cp -pr /srv/betterscan/analyzers/yara/* /root/yara && \ | ||
go install honnef.co/go/tools/cmd/staticcheck@latest && \ | ||
cp /root/go/bin/staticcheck /root/bin/staticcheck && \ | ||
cp /root/go/bin/staticcheck /usr/local/bin/staticcheck && \ | ||
curl -s https://raw.githubusercontent.com/aquasecurity/tfsec/master/scripts/install_linux.sh | bash && \ | ||
curl -s https://raw.githubusercontent.com/armosec/kubescape/master/install.sh | bash | ||
|
||
|
||
# Clean up | ||
RUN apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Final working directory | ||
WORKDIR /root | ||
|