Commit Graph

97 Commits

Author SHA1 Message Date
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
Bobby Brennan
244a1dedcd DeploymentResult -> ControllerResult 2019-05-02 19:18:29 +00:00
Bobby Brennan
1282359b04 create DeploymentResult type 2019-05-02 18:07:01 +00:00
Rob Scott
40e1c1f827 adding image pull policy validation 2019-05-01 16:00:59 -04:00
Rob Scott
0db0e2947f some additional cleanup 2019-04-29 10:58:30 -04:00
Rob Scott
4fe39e7b74 improved logging, better webhook output, webhook deploy fixes 2019-04-26 17:35:14 -04:00
Bobby Brennan
55363fd7a8 Add categories to dashboard
add version, cluster stats to output

add comment

update UI

changes to summary aggregation

add category summaries to dash
2019-04-23 15:07:50 +00:00
Rob Scott
674696c7e1 restructuring config to match up with docs 2019-04-22 12:58:25 -04:00
Bobby Brennan
3ce7e12082 Add version, cluster stats to output and UI (#61)
* add version, cluster stats to output

* add comment

* fix tests

* add categories to messages

* fix tests

* update UI

* remove empty category totals field

* k8smeta -> metav1
2019-04-22 12:01:18 -04:00
Bobby Brennan
8326a49b5a change message variable names 2019-04-12 15:13:46 +00:00
Bobby Brennan
bcff5f10bc pull out messages into separate file, some rephrasing
phrasing

fix tests
2019-04-12 14:56:25 +00:00
Rob Scott
0a33875962 cleaning up default config, fixing a small bug 2019-04-05 15:57:51 -04:00
Rob Scott
9cfd2b6417 security validation fixes and more thorough tests 2019-04-05 15:10:11 -04:00
Rob Scott
3ea06b81ee security validations fully working 2019-04-05 15:10:11 -04:00
Rob Scott
82164105d7 initial work on security validations 2019-04-05 15:10:00 -04:00
Bobby Brennan
e4dd53d1c0 Add audit mode to CLI
Add option to send audit results to a remote host

add audit flag to print results to stdout

add comments

make comments more consistent

move audit test

fix fullaudit_test

add test instructions to README

update audit test

simplify stdout output

update comment

fix import

run audit by default
2019-04-03 18:58:00 +00:00
Rob Scott
d607d48d28 adding MessageType for use in place of Severity in relevant places 2019-03-28 12:16:15 -04:00
Rob Scott
5d5f8c24b2 moving webhook logic into new webhook package, attempting to detect namespace fairwinds webhook is deployed in 2019-03-28 10:17:21 -04:00
Rob Scott
f5cde2db38 a lot of cleanup and restructuring 2019-03-27 22:57:01 -04:00
Rob Scott
f04883539a updating resource config syntax 2019-03-27 22:55:31 -04:00
Rob Scott
6d49d0e19c updating logic to work with new config syntax 2019-03-27 22:55:31 -04:00
Bobby Brennan
deacad7724 move UI code into pkg/dashboard 2019-03-15 13:25:19 +00:00
jessicagreben
97844d552b fix network mssg wording 2019-02-13 14:51:12 -08:00
jessicagreben
7195793ff5 add network test 2019-02-13 14:33:47 -08:00
jessicagreben
16409c097d add pod host networking validations 2019-02-13 10:58:30 -08:00