12 Commits

Author SHA1 Message Date
weslambert
66984ae017 0.73.4 2025-03-05 22:03:02 -05:00
weslambert
6da375b2ad Merge pull request #29 from Matthijsy/patch-1
Add repacking to .deb and .rpm
2024-06-26 21:26:20 -04:00
Matthijs Vos
e45e662d0e Add repacking to .deb and .rpm 2024-06-19 14:49:40 +02:00
weslambert
126cda1b71 Merge pull request #26 from weslambert/fix/update_urls
Fix/update urls
2024-05-08 23:58:20 -04:00
weslambert
37dcd0a327 Update version 2024-05-08 23:50:05 -04:00
weslambert
8b87da02e0 Update URLs 2024-05-08 23:48:45 -04:00
weslambert
1bf216ea5a Merge pull request #25 from weslambert/fix/version_grab
Fix/version grab
2024-05-08 22:58:02 -04:00
weslambert
355c73deb9 Update download constraints 2024-05-08 22:54:06 -04:00
weslambert
cd5e5ceb1b Handle versions better 2024-05-08 22:48:51 -04:00
weslambert
150fdc5c91 Merge pull request #24 from Xboarder56/master
add: certificate renewal support
2024-04-24 21:00:54 -04:00
Garrett Beasley
a1d60ecda3 add: jq/curl back for certificate renewal checks 2024-04-24 14:57:27 -07:00
Garrett Beasley
79319b614a add: certificate renewal support 2024-04-24 14:56:10 -07:00
2 changed files with 20 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
FROM ubuntu:22.04 FROM ubuntu:22.04
LABEL version="Velociraptor v0.7.0" LABEL version="Velociraptor v0.73.4"
LABEL description="Velociraptor server in a Docker container" LABEL description="Velociraptor server in a Docker container"
LABEL maintainer="Wes Lambert, @therealwlambert" LABEL maintainer="Wes Lambert, @therealwlambert"
COPY ./entrypoint . COPY ./entrypoint .
@@ -10,17 +10,16 @@ RUN chmod +x entrypoint && \
mkdir -p /opt/velociraptor && \ mkdir -p /opt/velociraptor && \
for i in linux mac windows; do mkdir -p /opt/velociraptor/$i; done && \ for i in linux mac windows; do mkdir -p /opt/velociraptor/$i; done && \
# Get Velox binaries # Get Velox binaries
WINDOWS_EXE=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("windows-amd64.exe") )))') && \ WINDOWS_EXE=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r '[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test("windows-amd64.exe$"))][0]') && \
WINDOWS_MSI=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("windows-amd64.msi") )))') && \ WINDOWS_MSI=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r '[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test("windows-amd64.msi$"))][0]') && \
LINUX_BIN=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("linux-amd64") )))') && \ LINUX_BIN=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r '[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test("linux-amd64$"))][0]') && \
MAC_BIN=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r 'limit(1 ; ( .assets[].browser_download_url | select ( contains("darwin-amd64") )))') && \ MAC_BIN=$(curl -s https://api.github.com/repos/velocidex/velociraptor/releases/latest | jq -r '[.assets | sort_by(.created_at) | reverse | .[] | .browser_download_url | select(test("darwin-amd64$"))][0]') && \
wget -O /opt/velociraptor/linux/velociraptor "$LINUX_BIN" && \ wget -O /opt/velociraptor/linux/velociraptor "$LINUX_BIN" && \
wget -O /opt/velociraptor/mac/velociraptor_client "$MAC_BIN" && \ wget -O /opt/velociraptor/mac/velociraptor_client "$MAC_BIN" && \
wget -O /opt/velociraptor/windows/velociraptor_client.exe "$WINDOWS_EXE" && \ wget -O /opt/velociraptor/windows/velociraptor_client.exe "$WINDOWS_EXE" && \
wget -O /opt/velociraptor/windows/velociraptor_client.msi "$WINDOWS_MSI" && \ wget -O /opt/velociraptor/windows/velociraptor_client.msi "$WINDOWS_MSI" && \
# Clean up # Clean up
apt-get remove -y --purge curl wget jq && \ apt-get remove -y --purge wget && \
apt-get clean apt-get clean
WORKDIR /velociraptor WORKDIR /velociraptor
CMD ["/entrypoint"] CMD ["/entrypoint"]

View File

@@ -21,11 +21,23 @@ if [ ! -f server.config.yaml ]; then
./velociraptor --config server.config.yaml user add $VELOX_USER $VELOX_PASSWORD --role $VELOX_ROLE ./velociraptor --config server.config.yaml user add $VELOX_USER $VELOX_PASSWORD --role $VELOX_ROLE
fi fi
# Check Server Certificate Status, Re-generate if it's expiring in 24-hours or less
if true | ./velociraptor --config server.config.yaml config show --json | jq -r .Frontend.certificate | openssl x509 -text -enddate -noout -checkend 86400 >/dev/null; then
echo "Skipping renewal, certificate is not expired"
else
echo "Certificate is expired, rotating certificate."
./velociraptor --config ./server.config.yaml config rotate_key > /tmp/server.config.yaml
cp ./server.config.yaml ./server.config.yaml.bak
mv /tmp/server.config.yaml /velociraptor/.
fi
# Re-generate client config in case server config changed # Re-generate client config in case server config changed
./velociraptor --config server.config.yaml config client > client.config.yaml ./velociraptor --config server.config.yaml config client > client.config.yaml
# Repack clients # Repack clients
./velociraptor config repack --exe clients/linux/velociraptor_client client.config.yaml clients/linux/velociraptor_client_repacked ./velociraptor config repack --exe clients/linux/velociraptor_client client.config.yaml clients/linux/velociraptor_client_repacked
./velociraptor --config client.config.yaml debian client --output clients/linux/velociraptor_client_repacked.deb
./velociraptor --config client.config.yaml rpm client --output clients/linux/velociraptor_client_repacked.rpm
./velociraptor config repack --exe clients/mac/velociraptor_client client.config.yaml clients/mac/velociraptor_client_repacked ./velociraptor config repack --exe clients/mac/velociraptor_client client.config.yaml clients/mac/velociraptor_client_repacked
./velociraptor config repack --exe clients/windows/velociraptor_client.exe client.config.yaml clients/windows/velociraptor_client_repacked.exe ./velociraptor config repack --exe clients/windows/velociraptor_client.exe client.config.yaml clients/windows/velociraptor_client_repacked.exe
./velociraptor config repack --msi clients/windows/velociraptor_client.msi client.config.yaml clients/windows/velociraptor_client_repacked.msi ./velociraptor config repack --msi clients/windows/velociraptor_client.msi client.config.yaml clients/windows/velociraptor_client_repacked.msi