Commit Graph

121 Commits

Author SHA1 Message Date
Bader Boland
56bba70ef3 Add ability to exclude individual tests 2020-01-24 08:53:34 -05:00
Robert Brennan
5ef97ae896 fix lint errors 2020-01-14 14:50:35 +00:00
Robert Brennan
dfa34e1880 explicitly handle schema validation errors 2020-01-14 14:50:35 +00:00
Robert Brennan
542694841a change resolveCheck signature 2020-01-14 14:50:35 +00:00
Robert Brennan
e6a44c6ff8 formatting change 2020-01-14 14:50:35 +00:00
Robert Brennan
7637108234 refactor ValidateContainers 2020-01-14 14:50:34 +00:00
Robert Brennan
23bf4c81b0 refactor ValidatePod, add NakedPod type 2020-01-14 14:50:34 +00:00
Robert Brennan
090700f641 minor tweaks 2020-01-14 14:50:34 +00:00
Robert Brennan
e129ba6971 fix dashboard after output change 2020-01-14 14:50:34 +00:00
Robert Brennan
51cd3523fc messages -> results 2020-01-14 14:50:34 +00:00
Robert Brennan
83a7448c99 add namespaces to controllers 2020-01-14 14:50:34 +00:00
Robert Brennan
d228acfe71 add object meta to controller interface 2020-01-14 14:50:34 +00:00
Robert Brennan
49c540e993 type -> kind 2020-01-14 14:50:34 +00:00
Robert Brennan
9f7caabef4 change message type to boolean 2020-01-14 14:50:34 +00:00
Robert Brennan
2770be643f Refactor validation 2020-01-14 14:50:34 +00:00
Robert Brennan
917e630697 move some tests 2020-01-02 20:49:51 +00:00
Robert Brennan
57ff1d5c06 remove messages 2020-01-02 20:07:55 +00:00
Robert Brennan
04da47d83e change input config to simplify things 2020-01-02 17:55:21 +00:00
Robert Brennan
5efa416ea9 implement custom checks, implement resource ranges as custom check 2020-01-02 17:55:21 +00:00
Robert Brennan
7b0fe81d01 implement capabilities checks in JSON schema 2020-01-02 17:55:21 +00:00
Robert Brennan
7cc0be4188 remove unused function 2019-12-23 21:16:59 +00:00
Robert Brennan
b0035158d2 fix lint errors 2019-12-23 20:57:48 +00:00
Robert Brennan
f7dccc079b move more security checks to jsonschema 2019-12-23 20:32:38 +00:00
Robert Brennan
ad3a8e6748 move runAsRootAllowed over to jsonschema 2019-12-23 20:32:38 +00:00
Robert Brennan
3fa627a2cd move networking checks over to json schema 2019-12-23 20:32:38 +00:00
Robert Brennan
30b49c4d7b implement image checks using json schema 2019-12-23 20:32:38 +00:00
Robert Brennan
f2c5752718 migrate health checks to schemas 2019-12-23 20:32:38 +00:00
Robert Brennan
3304285b4e move rest of pod checks over to schema 2019-12-23 20:32:38 +00:00
Robert Brennan
d80d326f7c swap out host_network for a schema-based check 2019-12-23 20:32:38 +00:00
Robert Brennan
67ab987f7e Add support for annotation-based exemptions (#227)
* add controllers_to_scan to example config-full

* add support for annotation-based exemptions

* fix lint errors

* add docs
2019-12-06 08:29:30 -05:00
Robert Brennan
98b47e0aeb Fix resource success messages (#223)
* add success messages when resources are set

* add tests
2019-11-13 14:07:32 -05:00
Robert Brennan
4eeabb2c7f pass RunAsNonRoot if RunAsUser > 0 (#219) 2019-11-11 13:21:32 -05:00
Robert Brennan
22ab851681 skip health checks for jobs, cronjobs, and initContainers (#216) 2019-11-06 13:31:17 -05:00
Robert Brennan
2b15f11d57 Add exemptions to config (#204)
* first pass at adding exemptions

* Update config.yaml

* make config_test more reliable

* add flag to disallow exemptions in dashboard

* add disallow-exemptions flag to CLI

* add comments

* fix exemptions flag

* fix alert on dashboard

* minor style changes
2019-10-23 17:14:03 -04:00
Robert Brennan
434b1f604f Create capabilitiesAdded and capabilitiesDropped IDs (#207)
* ensure check IDs are unique

* create capabilitiesAdded and capabilitiesDropped check IDs
2019-10-02 08:51:47 -04:00
Robert Brennan
c91a85a08a add IDs to each check (#197) 2019-09-11 14:07:08 -04:00
Will Ledingham
b8422a93b7 Wl/stored audits (#188)
* added ability to run dashboard from a stored audit result file.

* added ability to run dashboard from a stored audit result file.

* more changes

* debugging

* de

* all working as anticipated locally

* .

* updated way of decoding YAML/JSON files.

* remmoved unneded code

* renamed fn names, moved logic around and cleaned up main.go

* deleted output files from weird places.

* deleted test file
2019-08-14 17:20:19 -04:00
Nick Huanca
75f70352ba Additional Pod Controller Scans (#166)
**Changes**

- Refactored the way controllers work to be an interface
- Added configurable controllers to include in scans
- Added daemonsets, jobs and cronjobs in scans
- Added `ReplicationController` type controllers to the supported list
- Adjusted logic for failed YAML parsing to bubble up errors
- Added better logic for calculating summaries on cluster wide results
- Relocated responsibilities for counting types into validators vs spreading it around more packages
- Fixed bug where cronjob parsing was using wrong KIND
- Added fixtures for mocking new controller types
- Added example yamls to test scanning files
- Added functions to NamespacedResult(s) to reduce code complexity deep set iterations
- Refactored how results get added to namespacedresults so adding more later is easier
- Minor signature changes for interface implementing structs for controllers
2019-07-31 15:56:27 -06:00
Bobby Brennan
20bd32afb6 Rename ReactiveOps to Fairwinds (#180)
* Rename ReactiveOps to Fairwinds

* Rename ReactiveOps to Fairwinds
2019-07-30 15:29:09 -04:00
Will Ledingham
819b77ae1a Pod tests (#177)
* add pod test

* add pod test 2

* update tests

* Added pod tests for configured Host IPC, Host PID, and Host Newtowrk.

* Fixed expected vs. actual mixup
2019-07-25 09:31:37 -04:00
Nick Huanca
4c7429efbc #146 Fixing Container Security Context Logic (#149)
* Fixing Container Security Context Logic

Kubernetes rationalizes Container Security Context in conjunction with the
Pod Spec Security Context. In this scenario you can 'leave out' certain
security context settings and rely on the pod spec definition to still
set these settings for you. The RunAsNonRoot setting originally only checked
to see if the value was set at the container level, vs also checking if it
was enabled at the pod level.

I have attached the container's parent pod spec to the container validate
struct in case any other things like this arise in the future.

I have also refactored the logic for validating bool pointers, since these
can be tricky, if you want to avoid dereferences pointer issues.

Changes:
- Added parent pod spec of container to validate certain settings which affect container spec
- Refactored the logic statements for validating bool pointers (used helpers)
- Added tests for this pod.container.securityContext condition
2019-06-18 11:04:38 -06:00
Bobby Brennan
ebfb4ea9a1 Add support for stateful sets (#145) 2019-06-13 07:59:01 -06:00
Bobby Brennan
ca4b45451f re-bump output version 2019-06-10 14:43:15 +00:00
Bobby Brennan
1d6248180e add display-name flag 2019-06-10 14:39:24 +00:00
Bobby Brennan
7cfa13f285 Better support for CI/CD use case (#127)
add score to output

add output-format option

update README with more use cases

change YAML marshal strategy

fix webhook install instructions
2019-06-10 10:13:10 -04:00
Rob Scott
9a03f87c0b adding exception for init container resource checks 2019-05-23 16:50:37 +02:00
Rob Scott
f5c7087d6d ensuring that readiness probes in init containers are not validated to fix #112 2019-05-20 21:35:44 +02:00
Rob Scott
02d4444196 updating error message for resource presence checks, updating deployment config to pass with 100% 2019-05-13 22:33:35 -04:00
Bobby Brennan
9bcb832bbd rename all the things 2019-05-09 15:59:23 +00:00
Bobby Brennan
520d6572e4 Add ability to audit a directory of files (#70)
* refactor kubernetes API usage

* add ability to audit directory

* refactor a bit

* fix return statement

* fix main.go

* add ability to audit multiple resources in a single file
2019-05-07 12:42:57 -04:00