-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (78 loc) · 3.28 KB
/
msf-docker-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Publish MSF Docker images
on:
schedule:
- cron: '0 5 1 * *'
release:
types:
- published
jobs:
push_metasploit_images_to_registry:
environment: production
name: Push Metasploit Docker images to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Check out the Metasploit Framework repo
uses: actions/checkout@v4
with:
repository: rapid7/metasploit-framework
path: metasploit-framework
- name: Switch to the latest MSF tag
id: metasploit_setup
run: |
cd metasploit-framework
git fetch --tags
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
latest_minor_tag=${latest_tag%.*}
latest_major_tag=${latest_minor_tag%.*}
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
echo "latest_minor_tag=$latest_minor_tag" >> $GITHUB_OUTPUT
echo "latest_major_tag=$latest_major_tag" >> $GITHUB_OUTPUT
git checkout $latest_tag
- name: Build and push Docker image for Metasploit Framework
uses: docker/build-push-action@v5
with:
context: ./metasploit-framework
push: true
platforms: linux/amd64,linux/arm64
tags: |
sadparad1se/metasploit-framework:${{ steps.metasploit_setup.outputs.latest_tag }}
sadparad1se/metasploit-framework:${{ steps.metasploit_setup.outputs.latest_minor_tag }}
sadparad1se/metasploit-framework:${{ steps.metasploit_setup.outputs.latest_major_tag }}
sadparad1se/metasploit-framework:latest
cache-from: type=registry,ref=sadparad1se/metasploit-framework:latest
labels: |
msf-version=${{ steps.metasploit_setup.outputs.latest_tag }}
snek-sploit-commit=$GITHUB_SHA
- name: Check out the current repo
uses: actions/checkout@v4
- name: Build and push Docker image for MSF running RPC
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
sadparad1se/metasploit-framework:rpc-${{ steps.metasploit_setup.outputs.latest_tag }}
sadparad1se/metasploit-framework:rpc-${{ steps.metasploit_setup.outputs.latest_minor_tag }}
sadparad1se/metasploit-framework:rpc-${{ steps.metasploit_setup.outputs.latest_major_tag }}
sadparad1se/metasploit-framework:rpc
cache-from: type=registry,ref=sadparad1se/metasploit-framework:rpc
labels: |
msf-version=${{ steps.metasploit_setup.outputs.latest_tag }}
snek-sploit-commit=$GITHUB_SHA
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: sadparad1se/metasploit-framework
readme-filepath: ./docker/README.md