How to Integrate Mayhem for API Into Your CircleCI Pipeline

James Kessler
November 3, 2022
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

If you are using Circle CI for your build pipelines, you can now scan your APIs by adding our official orb. This orb downloads the latest version of Mayhem and scans your API. Failures are recorded as junit results, which can be stored in CircleCI using the store_test_results step.

We recommend using this to ensure no security vulnerabilities or crashes are present before merging code into your default branch.

Adding the Mayhem for API Orb

version: 2.1
orbs:
mapi: forallsecure/mapi@1.0.0

Create a new job to scan your API and start your service. Then call the `mapi/scan` command to run Mayhem against your service.

jobs:
mayhem-for-api:
machine:
image: ubuntu-2204:2022.07.1
steps:
# Start your service
- run:
command: start-service.sh &
# Scan your API with Mayhem for API
- mapi/scan:
api-url: "http://localhost:8000"
api-spec: "https://demo-api.mayhem4api.forallsecure.com/api/v3/openapi.json"
- store_artifacts:
path: /tmp/mapi
- store_test_results:
path: /tmp/mapi/junit.xml

Then add the new job to your workflow.

workflows:
tests-and-security:
jobs:
- mayhem-for-api

Mayhem will now fuzz your API, report failures as test results, and ensure your code is and remains secure.

undefined



You can find more documentation on Mayhem continuous integration here.

Share this post

Get a Demo

Or let us know if you have any questions

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Complete API Security in 5 Minutes

Get started with Mayhem today for fast, comprehensive, API security. 

Get Mayhem

Maximize Code Coverage in Minutes

Mayhem is an award-winning AI that autonomously finds new exploitable bugs and improves your test suites.

Get Mayhem