Coder Social home page Coder Social logo

aftra-cli's Introduction

aftra-cli

Public API go binary for integration with AFTRA

Env Variables:

  • AFTRA_API_TOKEN: Token for communicating with the AFTRA api

  • AFTRA_COMPANY: Company ID associated with the token (Retrieved using aftra-cli get token company)

  • AFTRA_HOST: Location of the host. Used during testing of the CLI client.

Rebuilding the openapi-based structs

  • go generate ./...

To add additional items to the subset of openapi schema being used, edit PATHS in subset_maker.py

Example usage

Command Description
aftra-cli create opportunity Create an internal opportunity in Aftra
aftra-cli submit <scan-type> <scan-name> --message <msg> Submit a raw scan event to the specified scanner
aftra-cli submit <scan-type> <scan-name> --filename <filename> Submit a file of raw scan events to the specified scanner
aftra-cli get token Get current token information in json format
aftra-cli get company Get current token company information only
aftra-cli get config <scan-type> Get all scan configs
aftra-cli get config <scan-type> <scan-name> Get a scan config
aftra-cli get opportunities --limit=<limit> --updated-since=<datetime> Filter all opportunities
aftra-cli update resolution <uid> <status> --comment <comment> Update the resolution status of an opportunity
aftra-cli log <scan-type> <scan-name> <msg> Log the contents of msg to Aftra. It will be viewable viat the API
your_command.sh | aftra-cli log <scan-type> <scan-name> Log from stdout to Aftra. It will be viewable viat the API

Create opportunity

  • uid: This should uniquely identify the opportunity. Creating with the same uid will result in an update to the existing one.
  • details: Additional information in the form of key,value pairs. These are presented to the user in Aftra.
  • name: The display name for the opportunity.
  • score: Risk score (critical, high, medium, low, info, none, unknown)

Fetching opportunities

aftra-cli get opportunities --limit=10 --updated-since=2020-01-01T00:00:00Z

Getting started

  1. Export your token as AFTRA_API_TOKEN

    $ export AFTRA_API_TOKEN=<token>

  2. Export company id as AFTRA_COMPANY

    $ export AFTRA_COMPANY=$(aftra-cli get company)

  3. (Optional) Get any config required, and put somewhere that your script uses. The name is that defined on the config via the web UI.

    $ aftra-cli get config syndis myscanner > config.ini

  4. Create an opportunity (optional)

    $ aftra-cli create opportunity --uid=<uid> --name=<name> --score=<score> --details=<details>

  5. Submit results directly, to be converted into opportunities (optional)

    $ aftra-cli submit syndis myscanner -f <json-filename>

  6. Log out messages from stdin

    $ ./my_opportunity_finder.sh | aftra-cli log syndis myscanner

aftra-cli's People

Contributors

alexcouper avatar sindrig avatar

Watchers

 avatar  avatar

Forkers

nielsing jakobant

aftra-cli's Issues

Feature Request: Get all configs

Request from syndis to be able to look up configs available from the command line:

aftra-cli get config syndis
[{"name": "atGaur"}, {"name": "syndis-scan")]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.