-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (103 loc) · 3.03 KB
/
mayhem.yml
File metadata and controls
118 lines (103 loc) · 3.03 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Mayhem
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # run at 1 AM UTC
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: 'build'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
shared: [false]
build_type: [Release]
include:
- os: ubuntu-latest
triplet: x64-linux
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Set lowercase image name
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
file: Dockerfile
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}
labels: ${{ steps.meta.outputs.labels }}
outputs:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}
mayhem:
needs: build
name: 'fuzz'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mayhemfile:
- mayhem/Mayhemfile.lighttpd
- mayhem/Mayhemfile.mayhemit
# Specify one or many Mayhemfiles here
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Start analysis for ${{ matrix.mayhemfile }}
id: run-mayhem
uses: ForAllSecure/mcode-action@v1
with:
mayhem-url: ${{ secrets.MAYHEM_URL }}
mayhem-token: ${{ secrets.MAYHEM_TOKEN }}
args: --image ${{ needs.build.outputs.image }} --file ${{ matrix.mayhemfile }} --duration 60
owner: forallsecure-demo
fail-on-defects: true
sarif-output: sarif
junit-output: junit
coverage-output: coverage
- name: Upload SARIF file(s)
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif
- name: Upload JUNIT file(s)
if: always()
uses: actions/upload-artifact@v4
with:
name: junit
path: junit
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: coverage/*.lcov
flags: vulnerability-tests
name: mayhem