Admin Actions
Admin Actions CLI
This CLI is able to send email reminders to active users that have any upcoming or outstanding Assessments, Data Calls, Issues, Tasks, Security Plans and Workflows in RegScale. (NOTE: Requires release 4.11.0 or greater and the user must have email notifications enabled.)
send_reminders
- query RegScale for any upcoming and outstanding Assessments, Data Calls, Issues, Tasks, Security Plans, and Workflows and sends an email to the users of their pipeline.update_compliance_history
- Update the compliance score for a given RegScale System Security Plan
Init.yaml Configuration
There is only one piece of information regarding the reminder CLI:
maxThreads
- Number of threads to use during the query and email process, default is 1000. (NOTE: Changing this number may have a positive or negative impact on performance.)
The first step is to set the number of desired maxThreads in init.yaml.
Next, execute the command to send the reminders as demonstrated below.
Example Commands
Log into RegScale to set the token which is good for 24 hours and will secure all future RegScale API calls (NOTE: You can skip this step if you are using a RegScale Service Account)
regscale login
Query RegScale using a set number of days, if no days were used the CLI defaults to 30 days.
regscale admin_actions send_reminders
--days
The number of days to look ahead for upcoming items and the number if days ago for workflows started
regscale admin_actions send_reminders
- If
--days
wasn't used, 30 will be used by default
- If
Update a RegScale System Security Plan providing the ID and module from RegScale.
update_compliance_history
--regscale_id
The ID number from RegScale that needs to have the compliance score updated. This should be a numerical value.--regscale_module
The module where the ID is found, for examples please see modules here: RegScale Modules
Init.yaml Example
The following init.yaml
structure is necessary (example/notional key structure shown below, replace with actual customer keys):
domain: https://mycompany.regscale.com
token: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.eyJzdWIiOiJhYmVsYXJkbyJ9.b-ao0bpoc6CiJ3ygG8-XOk_gwn8BehAcuLGaPB6rlu8
maxThreads: 1000
Building a Bash Script to Execute the CLI
You can execute RegScale CLI commands using scripts. These scripts could be in Bash, Python, PowerShell, etc. Below is an example Bash file (named "regscaleReminders.sh") in Ubuntu for executing the Reminder CLI that pulls all outstanding and upcoming Assessments, Data Plans, Issues, Security Plans, and Tasks from RegScale:
#!/bin/sh
# Send email reminders to users with outstanding and upcoming Assessments,
# Data Plans, Issues, Security Plans, and Tasks in the next 45 days from RegScale
regscale admin_actions send_reminders --days 45
To execute the Bash file, run this command: /path/to/folder/regscaleReminders.sh
. You can chain together any arbitrary set of CLI commands to have them execute sequentially.
Updated 12 months ago