Workflow file for this run
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
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 |