Skip to content

StructArmed Converter

boundwize/structarmed - GitHub

Note

Available since version 1.19.0

Table Of Contents

  1. Requirements
  2. Installation
  3. Usage
  4. Learn more
  5. Web SARIF viewer

structarmed converter

Requirements

{
    "require-dev": {
        "boundwize/structarmed": "^0.22"
    }
}

Installation

composer require --dev boundwize/structarmed bartlett/sarif-php-converters

Usage

Warning

As StructArmed is not able to specify/boot custom renderer, we have no other alternative that using the Console Tool convert command.

Build the JSON output report

vendor/bin/structarmed init --preset=psr4
vendor/bin/structarmed analyse /path/to/source/code --basepath /path/to/source/code --report=json --summary > examples/structarmed/native-analysis.json
# or
vendor/bin/structarmed analyse /path/to/source/code --basepath /path/to/source/code --config /path/to/structarmed.php --report=json --summary > examples/structarmed/native-analysis.json

And finally, convert it to SARIF with the Console Tool

php report-converter convert structarmed --input-format=json --input-file=examples/structarmed/native-analysis.json -v

Tip

  • Without verbose option (-v) the Console Tool will print a compact SARIF version.
  • --output-file option allows to write a copy of the report to a file. By default, the Console Tool will always print the specified report to the standard output.

Learn more

Web SARIF viewer

With the React based component, you are able to explore a sarif report file previously generated.

For example:

sarif-web-structarmed