Mobb User Docs
Start NowBlogsWatch NowContact Us
  • What is Mobb?
  • What's New with Mobb
  • Supported Fixes
  • Getting Started
    • System Requirements
    • Onboarding Guide
      • Registering a Mobb account
      • Try Mobb now!
      • Running Mobb against your own code
      • Automate Mobb in a CI/CD pipeline
    • Working with the Fix Report
    • Mobb CLI Overview
      • Analyze Mode
      • Scan Mode
      • Add SCM Token Mode
      • Review Mode
      • Convert-to-SARIF Mode
      • Common Deployment Scenarios
  • Mobb Dashboard
  • Integrating SAST Findings
    • Checkmarx
      • Generating Checkmarx One JSON Report from CLI
    • Snyk
    • SonarQube
      • Generating a SonarQube SAST Report
    • Fortify
    • CodeQL
    • Semgrep/Opengrep
      • Generating a Semgrep SAST Report
      • Generating an Opengrep SAST Report
  • CI/CD Integrations
    • GitHub Actions
      • GitHub Fixer for CxOne
      • GitHub Fixer for Opengrep
    • GitLab Pipeline
    • Azure DevOps
    • Jenkins
    • CircleCI
    • Bamboo
    • Bitbucket Pipeline
    • Harness
  • Administration
    • User Management
    • Project Settings
    • Access Tokens
    • Organization-Level Fix Policy
    • Integrations Page
    • SAML Single Sign-On Flow
  • More Info
    • Mobb Broker
      • Mobb Broker Token Rotation
      • Secure storage of Mobb broker in AWS Secrets Manager
    • Providing Fix Feedback
    • Frequently Asked Questions (FAQ)
    • Data Protection and Retention
    • Service Level Agreement
  • Fixing Guides
    • SQL Injection
    • Path Traversal
    • Log Forging
    • XSS
    • XXE
    • Server Side Request Forgery
    • HttpOnly Cookie Vulnerabilities
    • Hardcoded Domain in HTML
    • Hardcoded Secrets
    • HTTP Response Splitting Attacks
    • Insecure Cookie Vulnerabilities
    • Insecure Randomness
    • Missing Check against Null
    • Missing Rate Limiting
    • Regex Missing Timeout
    • System Information Leakage
  • Mobb REST API Guide
Powered by GitBook
On this page
  • Setting Up Secrets in Harness
  • Creating the Harness Pipeline
  • Sample Pipeline YAML
  • Viewing the Mobb Report Link
  • Summary

Was this helpful?

  1. CI/CD Integrations

Harness

PreviousBitbucket PipelineNextAdministration

Last updated 2 days ago

Was this helpful?

Mobb can be integrated into any CI/CD platform of your choice. This guide will demonstrate how to integrate Mobb into a Harness CI pipeline using an existing SAST report.

Setting Up Secrets in Harness

  1. Go to your Harness project.

  2. Navigate to Project Setup → Secrets.

  3. Create the following secrets:

  • mobb-api-token – Mobb API Token. Learn how to generate one here.

  • (Optional) cx-token – if you’re using CheckmarxOne for SAST

Creating the Harness Pipeline

In this example, we'll run Checkmarx One as our SAST tool and pass the results to Mobb.

Sample Pipeline YAML

In this sample pipeline, we will run a CheckmarxOne SAST scan to look for vulnerabilities in the checked-out repository. After the scan is complete, the scan result cx_result.json is passed to Mobb for analysis and to generate a fix report.

pipeline:
  name: harness_pipeline
  identifier: harness_pipeline
  projectIdentifier: default_project
  orgIdentifier: default
  tags: {}
  properties:
    ci:
      codebase:
        connectorRef: antonychiu2
        repoName: webgoat
        build: <+input>
  stages:
    - stage:
        name: Checkmarx Scan and Fix
        identifier: Checkmarx
        description: ""
        type: CI
        spec:
          cloneCodebase: true
          caching:
            enabled: true
            override: true
            paths: []
          platform:
            os: Linux
            arch: Amd64
          runtime:
            type: Cloud
            spec: {}
          execution:
            steps:
              - step:
                  type: CheckmarxOne
                  name: CheckmarxOne_1
                  identifier: CheckmarxOne_1
                  spec:
                    mode: orchestration
                    config: default
                    target:
                      type: repository
                      detection: auto
                    advanced:
                      log:
                        level: info
                      fail_on_severity: none
                      args:
                        cli: "--output-path ."
                    auth:
                      access_token: <+secrets.getValue("org.cx-token")>
                      type: apiKey
                    tool:
                      project_name: Webgoat
              - step:
                  type: Run
                  name: Mobb Autofixer
                  identifier: Mobb_Autofixer
                  spec:
                    connectorRef: account.harnessImage
                    image: node:20
                    shell: Sh
                    command: |-
                      echo "Running Mobb with SAST report..."
 
                      npx mobbdev@latest analyze \
                        -f cx_result.json \
                        -r "$CI_REPO_REMOTE" \
                        --ref "$CI_COMMIT_BRANCH" \
                        --api-key <+secrets.getValue("org.mobb-api-token")> \
                        --ci
                  when:
                    stageStatus: All
          sharedPaths:
            - /shared
          buildIntelligence:
            enabled: false

Viewing the Mobb Report Link

Once the pipeline runs successfully, the Mobb report link will appear in the Harness Logs section for the "Mobb Autofixer" step.

You can click the link to open the relevant Mobb report, review the proposed fixes, and apply them back to your repository.

Summary

You are now fully configured to integrate Mobb into your Harness CI pipeline. Mobb will automatically read your SAST reports and generate fixes that you can review and commit with confidence.

For a list of supported SAST formats, visit the page.

System Requirements