52 Commits
Author SHA1 Message Date
Vitor Rodrigo VezaniandAndy Suderman 073847559a Add --merge-config flag to support merging with default configuration (#1075)
* add config merge support

* fix indentation

* Update cmd/polaris/root.go

Co-authored-by: Andy Suderman <andy@fairwinds.com>

---------

Co-authored-by: Andy Suderman <andy@fairwinds.com>
2024-10-22 15:31:18 -03:00
Vitor Rodrigo Vezani ac638e01ba FWI-5820 - remove packr in favor of go:embed (#1035)
* move dashboard to embed

* use embed in favor of packr

* fix references

* Fix error creating router in dashboard.go

* create default config

* remove examples/config.yaml
2024-03-12 16:11:07 -03:00
Eng Zer JunandAndrew Suderman 8bc1a4bcde refactor: move from io/ioutil to io and os packages (#858)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Co-authored-by: Andrew Suderman <andrew@sudermanjr.com>
2022-11-16 16:28:09 -05:00
Andrew Suderman 78838a606d Add a --namespace flag to the in-cluster audit (#742) 2022-04-08 07:54:03 -06:00
Barnabas Makonda a4c0b0f555 Add mutation field to imagePolicyNotAlways (#712)
* added mutation field in checks and config

* added test

* fix tests

* revert resolve export

* remove Patched resources as moving that to separate functionality apart from validation

* go mod tidy

* move mutation to the container level

* change prefix based on the resource kind

* collect all mutations from results and apply

* added test for cronjob and deployment apart from just pod

* test cronjob prefix

* return a copy of mutation

* fix tests and comments

* address feedback comments

* fix warning formating

* refactor getJSONSchemaPrefix function
2022-03-25 16:38:58 +03:00
nobletrout f429f1922a Nobletrout/add kubectx support (#719)
* See #699 add support for kubecontext selection

* Update cli.md
2022-03-15 09:24:24 -04:00
Maxime VISONNEAUandRobert Brennan 32c1150b28 config: new flags '--disallow-(config|annotation)-exemptions' (#636)
This change follows up #635 and lets end-users decide to disallow exemption rules defined as part of the config file or the controller annotations (whether none, any or both). The main use case here is to be able to prevent users with edit privileges over a controller to add a new exemption rule through an annotation which may obfuscate the actual policies we want to enforce.

Signed-off-by: Maxime VISONNEAU <maxime.visonneau@gmail.com>

Co-authored-by: Robert Brennan <accounts@rbren.io>
2021-09-27 12:56:59 -04:00
skatika 272e06bbec Add ContainerNames to Exemption struct 2020-12-16 17:21:50 -05:00
skatika ca6e4b43e4 Rename to receivers to same name 2020-12-16 15:53:22 -05:00
Markus Blaschkeandbaderbuddy 5bce1db05e Implement namespace support for exceptions (#421)
* Implement namespace support for exceptions

Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>

* remove debug

Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>

* Add documentation

Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>

Co-authored-by: baderbuddy <bader@fairwinds.com>
2020-10-19 08:45:45 -04:00
Robert Brennan 5705f81911 throw error when severity isn't set for custom check (#360)
* throw error when severity isn't set for custom check

* fix syntax
2020-06-22 16:53:15 -04:00
Robert Brennan 3e9c270ac7 fix zero-state (#341)
* fix zero-state

* fix lint error

* fix denom checks
2020-06-10 16:53:40 -04:00
Robert Brennan 9d81c393de Pack config.yaml in Docker (#298)
* update examples

* pack config.yaml in Docker
2020-05-18 17:16:16 -04:00
Robert BrennanandRobert Brennan 6792fba91f Delete controllers package (#270)
* rename root fs check

* speed up docker build

* refactor webhook to be more generic

* delete controllers pkg

* revert deploy

* fix example config

* remove controllersToScan config

* fix lint error

* fix webhook name

* FileSystem -> Filesystem

* update deps

* skip node owners

* clean up meta tracking

Co-authored-by: Robert Brennan <bobby.brennan@gmail.com>
2020-04-27 10:43:02 -04:00
Robert Brennan f8d5ce70cf support schemas that use json strings 2020-01-02 18:59:11 +00:00
Robert Brennan 5f060801ef remove unused config structs 2020-01-02 17:58:22 +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 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 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 c91a85a08a add IDs to each check (#197) 2019-09-11 14:07:08 -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
Will Ledingham fae7a9fc17 Merge branch 'master' into wl/config-URL 2019-07-30 17:02:02 -04:00
Will Ledingham 79b0a00d5c more edits 2019-07-30 16:59:11 -04:00
Will Ledingham e4fe5ab085 more edits 2019-07-30 16:45:49 -04:00
Will Ledingham 2049698c8e small edit 2019-07-30 16:37:24 -04: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 c132f7ee51 more edits 2019-07-29 13:29:53 -04:00
Will Ledingham baa652197a Fixed error handling in ParseFile, added a test for parseFile where no Http server is configured 2019-07-29 10:33:27 -04:00
Will Ledingham 7b8b5fee4d expanded ParseFile function to include URL's and added a test for it. 2019-07-25 16:31:17 -04:00
Bobby Brennan 1d6248180e add display-name flag 2019-06-10 14:39:24 +00:00
Bobby Brennan 79f3d2cb74 use packr for config.yaml 2019-05-17 14:34:53 +00:00
Rob Scott 674696c7e1 restructuring config to match up with docs 2019-04-22 12:58:25 -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
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
Rob Scott 3de9493b68 initial implementation of updated configuration syntax 2019-03-27 22:55:31 -04: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
jessicagreben 5f7130d1e0 add host port validation 2019-02-13 09:04:13 -08:00
Rob Scott 9d3f78e420 including successes in dashboard output 2019-01-28 23:23:32 -05:00
jessicagreben 21e7d2b0f8 make PR comment changes 2019-01-03 07:33:20 -08:00
jessicagreben fcf9b20ab6 fix comment 2018-12-31 11:34:04 -08:00
jessicagreben c3bbbde631 add image and healthcheck config and checks 2018-12-31 11:21:46 -08:00
Rob Scott d1ec730afd improved config parsing, removing viper 2018-12-28 15:18:59 -05:00
Rob Scott 823e460965 lots of restructuring to add ContainerValidation type 2018-12-21 12:44:05 -05:00
Rob Scott eabae4d5d2 updating golang to 1.11.4 along with a lot of dependency updates, updating config parsing to work with resource requests and limits 2018-12-19 10:58:49 -05:00