Commit Graph

14 Commits

Author SHA1 Message Date
Cody Jackson 2f58374c39 Ensure skipping works for multiple cis versions
We validating the security scan config appropriately when
a version was already present in the skip list. This now
ensures a version exists before verifying that it contains an array.

We were also replacing the existing skip object in the
security-scan-config which prevented us from storing
multiple versions at a time. We now extend the object
instead using the spread operator.

rancher/rancher#24733
rancher/rancher#24742
2019-12-23 10:14:07 -07:00
Cody Jackson 51c1d34dfa Provide empty configMap when it can't be retrieved
When the user doesn't have access to the systemProject we just
return an empty configMap so the page can proceed without error.

We also disable the runScan button if the systemProject isn't available.

rancher/rancher#24644
2019-12-20 16:10:12 -07:00
Cody Jackson 867239fa1b Conditionally show node links in CIS Scans
If nodes have been deleted previous reports with missing nodes were
breaking. To resolve that we now only show links to nodes that we can
find.

rancher/rancher#24676
2019-12-20 09:14:16 -07:00
Cody Jackson 3fb931ee46 Update the downloaded report
The downloaded report now has:
- A column for passed_nodes
- A column for failed_nodes
- A column for all nodes the test ran against
- The benchmark version in the header

rancher/rancher#24671
2019-12-19 16:52:33 -07:00
Cody Jackson c8e3649c68 Remove config map validation from run scan
Because the scan will ignore an invalid config map I'm removing
the validation from run scan so the UI can run the scan without issue.

rancher/rancher#24496
2019-12-16 14:08:07 -07:00
Cody Jackson 84d50d3aad lint:fix 2019-12-14 22:39:01 -07:00
Cody Jackson 49a6a2f555 Fix running cis scan and change the color of running state
The new API required that I pass null instead of an empty array
as the skiplist if nothing is supposed to be skipped when
running a scan.

Updated the color of the running state to info instead of success
as requested.
2019-12-14 22:08:41 -07:00
Cody Jackson fbb24bbffa Adding support for the nodes field in the CIS report
When a test is a Mixed state we now look at the nodes field
to determine which nodes passed and failed.
2019-12-14 22:08:41 -07:00
Cody Jackson 91bd0498d7 Provide more feedback when a security config is malformed
We provide an error notification when the security config is malformed and
the user attempts to run a scan. We also prevent the scan from running.

We also added a default sort by 'id' on the scan detail table.

rancher/rancher#24495
rancher/rancher#24496
2019-12-11 16:42:07 -07:00
Cody Jackson 65fb6148ef Create default config map if it's not present.
If the security-config map wasn't present the detail view wouldn't work
properly. To resolve this we now create a new config map if it's not
present.

rancher/rancher#24432
2019-12-06 10:30:46 -07:00
Cody Jackson 84618ae41e Resolve lint issues. 2019-12-05 14:50:19 -07:00
Cody Jackson 9838e9da91 Add failed to parse security-scan-cfg growl
This will ensure the user is notified when there's a json
parsing error of their security-scan-cfg config map.

The notification will happen during page load and if
they attempt to skip/unskip.

rancher/rancher#24417
2019-12-05 14:50:19 -07:00
Cody Jackson 1698346518 Fix CIS detail table id sorting
This allows the id column to sort as if the ids are versions instead of
plain strings. This allows 1.1.2 to come before 1.1.10 when sorting.

rancher/rancher#24417
2019-12-05 14:50:19 -07:00
Cody Jackson 5126642250 Implement the list and detail views for CIS scan
This adds and implements the /c/<clusterid>/cis/scan
and /c/<clusterid>/cis/scan/detail/<scanid> routes.

rancher/rancher#20425
2019-12-02 14:45:56 -07:00