Add answers in bulk to Ransomware Scorecard questions
This procedure helps you to add answers to the Ransomware Scorecard questions in bulk and also associate the correct answer to each question. You must first create a CSV file of answers and then add it to the Ransomware Scorecard using the utility
The loadRswQuestionAnsFile utility provides an ability to bulk load Ransomware answers corresponding to the questions you loaded. This utility takes as input a comma-separated values (CSV) file. You have to load the questions before you can add the answers for the question..
This CSV file becomes the key document of record for custom Ransomware questions and answers. Hence, you must preserve it in a working directory for future updates.
To create the CSV file of answers, create a spreadsheet table in the format shown below. Save it as a CSV file (for example answers.csv) in a working directory. This file is essential to map the answers to their respective Ransomware question accurately.
Table: Headers and description of CSV file for answers
QuestionID | AnswerID | Answer | Score |
|---|---|---|---|
Enter the question identifier to which the answer identifier has to be mapped. This question identifier must match with the identifier value in the CSV created for questions. | Enter the answer identifier that you want to link to the QuestionID. The QuestionID and AnswerID must form a unique pair. If there are multiple answers to the same question, create a unique AnswerID for each answer and associate it with the same QuestionID. | Enter the answer to the question. If there are multiple answers, enter each value on a separate row so that it associates with a unique AnswerID. | Enter the score associated with each answer. |
A typical CSV file to add multiple answers in bulk can appear as below.
Table: Headers and description of CSV file for answers
QuestionID | AnswerID | Answer | Score |
|---|---|---|---|
QUES001 | ANS001 | Yes | 4 |
QUES001 | ANS002 | No | 0 |
QUES002 | ANS001 | Yes | 4 |
QUES002 | ANS002 | No | 0 |
QUES003 | ANS001 | Yes | 4 |
QUES003 | ANS002 | No | 0 |
QUES004 | ANS001 | Yes | 4 |
QUES004 | ANS002 | Kind of | 3 |
QUES004 | ANS003 | Not that strict | 2 |
QUES004 | ANS004 | No | 0 |
QUES005 | ANS001 | Yes | 4 |
QUES005 | ANS002 | No | 0 |
The bulk add utility must be run in SQL Plus as APTARE user.
The load_package utility is located in:
/opt/aptare/database/stored_procedureson Linux\opt\oracle\database\stored_procedureson Windows
To load questions and answer to ransomware score card
- Login to the Portal server.
- At the command line, run:
su -aptare
- At the command line, launch SQL Plus
sqlplus <pwd>/<pwd>@//localhost:1521/scdb
For example:
sqlplus portal/portal@//localhost:1521/scdb
- Run this command at the SQL prompt.
SQL> Execute load_package. loadRswQuestionAnsFile ('domain_name', 'pathname_and_filename','log_path_name', 'log_file_name', 'Type');In the above command:
domain_name
Name (enclosed in single straight quotes) of the domain in which the host groups and hosts reside. (Example: 'DomainEMEA')
pathname_and_filename
Full path + filename (enclosed in single straight quotes) of the CSV file
Windows Example: 'c:\temp\answers.csv'
Linux Example: '/tmp/answers.csv'
log_path_name
Full path (enclosed in single straight quotes) where the log file will be created/updated; verify that you have write access to this directory.
Optional: If a log path and filename are not specified, log records are written to
scon.logandscon.err. To omit this parameter, enter: Example: 'c:\temp' or '/tmp'log_file_name
Log file name enclosed in single straight quotes.
Optional: If a log path and filename are not specified, entries are written to
scon.logandscon.err.To omit this parameter, enter: '' Example: answers.log'
type
'Answers' of the questions loaded in bulk.
Example:
SQL> load_package.loadRswQuestionAnsFile ('INSTALLWIN2012','/tmp/questions.csv','/tmp', 'questions.log','Answers'); - Check the log file for status and errors.
- Restart the Portal services so that the newly added questions are available in Ransomware Scorecard.
- Verify that the bulk adding of questions was successful: In the Portal, go to Reports > Ransomware -> Ransomware Scorecard. Select a questions you want to view and click 'Answer Question'.