Giter Site home page Giter Site logo

upload_to_platform's Introduction

Risksense - Upload to Platform

Download version 1.1.3

Requirements

  • Python 3

    • This script has been tested using Python 3.7+
  • Python Modules (recommend to install using pip):

    • toml
    • urllib3
    • requests
    • progressbar2

    pip install -r requirements.txt

Overview

This Python script enables the upload of scan files to the RiskSense platform via the RiskSense API.

When run, the script will take all files from a designated folder, upload them to the RiskSense platform, and begin processing of those files. Once the files have been successfully uploaded, the files will be moved into an "archive" subfolder within the original folder.

Scan File Support

A common question: "Does this script support uploading scan files from scanner xyz?"

In short, yes. The script does not perform any enforcement of supported scan file type, and defers to the RiskSense platform for scan file support. In other words, the script will upload any scan file it finds, regardless of file type, and lets the RiskSense platform sort it out.

Usage

Editing the configuration file (conf/config.toml):
  • Update the platform field as necessary.
  • Add your API token.
  • If it is known, you can provide the ID of the desired network (not the network name), and the user will not be prompted to provide or find it.
  • Additionally, if the desired Client ID is known, you can provide it in the config file, and the script will not ask the user about it.
  • If desired, change the paths of the folders containing the files to process and log file.
    • If you specify a custom path_to_files, be sure to create a subfolder named "archive" within the folder specified.
platform = 'https://platform.risksense.com'

# The API Token can be generated in the RiskSense UI, under User Settings.
api-key = ''

# Specify the path to the folder containing the files you wish to upload.
# If you update this, please use the absolute path to your desired folder.
files_folder = 'files_to_process'

# Specify the path to the folder you would like to use for logging.
# If you update this, please use the absolute path to your desired folder.
log_folder = 'logs'

# Trigger URBA upon completion of upload processing.
auto_urba = true

# You may uncomment this parameter and enter the desired network ID for your upload here if you already know it.
#network_id =

# You may uncomment this parameter and enter the desired client ID for your upload here if you already know it.
#client_id =

use_proxy = false

[proxy]
    host = ''
    port = 3128
    authentication = false
    user = ''
    password = ''
Running upload_to_platform.py:

After configuring the script, it can be executed as follows:

python upload_to_platform.py
Advanced Usage

Any of the settings found in the configuration file can be overridden through the use of arguments at the time of execution.


python upload_to_platform.py -h



         *** RiskSense -- upload_to_platform_v1.1.3 ***
Upload scan files to the RiskSense platform via the RiskSense API.
------------------------------------------------------------------

usage: upload_to_platform.py [-h] [-p PLATFORM] [-a API_KEY] [-f FILES_FOLDER]
                             [-l LOG_FOLDER] [-u {true,false}] [-c CLIENT_ID]
                             [-n NETWORK_ID] [--use_proxy USE_PROXY]
                             [--proxy_host PROXY_HOST]
                             [--proxy_port PROXY_PORT]
                             [--proxy_auth PROXY_AUTH]
                             [--proxy_user PROXY_USER] [--proxy_pwd PROXY_PWD]

The following arguments can be used to override those in the config file:

optional arguments:
  -h, --help                                    show this help message and
                                                exit
  -p PLATFORM, --platform PLATFORM              Platform URL
  -a API_KEY, --api_key API_KEY                 API Key
  -f FILES_FOLDER, --files_folder FILES_FOLDER  Path to folder containing scan
                                                files
  -l LOG_FOLDER, --log_folder LOG_FOLDER        Path to folder to write log
  -u {true,false}, --auto_urba {true,false}     Run auto-URBA?
  -c CLIENT_ID, --client_id CLIENT_ID           Client ID
  -n NETWORK_ID, --network_id NETWORK_ID        Network ID
  --use_proxy USE_PROXY                         Use Proxy?
  --proxy_host PROXY_HOST                       Proxy host
  --proxy_port PROXY_PORT                       Proxy port
  --proxy_auth PROXY_AUTH                       Use proxy authentication?
  --proxy_user PROXY_USER                       Proxy username
  --proxy_pwd PROXY_PWD                         Proxy password

Example -- overriding the network ID and scan file folder found in the config

python upload_to_platform.py -n 12345 -f /home/johndoe/nessus_files

upload_to_platform's People

Contributors

burrwebb avatar rs-bcogan avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

James Cloos avatar Christopher Acton avatar  avatar  avatar  avatar  avatar

upload_to_platform's Issues

Error when only one network available?

There may be an issue in which the script does not recognize when a client only has one network available for upload. To investigate and fix if necessary.

Workaround: Set the network ID in the configuration file to bypass the script asking the user which network to use.

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.