From Nessus output to custom report

1. Create the project and return the project ID

Create a file called create_project.rb that contains the code below

    if ARGV.size != 1
      puts "Usage:\n\tRAILS_ENV=#{Rails.env} bundle exec rails runner #{$0} <project name>"
      exit 1
    end

    project = Project.new name: ARGV[0]

    if project.save
      project = Project.last
      puts project.id
      exit 0
    else
      puts project.errors.full_messages.join("\n")
      exit 2
    end

Using SCP, put this file into /opt/dradispro/dradispro/current/

2. Run the following commands in the console as "dradispro"

$ cd /opt/dradispro/dradispro/current/
$ RAILS_ENV=production bundle exec \
      rails runner \
      project.rb "Name of project"

Sub in the name you want for your project. After churning for a minute, the console will output the project ID. Hang on to that ID, you'll need it for the next two steps.

3. Use Thor to upload the Nessus file to the corresponding project.

Still in the console as "dradispro", run:

$ PROJECT_ID=# RAILS_ENV=production bundle exec thor \
dradis:plugins:nessus:upload FILE

Don't forget to substitute in the project ID and the actual file path to the nessus upload.

4. Use Thor to upload the Nessus file to the corresponding project.

Still in the console as "dradispro", run:

$ PROJECT_ID=# RAILS_ENV=production bundle exec \
      thor \
      dradis:export:advanced_word:docx \
      --output=OUTPUT \
      --template=TEMPLATE

Use that same project ID as before! Substitute it in to the command above.

5. Generate the report from the command line

For simplicity I'm going to ask you to check out this guide for more information on the output and template parameters: Generating the Report from the Command Line