You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A GitHub Action walk through for using Mayhem for Code to check for reliability, performance, and security issues in your application binary (packaged as a containerized [Docker](https://docs.docker.com/get-started/overview/) image) as a part of a CI pipeline.
5
+
A GitHub Action walk through for using Mayhem to check for reliability, performance, and security issues in your application binary (packaged as a containerized [Docker](https://docs.docker.com/get-started/overview/) image) as a part of a CI pipeline.
6
6
7
-
Visit the [Mayhem for Code GitHub Action](https://github.com/ForAllSecure/mcode-action/) to get more details on integrating Mayhem into your CI pipeline!
7
+
Visit the [Mayhem GitHub Action](https://github.com/ForAllSecure/mcode-action/) to get more details on integrating Mayhem into your CI pipeline!
8
8
9
9
## Example GitHub Actions Integration
10
10
11
-
In this example, we've provided two targets that will be built, fuzzed, and fixed/patched to showcase a multi-target Mayhem for Code Action workflow within a CI pipeline: [Lighttpd](https://www.lighttpd.net/) version `1.4.15` and one of our `mayhem-example` targets, [c-base-executable](https://github.com/ForAllSecure/mayhem-examples/tree/main/c/base-executable/c-base-executable).
11
+
In this example, we've provided two targets that will be built, fuzzed, and fixed/patched to showcase a multi-target Mayhem Action workflow within a CI pipeline: [Lighttpd](https://www.lighttpd.net/) version `1.4.15` and one of our `mayhem-example` targets, [c-base-executable](https://github.com/ForAllSecure/mayhem-examples/tree/main/c/base-executable/c-base-executable).
12
12
13
13
In particular, `lighttpd` version `1.4.15` was found to have vulnerabilities in the past, which were fixed in subsequent updates such as `1.4.52`. In tandem, our `c-base-executable` target has a bug that performs an `abort()` once a test case containing the string `bug` is input to the program, which we'll also fix in this example. Ultimately, we'll be using Mayhem in a CI pipeline to simulate a typical developer workflow in which we build and fuzz targets within a workflow to find and prove vulnerabilities exist within a target application, and then submit a subsequent PR to fix these vulnerabilities, which are confirmed via Mayhem's regression testing (crashing test cases of previous Mayhem runs for a target application are re-used again in future Mayhem runs of the same target) and accompanied by new behavior testing for the updated target application.
14
14
15
15
We have two branches in this repository: `main` and `vulnerable`.
16
16
17
-
> When executing a new workflow/pipeline using the Mayhem for Code GitHub Action, the corresponding `lighttpd` and `c-base-executable` targets will be built within a Docker image, which is pushed to the GitHub Container Registry, and ingested by Mayhem to fuzz the containerized targets. This is done using a [multi-stage Docker image build](https://docs.docker.com/build/building/multi-stage/).
17
+
> When executing a new workflow/pipeline using the Mayhem GitHub Action, the corresponding `lighttpd` and `c-base-executable` targets will be built within a Docker image, which is pushed to the GitHub Container Registry, and ingested by Mayhem to fuzz the containerized targets. This is done using a [multi-stage Docker image build](https://docs.docker.com/build/building/multi-stage/).
18
18
19
19
The `main` branch contains the following targets:
20
20
21
21
***lighttpd 1.4.52**:
22
22
*[lighttpd 1.4.52 Dockerfile](https://github.com/ForAllSecure/mcode-action-examples/blob/main/mayhem/Dockerfile): Build instructions for settings up a containerized `lighttpd 1.4.52` application.
23
-
*[lighttpd 1.4.52 Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/main/mayhem/Mayhemfile.lighttpd): Configuration options for the resulting `lighttpd 1.4.52` CI pipeline Mayhem run.
23
+
*[lighttpd 1.4.52 Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/main/mayhem/lighttpd.mayhemfile): Configuration options for the resulting `lighttpd 1.4.52` CI pipeline Mayhem run.
24
24
***c-base-executable**:
25
25
*[c-base-executable Dockerfile](https://github.com/ForAllSecure/mcode-action-examples/blob/main/mayhem/Dockerfile): Build instructions for setting up a containerized `c-base-executable` application.
26
-
*[c-base-executable Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/main/mayhem/Mayhemfile.mayhemit): Configuration options for the resulting `c-base-executable` CI pipeline Mayhem run.
26
+
*[c-base-executable Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/main/mayhem/mayhemit.mayhemfile): Configuration options for the resulting `c-base-executable` CI pipeline Mayhem run.
27
27
28
28
The `vulnerable` branch contains the following vulnerable targets:
29
29
30
30
***(vulnerable) lighttpd 1.4.15**:
31
31
*[lighttpd 1.4.15 Dockerfile](https://github.com/ForAllSecure/mcode-action-examples/blob/vulnerable/mayhem/Dockerfile): Build instructions for setting up a containerized `lighttpd 1.4.15` application.
32
-
*[lighttpd 1.4.15 Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/vulnerable/mayhem/Mayhemfile.lighttpd): Configuration options for the resulting `lighttpd 1.4.15` CI pipeline Mayhem run.
32
+
*[lighttpd 1.4.15 Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/vulnerable/mayhem/lighttpd.mayhemfile): Configuration options for the resulting `lighttpd 1.4.15` CI pipeline Mayhem run.
33
33
***(vulnerable) c-base-executable**:
34
34
*[c-base-executable Dockerfile](https://github.com/ForAllSecure/mcode-action-examples/blob/vulnerable/mayhem/Dockerfile): Build instructions for setting up a containerized (and vulnerable) `c-base-executable` application.
35
-
*[c-base-executable Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/vulnerable/mayhem/Mayhemfile.mayhemit): Configuration options for the resulting (vulnerable) `c-base-executable` CI pipeline Mayhem run.
35
+
*[c-base-executable Mayhemfile](https://github.com/ForAllSecure/mcode-action-examples/blob/vulnerable/mayhem/mayhemit.mayhemfile): Configuration options for the resulting (vulnerable) `c-base-executable` CI pipeline Mayhem run.
36
36
37
37
## Getting Started
38
38
@@ -53,7 +53,7 @@ The `vulnerable` branch contains the following vulnerable targets:
53
53
54
54
> **Note:** You may be required to set your package visibility settings to `Public` to give Mayhem permissions to ingest your Docker image from the GitHub Container Registry. Click on your package in the right-hand pane of your GitHub repository and go to *Package Settings*. Then, scroll down to *Package Visibility* and set the package to `Public`.
55
55
56
-
3. Now, switch to the `vulnerable` branch. Create a pull request and set the PR to merge to `main` (**for your forked repo**). The Mayhem for Code GitHub Action will automatically begin building and pushing the `(vulnerable) lighttpd 1.4.15` and `(vulnerable) c-base-executable` containerized applications to the GitHub Container Registry and use Mayhem to perform both regression testing and behavior testing for the updated target applications. Results can then be found in the PR or on the Mayhem server itself with more details about each specific run. Results can be found in the `Security` tab or on the Mayhem instance itself with more details about the specific run.
56
+
3. Now, switch to the `vulnerable` branch. Create a pull request and set the PR to merge to `main` (**for your forked repo**). The Mayhem GitHub Action will automatically begin building and pushing the `(vulnerable) lighttpd 1.4.15` and `(vulnerable) c-base-executable` containerized applications to the GitHub Container Registry and use Mayhem to perform both regression testing and behavior testing for the updated target applications. Results can then be found in the PR or on the Mayhem server itself with more details about each specific run. Results can be found in the `Security` tab or on the Mayhem instance itself with more details about the specific run.
57
57
58
58
Congrats! You just integrated Mayhem in a multi-target CI pipeline for the `lighttpd` and `c-base-executable` applications! Extrapolating from this, you should now be able to incorporate the same steps to integrate Mayhem into your own CI pipeline for your custom code.
0 commit comments