Commit Graph

972 Commits

Author SHA1 Message Date
Robert Brennan
5ff5a2cf94 Update pkg/kube/resources_test.go
Co-authored-by: Vitor Rodrigo Vezani <vitor.vezani@fairwinds.com>
2023-03-02 15:34:25 -05:00
Robert Brennan
d46a8c86be preserve ordering of resources 2023-03-02 11:07:53 -05:00
fsl
6abfbb3570 Update package-lock.json (#923)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-21 09:24:09 -05:00
fsl
b75db7fc5b Bump golang.org/x/net from 0.6.0 to 0.7.0 (#922)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-21 08:50:39 -05:00
fsl
501744a65f Skip https certificate verification (#920)
Signed-off-by: fengshunli <1171313930@qq.com>
2023-02-17 15:10:28 -05:00
Andrew Suderman
9a678b46e2 update alpine (#918) 7.3.2 2023-02-09 12:13:23 -07:00
Robert Brennan
80c433478b update go modules (#917)
* update go modules

* revert jsonschema

* fix quay token

* remove insights
7.3.1
2023-02-09 11:20:51 -05:00
Joseph Richardson
498ccf2215 Fix #908 by generating release name (#909) 2023-02-03 12:31:32 -05:00
Robert Brennan
bf065f9b54 Update dangerousCapabilities.yaml (#866) 2023-01-05 10:24:21 -07:00
Stevie
2d28ea551a sc/rd 71 add plg link (#896)
* Add persistentpostrun to root cmd and postrun to version cmd

* Change PLG link

* Add PLG link to dashboard

* <strong> the link

Co-authored-by: Andrew Suderman <andy@suderman.dev>
7.3.0
2023-01-05 09:33:45 -05:00
Robert Brennan
71b0e00288 Update documentation from template (#899)
Co-authored-by: Andrew Suderman <andy@suderman.dev>
2023-01-04 14:17:54 -07:00
Andrew Suderman
a1b63ac417 Fix #547 - add a check for topologySpreadConstraint (#879) 2023-01-04 14:05:23 -07:00
Robert Brennan
8af4363672 update dependencies (#898) 7.2.1 2023-01-04 10:10:09 -05:00
dependabot[bot]
c2d1b1cc4a Bump alpine from 3.16 to 3.17 (#885)
Bumps alpine from 3.16 to 3.17.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 08:50:35 -05:00
dependabot[bot]
81755e32ec Bump github.com/spf13/cobra from 1.6.0 to 1.6.1 (#870)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.6.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-17 14:56:41 -07:00
dependabot[bot]
531322c6b3 Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#869)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Suderman <andrew@sudermanjr.com>
2022-11-17 13:36:02 -07:00
Terraform User
e3f3254fe6 Managed by Terraform 2022-11-17 10:55:07 -07:00
Eng Zer Jun
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
ivanfetch-fw
467d06f4db FWI-2719: Enable new RBAC / sensitive content / Pod exec checks, add hasPrefix and hasSuffix functions to the GO template, exempt system: name prefixes for RBAC checks, sensitive content checks ignore valueFrom, (#832)
* Enable these checks in the default configuration file, which may produce many new results:
  * automountServiceAccountToken
  * linuxHardening
  * sensitiveConfigmapContent and sensitiveContainerEnvVar
  * clusterrolebindingClusterAdmin, rolebindingClusterAdminClusterRole, and rolebindingClusterAdminRole
  * clusterrolePodExecAttach, rolePodExecAttach, clusterrolebindingPodExecAttach, rolebindingClusterRolePodExecAttach, and  rolebindingRolePodExecAttach
* Ignore the `missingNetworkPolicy` and `automountServiceAccountToken` checks by default
* `hasPrefix` and `hasSuffix` functions are now available in the go template
* Fix the `sensitiveContainerEnvVar` check to ignore sensitive environment
variable names when those variables use `valueFrom` to reference an
external resource.
* Add the `*ClusterAdmin` checks to `examples/config-full.yaml`.
* Exempt the prefix `system:` instead of individual entries for RBAC checks (#871)
7.2.0
2022-11-14 15:05:02 -07:00
Terraform User
4091355e18 Managed by Terraform 7.1.6 2022-10-31 11:23:56 -06:00
Robert Brennan
6ef87be59b update dependencies (#867)
* update packages

* fix jsonschema
2022-10-19 08:28:36 -04:00
dependabot[bot]
587396a5c9 Bump k8s.io/api from 0.25.0 to 0.25.3 (#862)
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.25.0 to 0.25.3.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.25.0...v0.25.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 16:17:16 -04:00
ivanfetch-fw
45be5cbbef FWI-2912: Add logging to improve debugging of JSON Schema (#859)
* Add debug logging for JSON Schema validation and Go templating

* Fix `--help` to display the full Polaris usage

* add valid log possible levels to `--log-level` flag help
2022-10-05 11:22:42 -06:00
ivanfetch-fw
b3d842a1ba Fix CI tag filters and re-enable docs (#852)
* Re-enable build/push of documentation

* Define tag filters for all jobs in the workflow

* Fix 7e099521
2022-10-03 10:45:50 -06:00
ivanfetch-fw
29102deadf Build docker images using goreleaser and support arm64 (#845)
* Use goreleaser to build and push docker images

* Update CircleCI config to install goreleaser dependencies

* Update goreleaser.sh to create a temporary tag when CIRCLE_TAG is not set

* Update Dockerfile for goreleaser

* Update goreleaser.sh to trap errors and cleanup temporary git branch, for local runs

* Update goreleaser.sh to envsubst specific variables, to not break the `sign` section using signature and artifact variables

* Fix goreleaser.sh logic to only release when CIRCLE_TAG is set
2022-09-22 11:00:02 -06:00
Robert Brennan
68e27571fd fix packr (#851) 7.1.4 2022-09-22 11:53:42 -04:00
Robert Brennan
681ed3e272 fix goreleaser version 7.1.3 2022-09-22 11:41:40 -04:00
Robert Brennan
f6f85c765b update goreleaser (#850) 7.1.2 2022-09-22 11:38:30 -04:00
Robert Brennan
b6c6bbe893 update docs (#846) 7.1.1 2022-09-22 11:18:44 -04:00
Robert Brennan
8e7100acaf Add debug info to kube resources, better caching strategy (#840)
* add debug info

* remove extra build step

* try and fix memory usage

* fix pointers

* add more debug logs

* fix up caching for replicasets

* fix import

* replace info with debug

* add logs

* dont cache jobs

* gofmt

* fix import
7.1.0
2022-09-16 10:07:20 -04:00
Robert Brennan
42d2b3368b update deps (#841)
* update deps

* update go

* update to go 1.19

* fix cimg

* fix work dir

* fix golint

* revert jsonschema

* fix packr2
2022-09-15 15:32:43 -04:00
Barnabas Makonda
4d96993a18 [FWI-2357] Let Polaris modify YAML without losing comments/formatting (#821)
* added fix command implementation

* use node api

* fix tests

* added hostport mutate rule

* update mutating server

* fix array reference and add back leading slash

* added test and refactor findNodes

* more tests

* added more test and fix issue with arrays

* rename findNode function and ensure we capture exceptions

* rename findNode function

* append array value at the end and for single item remove brackets

* append array value at the end and for single item remove brackets

* create array if it does not exists

* fix tests

* handle some exceptions

* fix tests

* fix string format

* guard for PodResult

* fix flag name

* fix privilegeEscalation check

* fix up mutations for local files

* fix pod parsing

* fix object values

* remove logspam

* fix import

* update some comments for health probes

* add an option to not apply any mutations\, and just adjust yaml formatting

* add preliminary support for helm

* logspam

* change up comment strategy

* fix object comments

* format

* fix tests

* add comments

* fix key updates

* fix mutation tests

* tidy

* refactor test

* add test

* add test

* add test for object comments

Co-authored-by: Robert Brennan <accounts@rbren.io>
Co-authored-by: Robert Brennan <contact@rbren.io>
2022-09-15 12:38:22 -04:00
Robert Brennan
1486e3090f Add warning message for multi-schema checks in admission (#839)
* make cert dir option

* log message for multi-resource checks in admission

* Update pkg/validator/schema.go

Co-authored-by: Andrew Suderman <andrew@sudermanjr.com>
2022-09-14 09:01:27 -06:00
Danielle Cook
a2eaa210f6 Update README.md (#833)
* Update README.md

Updates to the header and opening paragraphs.

* Update README.md

* Update README.md

Co-authored-by: Andrew Suderman <andrew@sudermanjr.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2022-09-14 09:13:17 -04:00
Robert Brennan
e8e642b010 update dependencies (#836)
* update dependencies

* revert

* update x/net
2022-09-13 12:15:37 -04:00
Terraform User
1b50b85157 Managed by Terraform 2022-09-13 08:31:02 -06:00
Terraform User
5f7bbd981b Managed by Terraform 2022-09-07 11:05:01 -06:00
Terraform User
3cf4a88b93 Managed by Terraform 2022-09-07 11:02:30 -06:00
Terraform User
5a2a72b582 Managed by Terraform 2022-09-07 11:02:28 -06:00
Igor Beliakov
01dd7b7b68 Omit empty results, make pretty output less verbose (#767)
* Pretty output: remove 2 leading line breaks and 1 trailing after container results

Signed-off-by: Igor Beliakov <demtis.register@gmail.com>

* validator: don't add empty results in ApplyAllSchemaChecksToAllResources

Signed-off-by: Igor Beliakov <demtis.register@gmail.com>

* Fix MockPod() fixture:
- Since now result is considered non-empty only if Kind and Name are set, needed to adjust MockPod() to make it contain Name.

Signed-off-by: Igor Beliakov <demtis.register@gmail.com>

Co-authored-by: Robert Brennan <accounts@rbren.io>
2022-08-25 10:34:06 -04:00
Robert Brennan
6b64369698 Update changelog.md (#825)
* Update changelog.md

* Update changelog.md
2022-08-24 12:38:15 -04:00
dependabot[bot]
9448686168 Bump k8s.io/client-go from 0.24.3 to 0.24.4 (#828)
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.24.3 to 0.24.4.
- [Release notes](https://github.com/kubernetes/client-go/releases)
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.24.3...v0.24.4)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Barnabas Makonda <6409210+makoscafee@users.noreply.github.com>
2022-08-24 12:50:18 +03:00
ivanfetch-fw
01d7a8ac00 FWI-2547: Add checks for RBAC allowing execing or attaching to a Pod (#820)
* Add `rolePodExecAttach` and `clusterrolePodExecAttach` checks

* Add schema tests

* Add clusterrolebindingPodExecAttach, rolebindingRolePodExecAttach, and rolebindingClusterRolePodExecAttach checks + schema-tests

* Add the new checks to the full example config

* Update checks' success/failure messages and add some helpful comments

* Update binding-related check messaging RE: roleRef pointing to a nonexistent resource, and add tests for this case

* Update rolebindingClusterRolePodExecAttach and rolebindingRolePodExecAttach to pass if a binding roleRef is a different kind, and schema tests to include a namespace

* Add additional schema tests, remove "ignore default ClusterRole|Role bindings" code from checks that actually have no default bindings
2022-08-23 12:09:44 -06:00
ivanfetch-fw
742b21c6a2 FWI-2582: Add clusterrolebindingClusterAdmin, rolebindingClusterAdminRole, and rolebindingClusterAdminClusterRole checks + schema tests (#823)
* Add `clusterrolebindingClusterAdmin`, `rolebindingClusterAdminRole`, and `rolebindingClusterAdminClusterRole` checks + schema tests

* Update `rolebindingClusterAdminClusterRole` check to explicitly match the `cluster-admin` default ClusterRole, fix `...all_verbs` schema test, add schema checks for unrelated permissions
2022-08-22 09:50:58 -06:00
Robert Brennan
b90f091bb6 fix polaris cves (#824) 7.0.2 2022-08-22 09:44:44 -04:00
ivanfetch-fw
e3a6cb3774 Fix namespace checking when validating additional schemas which are not namespaced (#822) 2022-08-18 18:34:32 -06:00
dependabot[bot]
7addced32c Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0 (#815)
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-18 16:53:49 -04:00
dependabot[bot]
7e77350428 Bump sigs.k8s.io/controller-runtime from 0.12.1 to 0.12.3 (#814)
Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.12.1 to 0.12.3.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.12.1...v0.12.3)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-18 16:53:39 -04:00
dependabot[bot]
af0d548a07 Bump k8s.io/apimachinery from 0.24.1 to 0.24.3 (#807)
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.24.1 to 0.24.3.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.24.1...v0.24.3)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Barnabas Makonda <6409210+makoscafee@users.noreply.github.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2022-08-18 16:45:12 -04:00
dependabot[bot]
3efa3b40c9 Bump k8s.io/client-go from 0.24.1 to 0.24.3 (#806)
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.24.1 to 0.24.3.
- [Release notes](https://github.com/kubernetes/client-go/releases)
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.24.1...v0.24.3)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2022-08-18 16:45:03 -04:00