Skip to content

Commit

Permalink
Merge pull request #261 from rackerlabs/add-hourly-scan-capability
Browse files Browse the repository at this point in the history
Add suppport for hourly scanning
  • Loading branch information
derpadoo authored May 13, 2021
2 parents 4c3c496 + 440004f commit ee8e22e
Show file tree
Hide file tree
Showing 18 changed files with 2,246 additions and 90 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ The recommendation is to deploy the console first.

#### Update Console Ansible Variables

Edit any variables in these files before running playbook:
Edit any variables in `ansible-playbooks/group_vars/all` before running playbook. Note the time zone variables:

* `timezone_server` - Set this to be the timezone you want the server to be in, usually UTC.
* `timezone_django` - Set this to be your local timezone. It makes dealing with dates, times, and scheduling easier.

* `ansible-playbooks/group_vars/all`

If you plan on utilizing the same API key across all engines (not recommended, but easier for automated deployments),
change `utilize_static_api_token_across_engines` to `True`. This prevents you from having to log into each engine and
update `engine_config.json` with the corresponding API key. The `group_vars/static_api_key` will be created by the
Expand All @@ -134,11 +135,11 @@ API key found in `group_vars/static_api_key`.
more than 1 engine, you won't run into complications with engine name collisions. You will, however, need to add create
the user on the console, since the console returns scheduled jobs to the engine based off the engine's name!

#### Update Console Secrets Variables

Rename `console/scantron_secrets.json.empty` to `console/scantron_secrets.json` (should be done for you by
`initial_setup.sh`)

#### Update Console Secrets Variables

Update all the values `console/scantron_secrets.json` if you do not like ones generated using `initial_setup.sh`. Only
the `production` values are used.

Expand Down Expand Up @@ -586,6 +587,16 @@ the 1st or 9th ports.
![create_scan](./img/create_scan.png)
You can use the `console/scan_scheduler_visualizer.py` script found on the console to print out scheduled scan
times:
```bash
# Print out the scan start dates and times for all enabled scans in the next 10 days.
cd /home/scantron/console
source .venv/bin/activate
python scan_scheduler_visualizer.py -d 10
```
5. View currently executing scan results
```bash
Expand Down
6 changes: 6 additions & 0 deletions ansible-playbooks/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ install_masscan_on_engine: True
# instead of having to logging into every engine and updating engine/engine_config.json
# This is less secure!
utilize_static_api_token_across_engines: False

# timezone used for the server's OS.
timezone_server: UTC

# timezone used for the Django application's TIME_ZONE setting. Should be your local timezone.
timezone_django: America/Chicago
4 changes: 2 additions & 2 deletions ansible-playbooks/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
command: update-grub2
when: disable_ipv6

- name: Set timezone.
- name: Set server timezone.
timezone:
name: "{{ timezone }}"
name: "{{ timezone_server }}"

- name: Reboot the box in 1 minute
command: shutdown -r 1
Expand Down
1 change: 0 additions & 1 deletion ansible-playbooks/roles/common/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
enable_ufw_firewall: true
reboot_box: false
disable_ipv6: false # breaks nginx install
timezone: UTC

# apt packages
install_packages:
Expand Down
Loading

0 comments on commit ee8e22e

Please sign in to comment.