guardrails
GuardRails CLI
Last updated 10 days ago by metr1ckzu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install guardrails 
SYNC missed versions from official npm registry.

oclif Version Downloads/week License

guardrails-cli

GuardRails CLI

Usage

cliToken is required to interact with GuardRails

Use $ guardrails config your-cli-token to config the cliToken

Config file locate at ~/.config/guardrails/config.json

$ npm install -g guardrails
$ guardrails COMMAND
running command...
$ guardrails (-v|--version|version)
guardrails/2.0.0 darwin-x64 node-v12.10.0
$ guardrails --help [COMMAND]
USAGE
  $ guardrails COMMAND
...

Commands

GuardRails config your-cli-token

config GuardRails CLI-token

USAGE
  $ guardrails config your-cli-token

ARGUMENTS
  CLITOKEN  guardrails cliToken

EXAMPLE
  $ guardrails config --help
  $ guardrails config your-cli-token

See code: src/commands/config.js

GuardRails help [COMMAND]

display help for guardrails

USAGE
  $ guardrails help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

GuardRails scan

trigger scanning for current directory

USAGE
  $ guardrails scan

OPTIONS
  -d, --dir=dir      directory that request to scan
  -j, --json         print only report as json
  -z, --zip          use zipped version of codebase for scan

EXAMPLES
  $ guardrails scan --help
  $ guardrails scan --dir=/Users/works/source-code/
  $ guardrails scan --dir=/Users/works/source-code/ --zip --json
  $ guardrails scan --dir=/Users/works/source-code/ --async

See code: src/commands/scan.js

Example

$ guardrails scan --dir=/Users/works/source-code/ --async

http://dashboard.guardrails.local/default/gh/username/repo-name/sha-abcdef123456890?type=cli
$ guardrails scan --dir=/Users/works/source-code/ --zip

Gathering git information... done
Archiving current directory... done
Getting signed URL for upload... done
Uploading zip file... done
Triggering scan... done
Polling the report...
Current status: queued
Current status: scanning
Current status: success
Current token:        your-api-token
Current dir:          /Users/works/source-code/
Current git HEAD SHA: sha-abcdef123456890
Git provider:         github
Git repository name:  repo-name

Report summary:
ID:              100
Created at:      2019-10-20T19:08:22.656Z
Total findings:  1
Execution time:  5029 milliseconds

Use "--json" flag to display raw report json
$ guardrails scan --dir=/Users/works/source-code/ --json

[
  {
    "engine": {
      "name": "guardrails-engine-general-detect-secrets",
      "version": "1.0.2"
    },
    "language": "general",
    "status": "success",
    "executionTime": 432,
    "issues": 0,
    "process": {
      "name": "detect-secrets",
      "version": "0.11.0"
    },
     "output": [
      {
        "type": "sast",
        "ruleId": "G104",
        "location": {
          "path": "main.go",
          "positions": {
            "begin": {
              "line": 35
            }
          }
        },
        "metadata": {
          "description": "\"Errors unhandled.\"",
          "severity": "LOW",
          "lineContent": ""
        }
      }
    ]
  },
  {
    "engine": {
      "name": "@guardrails/guardrails-engine-general-gr-secrets",
      "version": "1.0.1"
    },
    "language": "general",
    "status": "success",
    "executionTime": 57,
    "issues": 0,
    "process": {
      "name": "gr-secrets",
      "version": "2.1.0"
    },
    "output": []
  }
]

Current Tags

  • 2.1.0                                ...           latest (10 days ago)

4 Versions

  • 2.1.0                                ...           10 days ago
  • 1.0.2                                ...           7 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 10
Last Month 11
Dependencies (9)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |