forked from external-repos/velociraptor-docker
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
03eae29332 | |||
62e5f14296 | |||
ddb725c428 | |||
![]() |
3b496fa09c | ||
![]() |
ac179036e8 | ||
![]() |
6ac2a06a6e | ||
![]() |
66984ae017 | ||
![]() |
6da375b2ad | ||
![]() |
e45e662d0e | ||
![]() |
126cda1b71 | ||
![]() |
37dcd0a327 | ||
![]() |
8b87da02e0 | ||
![]() |
1bf216ea5a | ||
![]() |
355c73deb9 | ||
![]() |
cd5e5ceb1b | ||
![]() |
150fdc5c91 | ||
![]() |
a1d60ecda3 | ||
![]() |
79319b614a |
52
.gitea/workflows/build-and-push.yml
Normal file
52
.gitea/workflows/build-and-push.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install system Dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y curl jq docker.io
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.portal.tulsacounty.org
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: gitea.portal.tulsacounty.org/${{ gitea.repository }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=sha,prefix={{branch}}-
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
17
Dockerfile
17
Dockerfile
@@ -1,5 +1,5 @@
|
||||
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 maintainer="Wes Lambert, @therealwlambert"
|
||||
COPY ./entrypoint .
|
||||
@@ -10,17 +10,16 @@ RUN chmod +x entrypoint && \
|
||||
mkdir -p /opt/velociraptor && \
|
||||
for i in linux mac windows; do mkdir -p /opt/velociraptor/$i; done && \
|
||||
# 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_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") )))') && \
|
||||
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") )))') && \
|
||||
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") )))') && \
|
||||
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 '[.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 '[.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 '[.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/mac/velociraptor_client "$MAC_BIN" && \
|
||||
wget -O /opt/velociraptor/windows/velociraptor_client.exe "$WINDOWS_EXE" && \
|
||||
wget -O /opt/velociraptor/windows/velociraptor_client.msi "$WINDOWS_MSI" && \
|
||||
# Clean up
|
||||
apt-get remove -y --purge curl wget jq && \
|
||||
# Clean up
|
||||
apt-get remove -y --purge wget && \
|
||||
apt-get clean
|
||||
WORKDIR /velociraptor
|
||||
WORKDIR /velociraptor
|
||||
CMD ["/entrypoint"]
|
||||
|
||||
|
@@ -27,4 +27,5 @@ To pull only the Docker image:
|
||||
|
||||
To pull a specific version of the Docker image:
|
||||
|
||||
`docker pull wlambert/velociraptor:0.6.8-2`
|
||||
`docker pull wlambert/velociraptor:0.73.4`
|
||||
a
|
12
entrypoint
12
entrypoint
@@ -21,11 +21,23 @@ if [ ! -f server.config.yaml ]; then
|
||||
./velociraptor --config server.config.yaml user add $VELOX_USER $VELOX_PASSWORD --role $VELOX_ROLE
|
||||
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
|
||||
./velociraptor --config server.config.yaml config client > client.config.yaml
|
||||
|
||||
# Repack clients
|
||||
./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/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
|
||||
|
Reference in New Issue
Block a user