MurphySec CLI Documentation

repository·v3·Indexed 23 days ago

https://github.com/murphysecurity/murphysec

A security tool for detecting vulnerable direct and indirect dependencies in software projects. It supports Java, JavaScript, and Golang, and can be used locally or integrated into CI/CD pipelines. Key features include dependency scanning via `murphysec scan`, binary scanning with `binscan`, Docker image scanning with `imagescan`, environment scanning via `envscan`, and SBOM generation in SPDX-JSON format using the `sbom` command.

Tokens
3.2K
Snippets
8
Records
29
Agent score
83%

What's inside MurphySec CLI

  1. Overview of MurphySec CLI features and supported languages

    v3

    MurphySec CLI is a tool for detecting vulnerable dependencies in projects. It can be used locally or integrated into CI/CD pipelines (e.g., Jenkins).

    Key Features:

    • Analyze direct and indirect dependencies.
    • Detect known vulnerabilities in project dependencies.

    Supported Languages:

    • Java
    • JavaScript
    • Golang

    Workflow:

    1. CLI parses manifests or builds the project to get dependency info.
    2. Dependency info is uploaded to the MurphySec server.
    3. Server identifies vulnerabilities using the MurphySec knowledge base.
    4. Results are viewed in the MurphySec platform.
  2. Scan projects for dependency vulnerabilities

    v3

    Use the murphysec scan command to analyze a project's dependencies (both direct and indirect) and detect known vulnerabilities. The CLI parses package management files or uses project builds to extract dependency information, which is then sent to the MurphySec server for analysis.

    Note: The CLI only sends dependency information and basic metadata; it does not upload your local source code.

    Basic Usage

    murphysec scan [your-project-path]

    Common Flags

    • --token: Specify the access token.
    • --log-level: Set the logging verbosity. Options: silent (default), error, warn, info, debug.
    • --json: Output the scan results in JSON format (hides detailed terminal output).
    • --task-id: Specify a Project ID for the scan.
    murphysec scan [your-project-path]
  3. Install the MurphySec CLI

    v3

    You can install the MurphySec CLI on Linux, OSX, or Windows using the following commands:

    Linux

    wget -q https://s.murphysec.com/release/install.sh -O - | /bin/bash

    OSX

    curl -fsSL https://s.murphysec.com/release/install.sh | /bin/bash

    Windows

    powershell -Command "iwr -useb https://s.murphysec.com/release/install.ps1 | iex"

    Troubleshooting Windows Installation: If you encounter the error PowerShell requires an execution policy of 'RemoteSigned', open PowerShell as an Administrator and run:

    Set-ExecutionPolicy RemoteSigned -scope CurrentUser

    Then retry the installation command.

    wget -q https://s.murphysec.com/release/install.sh -O - | /bin/bash
  4. Authenticate MurphySec CLI

    v3

    MurphySec CLI requires an access token from your MurphySec account. You can obtain a token from the MurphySec platform - Access Token page. There are two ways to authenticate:

    1. Interactive authentication: Run the login command and paste your token when prompted. This overwrites any existing token.
    2. Parameter authentication: Pass the token directly in your commands using the --token flag.
    #### Interactive authentication
    ```bash
    murphysec auth login

    Parameter Authentication

    murphysec scan --token <YOUR_TOKEN> [your-project-path]
  5. Authenticate the MurphySec CLI

    v3

    The CLI requires an access token from the MurphySec Console to function. You can obtain a token by logging into the MurphySec Console and navigating to Settings -> Access Token.

    There are two ways to authenticate:

    1. Interactive Login

    Run the following command and paste your token when prompted. This saves the token locally so you don't need to provide it for subsequent runs.

    murphysec auth login

    2. Command Line Argument

    Pass the token directly to the scan command using the --token flag.

    murphysec scan [your-project-path] --token YOUR_ACCESS_TOKEN
    murphysec auth login
  6. Install MurphySec CLI

    v3

    Install the MurphySec CLI using the official installation scripts for your operating system. Visit the GitHub Releases page for manual downloads.

    #### Linux
    
    ```bash
    wget -q https://s.murphysec.com/release/install.sh -O - | /bin/bash

    OSX

    curl -fsSL https://s.murphysec.com/release/install.sh | /bin/bash

    WINDOWS

    powershell -Command "iwr -useb https://s.murphysec.com/release/install.ps1 | iex"
  7. Run dependency vulnerability detection with murphysec scan

    v3

    Use the murphysec scan command to analyze project dependencies (including direct and indirect) and detect known vulnerabilities. The CLI obtains dependency information by building the project or parsing package manifest files.

    Note: The CLI only sends dependency information and basic project metadata to the server; it does not upload code snippets.

    murphysec scan [your-project-path]
  8. Reference: murphysec scan command flags

    v3

    Flags available for the murphysec scan DIR [flags] command.

    Flags:
      -h, --help   help for scan
          --json   json output
    
    Global Flags:
          --log-level string      specify log level, must be silent|error|warn|info|debug
          --no-log-file           do not write log file
          --server string         specify server address
          --token string          specify API token
      -v, --version               show version and exit
          --write-log-to string   specify log file path
  9. Supported languages and package managers

    v3

    MurphySec supports the following languages and their respective package management files:

    LanguagePackage ManagerRequired Files
    JavaMavenpom.xml
    JavaGradlebuild.gradle, build.gradle.kts
    GoGo Modulesgo.mod
    JavaScriptNPMpackage.json, package-lock.json
    JavaScriptYarnyarn.lock, package.json
    Pythonpiprequirements.txt
    PythonPoetrypoetry.lock
    PHPComposercomposer.lock
    RubyBundlerGemfile.lock, gems.locked
    .NETNuGetpackages.lock.json
    C#NuGetpackages.lock.json
    Objective-CCocoapodsPodfile.lock