From 9bcb832bbd305dd50bbdccf9b9af315b8fea8f2c Mon Sep 17 00:00:00 2001 From: Bobby Brennan Date: Thu, 9 May 2019 15:56:36 +0000 Subject: [PATCH 1/3] rename all the things --- .circleci/config.yml | 8 +- .gitignore | 4 +- CONTRIBUTING.md | 8 +- Dockerfile | 14 +-- Makefile | 4 +- README.md | 40 ++++---- deploy/dashboard.yaml | 74 +++++++-------- .../fairwinds/templates/serviceaccount.yaml | 7 -- deploy/helm/{fairwinds => polairs}/Chart.yaml | 4 +- .../templates/NOTES.txt | 4 +- .../templates/_helpers.tpl | 20 ++-- .../templates/clusterrole.yaml | 4 +- .../templates/clusterrolebinding.yaml | 8 +- .../templates/configmap.yaml | 4 +- .../templates/dashboard.deployment.yaml | 14 +-- .../templates/dashboard.service.yaml | 6 +- .../templates/namespace.yaml | 0 .../templates/secret.yaml | 4 +- .../polairs/templates/serviceaccount.yaml | 7 ++ .../templates/webhook.deployment.yaml | 20 ++-- .../templates/webhook.service.yaml | 6 +- .../helm/{fairwinds => polairs}/values.yaml | 4 +- deploy/webhook.yaml | 94 +++++++++---------- docs/health-checks.md | 4 +- docs/images.md | 6 +- docs/networking.md | 4 +- docs/resources.md | 6 +- docs/security-capabilities.md | 2 +- docs/security.md | 4 +- main.go | 44 ++++----- pkg/dashboard/assets/js/charts.js | 6 +- pkg/dashboard/dashboard.go | 6 +- pkg/dashboard/helpers.go | 2 +- pkg/dashboard/templates/footer.gohtml | 2 +- pkg/dashboard/templates/head.gohtml | 2 +- pkg/dashboard/templates/main.gohtml | 2 +- pkg/dashboard/templates/navbar.gohtml | 2 +- pkg/kube/resources_test.go | 4 +- pkg/kube/test_files/test_2/multi.yaml | 30 +++--- pkg/validator/container.go | 6 +- pkg/validator/container_test.go | 2 +- pkg/validator/deployment.go | 6 +- pkg/validator/fullaudit.go | 22 ++--- pkg/validator/fullaudit_test.go | 6 +- pkg/validator/pod.go | 6 +- pkg/validator/pod_test.go | 4 +- pkg/validator/resource.go | 2 +- pkg/webhook/validator.go | 6 +- 48 files changed, 272 insertions(+), 272 deletions(-) delete mode 100644 deploy/helm/fairwinds/templates/serviceaccount.yaml rename deploy/helm/{fairwinds => polairs}/Chart.yaml (73%) rename deploy/helm/{fairwinds => polairs}/templates/NOTES.txt (75%) rename deploy/helm/{fairwinds => polairs}/templates/_helpers.tpl (75%) rename deploy/helm/{fairwinds => polairs}/templates/clusterrole.yaml (72%) rename deploy/helm/{fairwinds => polairs}/templates/clusterrolebinding.yaml (59%) rename deploy/helm/{fairwinds => polairs}/templates/configmap.yaml (60%) rename deploy/helm/{fairwinds => polairs}/templates/dashboard.deployment.yaml (79%) rename deploy/helm/{fairwinds => polairs}/templates/dashboard.service.yaml (65%) rename deploy/helm/{fairwinds => polairs}/templates/namespace.yaml (100%) rename deploy/helm/{fairwinds => polairs}/templates/secret.yaml (60%) create mode 100644 deploy/helm/polairs/templates/serviceaccount.yaml rename deploy/helm/{fairwinds => polairs}/templates/webhook.deployment.yaml (77%) rename deploy/helm/{fairwinds => polairs}/templates/webhook.service.yaml (62%) rename deploy/helm/{fairwinds => polairs}/values.yaml (92%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ecd9c92d..8ebf9e7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ references: echo 'export CI_TAG=$CIRCLE_TAG' >> ${BASH_ENV} echo 'export EXTERNAL_REGISTRY_BASE_DOMAIN=quay.io' >> ${BASH_ENV} echo 'export DOCKERFILE=Dockerfile' >> ${BASH_ENV} - echo 'export REPOSITORY_NAME=reactiveops/fairwinds' >> ${BASH_ENV} + echo 'export REPOSITORY_NAME=reactiveops/polaris' >> ${BASH_ENV} echo 'export REGISTRY_EMAIL=none' >> ${BASH_ENV} echo 'export DOCKERTAG=${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}' >> ${BASH_ENV} docker_build_and_push: &docker_build_and_push @@ -35,7 +35,7 @@ jobs: - *docker_build_and_push test: - working_directory: /go/src/github.com/reactiveops/fairwinds/ + working_directory: /go/src/github.com/reactiveops/polaris/ docker: - image: circleci/golang:1.11 @@ -56,7 +56,7 @@ jobs: name: Verify helm chart synced with dashboard.yaml command: | diff \ - <(helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true) \ + <(helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true) \ deploy/dashboard.yaml || (echo " Make sure to regenerate k8s deploy config with make helm-to-k8s" && exit 1) @@ -65,7 +65,7 @@ jobs: name: Verify helm chart synced with webhook.yaml command: | diff \ - <(helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false) \ + <(helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false) \ deploy/webhook.yaml || (echo " Make sure to regenerate k8s deploy config with make helm-to-k8s" && exit 1) diff --git a/.gitignore b/.gitignore index 6518ea77..883d6911 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,9 @@ *.dll *.so *.dylib -fairwinds +polaris -!deploy/helm/fairwinds +!deploy/helm/polaris # Test binary, build with `go test -c` *.test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a584b7f7..bbc03f1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Issues, whether bugs, tasks, or feature requests are essential for keeping Fairwinds great. We believe it should be as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. +Issues, whether bugs, tasks, or feature requests are essential for keeping Polaris great. We believe it should be as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. ## Code of Conduct @@ -8,15 +8,15 @@ This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). Please review t ## Project Structure -Fairwinds is built on top of [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). It can run in 3 different modes, a dashboard, a webhook, or a reporter that prints or exports validation results. All of these modes make use of the shared `validator` and `config` packages. Adding new validations is possible by only making additions to those packages. +Polaris is built on top of [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). It can run in 3 different modes, a dashboard, a webhook, or a reporter that prints or exports validation results. All of these modes make use of the shared `validator` and `config` packages. Adding new validations is possible by only making additions to those packages. ## Getting Started -We label issues with the ["good first issue" tag](https://github.com/reactiveops/fairwinds/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) if we believe they'll be a good starting point for new contributors. If you're interested in working on an issue, please start a conversation on that issue, and we can help answer any questions as they come up. +We label issues with the ["good first issue" tag](https://github.com/reactiveops/polaris/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) if we believe they'll be a good starting point for new contributors. If you're interested in working on an issue, please start a conversation on that issue, and we can help answer any questions as they come up. ## Running Tests -The following commands are all required to pass as part of Fairwinds testing: +The following commands are all required to pass as part of Polaris testing: ``` go list ./... | grep -v vendor | xargs golint -set_exit_status diff --git a/Dockerfile b/Dockerfile index c7db7f3a..1cccbf6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,20 @@ FROM golang:1.12.4 AS build-env -WORKDIR /go/src/github.com/reactiveops/fairwinds/ +WORKDIR /go/src/github.com/reactiveops/polaris/ COPY . . RUN go get -u github.com/gobuffalo/packr/v2/packr2 -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -a -o fairwinds *.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -a -o polaris *.go FROM alpine:3.9 WORKDIR /usr/local/bin RUN apk --no-cache add ca-certificates -RUN addgroup -S fairwinds && adduser -S -G fairwinds fairwinds -USER fairwinds -COPY --from=build-env /go/src/github.com/reactiveops/fairwinds/fairwinds . +RUN addgroup -S polaris && adduser -S -G polaris polaris +USER polaris +COPY --from=build-env /go/src/github.com/reactiveops/polaris/polaris . WORKDIR /opt/app -COPY --from=build-env /go/src/github.com/reactiveops/fairwinds/config.yaml ./config.yaml +COPY --from=build-env /go/src/github.com/reactiveops/polaris/config.yaml ./config.yaml -CMD ["fairwinds"] +CMD ["polaris"] diff --git a/Makefile b/Makefile index ed1b2e3b..47e90305 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ helm-to-k8s: - helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true > deploy/dashboard.yaml - helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false > deploy/webhook.yaml + helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true > deploy/dashboard.yaml + helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false > deploy/webhook.yaml diff --git a/README.md b/README.md index 674bf22c..20e70787 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,32 @@

- Fairwinds Logo + Polaris Logo

-Fairwinds keeps your cluster sailing smoothly. It runs a variety of checks to ensure that Kubernetes deployments are configured using best practices that will avoid potential problems in the future. The project includes two primary parts: +Polaris keeps your cluster sailing smoothly. It runs a variety of checks to ensure that Kubernetes deployments are configured using best practices that will avoid potential problems in the future. The project includes two primary parts: - A dashboard to display the results of these validations on your existing deployments - A beta version of a webhook that can prevent poorly configured deployments from reaching your cluster ## Dashboard -The Fairwinds Dashboard provides an overview of your current deployments in a cluster along with their validation scores. An overall score is provided for a cluster on a 0 - 100 scale. Results are then broken down by namespace and deployment. +The Polaris Dashboard provides an overview of your current deployments in a cluster along with their validation scores. An overall score is provided for a cluster on a 0 - 100 scale. Results are then broken down by namespace and deployment.

- Fairwinds Dashboard + Polaris Dashboard

### Deploying -To deploy Fairwinds with kubectl: +To deploy Polaris with kubectl: ``` -kubectl apply -f https://raw.githubusercontent.com/reactiveops/fairwinds/master/deploy/dashboard.yaml +kubectl apply -f https://raw.githubusercontent.com/reactiveops/polaris/master/deploy/dashboard.yaml ``` -Fairwinds can also be deployed with Helm: +Polaris can also be deployed with Helm: ``` -helm upgrade --install fairwinds deploy/helm/fairwinds/ --namespace fairwinds +helm upgrade --install polaris deploy/helm/polaris/ --namespace polaris ``` ### Viewing the Dashboard @@ -34,47 +34,47 @@ helm upgrade --install fairwinds deploy/helm/fairwinds/ --namespace fairwinds Once the dashboard is deployed, it can be viewed by using kubectl port-forward: ``` -kubectl port-forward --namespace fairwinds svc/fairwinds-dashboard 8080:80 +kubectl port-forward --namespace polaris svc/polaris-dashboard 8080:80 ``` With the port forwarding in place, you can open http://localhost:8080 in your browser to view the dashboard. ### Using a Binary Release -If you'd prefer to run Fairwinds locally, binary releases are available on the [releases page](https://github.com/reactiveops/fairwinds/releases). When running as a binary, Fairwinds will use your local kubeconfig to connect to a cluster. There are a variety of options available, but the most common usage may be to view the dashboard: +If you'd prefer to run Polaris locally, binary releases are available on the [releases page](https://github.com/reactiveops/polaris/releases). When running as a binary, Polaris will use your local kubeconfig to connect to a cluster. There are a variety of options available, but the most common usage may be to view the dashboard: ``` -fairwinds --dashboard +polaris --dashboard ``` ## Webhook -Fairwinds includes experimental support for an optional validating webhook. This accepts the same configuration as the dashboard, and can run the same validations. This webhook will reject any deployments that trigger a validation error. This is indicative of the greater goal of Fairwinds, not just to encourage better configuration through dashboard visibility, but to actually enforce it with this webhook. *Although we are working towards greater stability and better test coverage, we do not currently consider this webhook component production ready.* +Polaris includes experimental support for an optional validating webhook. This accepts the same configuration as the dashboard, and can run the same validations. This webhook will reject any deployments that trigger a validation error. This is indicative of the greater goal of Polaris, not just to encourage better configuration through dashboard visibility, but to actually enforce it with this webhook. *Although we are working towards greater stability and better test coverage, we do not currently consider this webhook component production ready.* -Unfortunately we have not found a way to disply warnings as part of `kubectl` output unless we are rejecting a deployment altogether. That means that any checks with a severity of `warning` will still pass webhook validation, and the only evidence of that warning will either be in the Fairwinds dashboard or the Fairwinds webhook logs. +Unfortunately we have not found a way to disply warnings as part of `kubectl` output unless we are rejecting a deployment altogether. That means that any checks with a severity of `warning` will still pass webhook validation, and the only evidence of that warning will either be in the Polaris dashboard or the Polaris webhook logs. ### Deploying -The Fairwinds webhook can be deployed with kubectl: +The Polaris webhook can be deployed with kubectl: ``` -kubectl apply -f https://raw.githubusercontent.com/reactiveops/fairwinds/master/deploy/webhook.yaml +kubectl apply -f https://raw.githubusercontent.com/reactiveops/polaris/master/deploy/webhook.yaml ``` Alternatively, the webhook can be enabled with Helm by setting `webhook.enable` to true: ``` -helm upgrade --install fairwinds deploy/helm/fairwinds/ --namespace fairwinds --set webhook.enable=true +helm upgrade --install polaris deploy/helm/polaris/ --namespace polaris --set webhook.enable=true ``` ## Configuration -Fairwinds supports a wide range of validations covering a number of Kubernetes best practices. Here's a sample configuration file that includes all currently supported checks. The [default configuration](https://github.com/reactiveops/fairwinds/blob/master/config.yaml) contains a number of those checks. This repository also includes a sample [full configuration file](https://github.com/reactiveops/fairwinds/blob/master/config-full.yaml) that enables all available checks. +Polaris supports a wide range of validations covering a number of Kubernetes best practices. Here's a sample configuration file that includes all currently supported checks. The [default configuration](https://github.com/reactiveops/polaris/blob/master/config.yaml) contains a number of those checks. This repository also includes a sample [full configuration file](https://github.com/reactiveops/polaris/blob/master/config-full.yaml) that enables all available checks. Each check can be assigned a `severity`. Only checks with a severity of `error` or `warning` will be validated. The results of these validations are visible on the dashboard. In the case of the validating webhook, only failures with a severity of `error` will result in a change being rejected. -Fairwinds validation checks fall into several different categories: +Polaris validation checks fall into several different categories: - [Health Checks](docs/health-checks.md) - [Images](docs/images.md) @@ -84,8 +84,8 @@ Fairwinds validation checks fall into several different categories: ## CLI Options -* `config`: Specify a location for the Fairwinds config -* `dashboard`: Runs the webserver for Fairwinds dashboard. +* `config`: Specify a location for the Polaris config +* `dashboard`: Runs the webserver for Polaris dashboard. * `dashboard-port`: Port for the dashboard webserver (default 8080) * `webhook`: Runs the webhook webserver. * `webhook-port`: Port for the webhook webserver (default 9876) diff --git a/deploy/dashboard.yaml b/deploy/dashboard.yaml index fa576f14..833965f4 100644 --- a/deploy/dashboard.yaml +++ b/deploy/dashboard.yaml @@ -1,18 +1,18 @@ --- -# Source: fairwinds/templates/namespace.yaml +# Source: polaris/templates/namespace.yaml apiVersion: v1 kind: Namespace metadata: - name: fairwinds + name: polaris --- -# Source: fairwinds/templates/configmap.yaml +# Source: polaris/templates/configmap.yaml apiVersion: v1 kind: ConfigMap metadata: - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris labels: - app: fairwinds + app: polaris data: config.yaml: | resources: @@ -59,23 +59,23 @@ data: - AUDIT_WRITE --- -# Source: fairwinds/templates/serviceaccount.yaml +# Source: polaris/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata: - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris labels: - app: fairwinds + app: polaris --- -# Source: fairwinds/templates/clusterrole.yaml +# Source: polaris/templates/clusterrole.yaml apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: - name: fairwinds + name: polaris labels: - app: fairwinds + app: polaris rules: - apiGroups: - '' @@ -86,30 +86,30 @@ rules: verbs: - '*' --- -# Source: fairwinds/templates/clusterrolebinding.yaml +# Source: polaris/templates/clusterrolebinding.yaml apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: - name: fairwinds + name: polaris labels: - app: fairwinds + app: polaris roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: fairwinds + name: polaris subjects: - kind: ServiceAccount - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris --- -# Source: fairwinds/templates/dashboard.service.yaml +# Source: polaris/templates/dashboard.service.yaml apiVersion: v1 kind: Service metadata: - name: fairwinds-dashboard - namespace: fairwinds + name: polaris-dashboard + namespace: polaris labels: - app: fairwinds + app: polaris spec: ports: - name: dashboard @@ -117,42 +117,42 @@ spec: protocol: TCP targetPort: 8080 selector: - app: fairwinds + app: polaris component: dashboard type: ClusterIP --- -# Source: fairwinds/templates/dashboard.deployment.yaml +# Source: polaris/templates/dashboard.deployment.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: checksum/config: '5702aca235561630172c22b6b900f5cebd4e82fae60389df18a3537ff82e2f09' - name: fairwinds-dashboard - namespace: fairwinds + name: polaris-dashboard + namespace: polaris labels: - app: fairwinds + app: polaris component: dashboard spec: replicas: 1 selector: matchLabels: - app: fairwinds + app: polaris component: dashboard template: metadata: labels: - app: fairwinds + app: polaris component: dashboard spec: volumes: - name: config configMap: - name: fairwinds + name: polaris containers: - command: - - fairwinds + - polaris - --dashboard - image: 'quay.io/reactiveops/fairwinds:master' + image: 'quay.io/reactiveops/polaris:master' imagePullPolicy: 'Always' name: dashboard ports: @@ -181,13 +181,13 @@ spec: mountPath: /opt/app/config.yaml subPath: config.yaml readOnly: true - serviceAccountName: fairwinds + serviceAccountName: polaris --- -# Source: fairwinds/templates/secret.yaml +# Source: polaris/templates/secret.yaml --- -# Source: fairwinds/templates/webhook.deployment.yaml +# Source: polaris/templates/webhook.deployment.yaml --- -# Source: fairwinds/templates/webhook.service.yaml +# Source: polaris/templates/webhook.service.yaml diff --git a/deploy/helm/fairwinds/templates/serviceaccount.yaml b/deploy/helm/fairwinds/templates/serviceaccount.yaml deleted file mode 100644 index 31c12298..00000000 --- a/deploy/helm/fairwinds/templates/serviceaccount.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "fairwinds.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "fairwinds.labels" . | nindent 4 }} diff --git a/deploy/helm/fairwinds/Chart.yaml b/deploy/helm/polairs/Chart.yaml similarity index 73% rename from deploy/helm/fairwinds/Chart.yaml rename to deploy/helm/polairs/Chart.yaml index 601908ae..5cbf7f20 100755 --- a/deploy/helm/fairwinds/Chart.yaml +++ b/deploy/helm/polairs/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: Validation of best practices in your Kubernetes clusters -name: fairwinds -version: 0.1.0 +name: polaris +version: 1.0.0 diff --git a/deploy/helm/fairwinds/templates/NOTES.txt b/deploy/helm/polairs/templates/NOTES.txt similarity index 75% rename from deploy/helm/fairwinds/templates/NOTES.txt rename to deploy/helm/polairs/templates/NOTES.txt index 3030b675..530bfdd6 100644 --- a/deploy/helm/fairwinds/templates/NOTES.txt +++ b/deploy/helm/polairs/templates/NOTES.txt @@ -1,12 +1,12 @@ ** Please be patient while the chart is being deployed ** -Enjoy Fairwinds and smooth sailing! +Enjoy Polaris and smooth sailing! {{- if contains "ClusterIP" .Values.dashboard.service.type }} ## To view the dashboard execute these commands: -kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "fairwinds.fullname" . }}-dashboard 8080:80 & +kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "polaris.fullname" . }}-dashboard 8080:80 & open http://localhost:8080 {{- end }} diff --git a/deploy/helm/fairwinds/templates/_helpers.tpl b/deploy/helm/polairs/templates/_helpers.tpl similarity index 75% rename from deploy/helm/fairwinds/templates/_helpers.tpl rename to deploy/helm/polairs/templates/_helpers.tpl index 58ced392..d6b75053 100644 --- a/deploy/helm/fairwinds/templates/_helpers.tpl +++ b/deploy/helm/polairs/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "fairwinds.name" -}} +{{- define "polaris.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -11,7 +11,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "fairwinds.fullname" -}} +{{- define "polaris.fullname" -}} {{- if .Values.fullnameOverride -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} @@ -27,19 +27,19 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "fairwinds.chart" -}} +{{- define "polaris.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Standard labels */}} -{{- define "fairwinds.labels" -}} +{{- define "polaris.labels" -}} {{- if .Values.templateOnly -}} -app: {{ include "fairwinds.name" . }} +app: {{ include "polaris.name" . }} {{- else -}} -app.kubernetes.io/name: {{ include "fairwinds.name" . }} -helm.sh/chart: {{ include "fairwinds.chart" . }} +app.kubernetes.io/name: {{ include "polaris.name" . }} +helm.sh/chart: {{ include "polaris.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} @@ -48,11 +48,11 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Standard selector */}} -{{- define "fairwinds.selectors" -}} +{{- define "polaris.selectors" -}} {{- if .Values.templateOnly -}} -app: {{ include "fairwinds.name" . }} +app: {{ include "polaris.name" . }} {{- else -}} -app.kubernetes.io/name: {{ include "fairwinds.name" . }} +app.kubernetes.io/name: {{ include "polaris.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} {{- end -}} diff --git a/deploy/helm/fairwinds/templates/clusterrole.yaml b/deploy/helm/polairs/templates/clusterrole.yaml similarity index 72% rename from deploy/helm/fairwinds/templates/clusterrole.yaml rename to deploy/helm/polairs/templates/clusterrole.yaml index ded6539c..644d9200 100644 --- a/deploy/helm/fairwinds/templates/clusterrole.yaml +++ b/deploy/helm/polairs/templates/clusterrole.yaml @@ -2,9 +2,9 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} rules: - apiGroups: - '' diff --git a/deploy/helm/fairwinds/templates/clusterrolebinding.yaml b/deploy/helm/polairs/templates/clusterrolebinding.yaml similarity index 59% rename from deploy/helm/fairwinds/templates/clusterrolebinding.yaml rename to deploy/helm/polairs/templates/clusterrolebinding.yaml index a58b79b5..b4c5b8d8 100644 --- a/deploy/helm/fairwinds/templates/clusterrolebinding.yaml +++ b/deploy/helm/polairs/templates/clusterrolebinding.yaml @@ -2,15 +2,15 @@ apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} subjects: - kind: ServiceAccount - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} namespace: {{ .Release.Namespace }} {{- end -}} diff --git a/deploy/helm/fairwinds/templates/configmap.yaml b/deploy/helm/polairs/templates/configmap.yaml similarity index 60% rename from deploy/helm/fairwinds/templates/configmap.yaml rename to deploy/helm/polairs/templates/configmap.yaml index 5ba07377..ef96d527 100644 --- a/deploy/helm/fairwinds/templates/configmap.yaml +++ b/deploy/helm/polairs/templates/configmap.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} data: config.yaml: {{- toYaml .Values.config | indent 2 -}} diff --git a/deploy/helm/fairwinds/templates/dashboard.deployment.yaml b/deploy/helm/polairs/templates/dashboard.deployment.yaml similarity index 79% rename from deploy/helm/fairwinds/templates/dashboard.deployment.yaml rename to deploy/helm/polairs/templates/dashboard.deployment.yaml index de20628a..364a3581 100644 --- a/deploy/helm/fairwinds/templates/dashboard.deployment.yaml +++ b/deploy/helm/polairs/templates/dashboard.deployment.yaml @@ -4,30 +4,30 @@ kind: Deployment metadata: annotations: checksum/config: '{{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}' - name: {{ include "fairwinds.fullname" . }}-dashboard + name: {{ include "polaris.fullname" . }}-dashboard namespace: {{ .Release.Namespace }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} component: dashboard spec: replicas: {{.Values.dashboard.replicas}} selector: matchLabels: - {{- include "fairwinds.selectors" . | nindent 6 }} + {{- include "polaris.selectors" . | nindent 6 }} component: dashboard template: metadata: labels: - {{- include "fairwinds.selectors" . | nindent 8 }} + {{- include "polaris.selectors" . | nindent 8 }} component: dashboard spec: volumes: - name: config configMap: - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} containers: - command: - - fairwinds + - polaris - --dashboard image: '{{.Values.webhook.image.repository}}:{{.Values.webhook.image.tag}}' imagePullPolicy: '{{.Values.webhook.image.pullPolicy}}' @@ -58,5 +58,5 @@ spec: mountPath: /opt/app/config.yaml subPath: config.yaml readOnly: true - serviceAccountName: {{ include "fairwinds.fullname" . }} + serviceAccountName: {{ include "polaris.fullname" . }} {{- end -}} diff --git a/deploy/helm/fairwinds/templates/dashboard.service.yaml b/deploy/helm/polairs/templates/dashboard.service.yaml similarity index 65% rename from deploy/helm/fairwinds/templates/dashboard.service.yaml rename to deploy/helm/polairs/templates/dashboard.service.yaml index 5d7c519c..2d675e35 100644 --- a/deploy/helm/fairwinds/templates/dashboard.service.yaml +++ b/deploy/helm/polairs/templates/dashboard.service.yaml @@ -2,10 +2,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "fairwinds.fullname" . }}-dashboard + name: {{ include "polaris.fullname" . }}-dashboard namespace: {{ .Release.Namespace }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} spec: ports: - name: dashboard @@ -13,7 +13,7 @@ spec: protocol: TCP targetPort: 8080 selector: - {{- include "fairwinds.selectors" . | nindent 4 }} + {{- include "polaris.selectors" . | nindent 4 }} component: dashboard type: {{ .Values.dashboard.service.type }} {{- end -}} diff --git a/deploy/helm/fairwinds/templates/namespace.yaml b/deploy/helm/polairs/templates/namespace.yaml similarity index 100% rename from deploy/helm/fairwinds/templates/namespace.yaml rename to deploy/helm/polairs/templates/namespace.yaml diff --git a/deploy/helm/fairwinds/templates/secret.yaml b/deploy/helm/polairs/templates/secret.yaml similarity index 60% rename from deploy/helm/fairwinds/templates/secret.yaml rename to deploy/helm/polairs/templates/secret.yaml index 16232973..3333080e 100644 --- a/deploy/helm/fairwinds/templates/secret.yaml +++ b/deploy/helm/polairs/templates/secret.yaml @@ -2,10 +2,10 @@ apiVersion: v1 kind: Secret metadata: - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} type: Opaque data: {{- end -}} diff --git a/deploy/helm/polairs/templates/serviceaccount.yaml b/deploy/helm/polairs/templates/serviceaccount.yaml new file mode 100644 index 00000000..44fa2136 --- /dev/null +++ b/deploy/helm/polairs/templates/serviceaccount.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "polaris.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "polaris.labels" . | nindent 4 }} diff --git a/deploy/helm/fairwinds/templates/webhook.deployment.yaml b/deploy/helm/polairs/templates/webhook.deployment.yaml similarity index 77% rename from deploy/helm/fairwinds/templates/webhook.deployment.yaml rename to deploy/helm/polairs/templates/webhook.deployment.yaml index eb666553..fb109298 100644 --- a/deploy/helm/fairwinds/templates/webhook.deployment.yaml +++ b/deploy/helm/polairs/templates/webhook.deployment.yaml @@ -4,33 +4,33 @@ kind: Deployment metadata: annotations: checksum/config: '{{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}' - name: {{ include "fairwinds.fullname" . }}-webhook + name: {{ include "polaris.fullname" . }}-webhook namespace: {{ .Release.Namespace }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} component: webhook spec: replicas: {{ .Values.webhook.replicas }} selector: matchLabels: - {{- include "fairwinds.selectors" . | nindent 6 }} + {{- include "polaris.selectors" . | nindent 6 }} component: webhook template: metadata: labels: - {{- include "fairwinds.selectors" . | nindent 8 }} + {{- include "polaris.selectors" . | nindent 8 }} component: webhook spec: volumes: - name: config configMap: - name: {{ include "fairwinds.fullname" . }} + name: {{ include "polaris.fullname" . }} - name: secret secret: - secretName: {{ include "fairwinds.fullname" . }} + secretName: {{ include "polaris.fullname" . }} containers: - command: - - fairwinds + - polaris - --webhook image: '{{.Values.webhook.image.repository}}:{{.Values.webhook.image.tag}}' imagePullPolicy: '{{.Values.webhook.image.pullPolicy}}' @@ -45,7 +45,7 @@ spec: command: - sh - -c - - ps -ef | grep fairwinds + - ps -ef | grep polaris initialDelaySeconds: 5 periodSeconds: 5 readinessProbe: @@ -53,7 +53,7 @@ spec: command: - sh - -c - - ps -ef | grep fairwinds + - ps -ef | grep polaris initialDelaySeconds: 5 periodSeconds: 5 resources: @@ -71,5 +71,5 @@ spec: - name: secret mountPath: /tmp/cert/ readOnly: true - serviceAccountName: {{ include "fairwinds.fullname" . }} + serviceAccountName: {{ include "polaris.fullname" . }} {{- end -}} diff --git a/deploy/helm/fairwinds/templates/webhook.service.yaml b/deploy/helm/polairs/templates/webhook.service.yaml similarity index 62% rename from deploy/helm/fairwinds/templates/webhook.service.yaml rename to deploy/helm/polairs/templates/webhook.service.yaml index 58b0e99d..4bf3fa5b 100644 --- a/deploy/helm/fairwinds/templates/webhook.service.yaml +++ b/deploy/helm/polairs/templates/webhook.service.yaml @@ -2,10 +2,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "fairwinds.fullname" . }}-dashboard + name: {{ include "polaris.fullname" . }}-dashboard namespace: {{ .Release.Namespace }} labels: - {{- include "fairwinds.labels" . | nindent 4 }} + {{- include "polaris.labels" . | nindent 4 }} spec: ports: - name: dashboard @@ -13,7 +13,7 @@ spec: protocol: TCP targetPort: 8080 selector: - {{- include "fairwinds.selectors" . | nindent 4 }} + {{- include "polaris.selectors" . | nindent 4 }} component: dashboard type: ClusterIP {{- end -}} diff --git a/deploy/helm/fairwinds/values.yaml b/deploy/helm/polairs/values.yaml similarity index 92% rename from deploy/helm/fairwinds/values.yaml rename to deploy/helm/polairs/values.yaml index 0c6e2d4d..5f7aec6c 100644 --- a/deploy/helm/fairwinds/values.yaml +++ b/deploy/helm/polairs/values.yaml @@ -49,7 +49,7 @@ dashboard: service: type: ClusterIP image: - repository: quay.io/reactiveops/fairwinds + repository: quay.io/reactiveops/polaris tag: master pullPolicy: Always @@ -57,7 +57,7 @@ webhook: enable: false replicas: 1 image: - repository: quay.io/reactiveops/fairwinds + repository: quay.io/reactiveops/polaris tag: master pullPolicy: Always diff --git a/deploy/webhook.yaml b/deploy/webhook.yaml index 9e254b0c..1b2d836e 100644 --- a/deploy/webhook.yaml +++ b/deploy/webhook.yaml @@ -1,29 +1,29 @@ --- -# Source: fairwinds/templates/namespace.yaml +# Source: polaris/templates/namespace.yaml apiVersion: v1 kind: Namespace metadata: - name: fairwinds + name: polaris --- -# Source: fairwinds/templates/secret.yaml +# Source: polaris/templates/secret.yaml apiVersion: v1 kind: Secret metadata: - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris labels: - app: fairwinds + app: polaris type: Opaque data: --- -# Source: fairwinds/templates/configmap.yaml +# Source: polaris/templates/configmap.yaml apiVersion: v1 kind: ConfigMap metadata: - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris labels: - app: fairwinds + app: polaris data: config.yaml: | resources: @@ -70,23 +70,23 @@ data: - AUDIT_WRITE --- -# Source: fairwinds/templates/serviceaccount.yaml +# Source: polaris/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata: - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris labels: - app: fairwinds + app: polaris --- -# Source: fairwinds/templates/clusterrole.yaml +# Source: polaris/templates/clusterrole.yaml apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: - name: fairwinds + name: polaris labels: - app: fairwinds + app: polaris rules: - apiGroups: - '' @@ -97,30 +97,30 @@ rules: verbs: - '*' --- -# Source: fairwinds/templates/clusterrolebinding.yaml +# Source: polaris/templates/clusterrolebinding.yaml apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: - name: fairwinds + name: polaris labels: - app: fairwinds + app: polaris roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: fairwinds + name: polaris subjects: - kind: ServiceAccount - name: fairwinds - namespace: fairwinds + name: polaris + namespace: polaris --- -# Source: fairwinds/templates/dashboard.service.yaml +# Source: polaris/templates/dashboard.service.yaml apiVersion: v1 kind: Service metadata: - name: fairwinds-dashboard - namespace: fairwinds + name: polaris-dashboard + namespace: polaris labels: - app: fairwinds + app: polaris spec: ports: - name: dashboard @@ -128,18 +128,18 @@ spec: protocol: TCP targetPort: 8080 selector: - app: fairwinds + app: polaris component: dashboard type: ClusterIP --- -# Source: fairwinds/templates/webhook.service.yaml +# Source: polaris/templates/webhook.service.yaml apiVersion: v1 kind: Service metadata: - name: fairwinds-dashboard - namespace: fairwinds + name: polaris-dashboard + namespace: polaris labels: - app: fairwinds + app: polaris spec: ports: - name: dashboard @@ -147,45 +147,45 @@ spec: protocol: TCP targetPort: 8080 selector: - app: fairwinds + app: polaris component: dashboard type: ClusterIP --- -# Source: fairwinds/templates/webhook.deployment.yaml +# Source: polaris/templates/webhook.deployment.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: checksum/config: '5702aca235561630172c22b6b900f5cebd4e82fae60389df18a3537ff82e2f09' - name: fairwinds-webhook - namespace: fairwinds + name: polaris-webhook + namespace: polaris labels: - app: fairwinds + app: polaris component: webhook spec: replicas: 1 selector: matchLabels: - app: fairwinds + app: polaris component: webhook template: metadata: labels: - app: fairwinds + app: polaris component: webhook spec: volumes: - name: config configMap: - name: fairwinds + name: polaris - name: secret secret: - secretName: fairwinds + secretName: polaris containers: - command: - - fairwinds + - polaris - --webhook - image: 'quay.io/reactiveops/fairwinds:master' + image: 'quay.io/reactiveops/polaris:master' imagePullPolicy: 'Always' name: webhook ports: @@ -198,7 +198,7 @@ spec: command: - sh - -c - - ps -ef | grep fairwinds + - ps -ef | grep polaris initialDelaySeconds: 5 periodSeconds: 5 readinessProbe: @@ -206,7 +206,7 @@ spec: command: - sh - -c - - ps -ef | grep fairwinds + - ps -ef | grep polaris initialDelaySeconds: 5 periodSeconds: 5 resources: @@ -224,7 +224,7 @@ spec: - name: secret mountPath: /tmp/cert/ readOnly: true - serviceAccountName: fairwinds + serviceAccountName: polaris --- -# Source: fairwinds/templates/dashboard.deployment.yaml +# Source: polaris/templates/dashboard.deployment.yaml diff --git a/docs/health-checks.md b/docs/health-checks.md index 83904494..6854305a 100644 --- a/docs/health-checks.md +++ b/docs/health-checks.md @@ -1,6 +1,6 @@ # Health Checks -Fairwinds supports validating the presence of readiness and liveness probes in pods. +Polaris supports validating the presence of readiness and liveness probes in pods. key | default | description ----|---------|------------ @@ -19,4 +19,4 @@ Liveness probes are designed to ensure that an application stays in a healthy st - [Kubernetes Docs: Configure Livenss and Readiness Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) - [Utilizing Kubernetes Liveness and Readiness Probes to Automatically Recover From Failure](https://medium.com/spire-labs/utilizing-kubernetes-liveness-and-readiness-probes-to-automatically-recover-from-failure-2fe0314f2b2e) -- [Kubernetes Liveness and Readiness Probes: How to Avoid Shooting Yourself in the Foot](https://blog.colinbreck.com/kubernetes-liveness-and-readiness-probes-how-to-avoid-shooting-yourself-in-the-foot/) \ No newline at end of file +- [Kubernetes Liveness and Readiness Probes: How to Avoid Shooting Yourself in the Foot](https://blog.colinbreck.com/kubernetes-liveness-and-readiness-probes-how-to-avoid-shooting-yourself-in-the-foot/) diff --git a/docs/images.md b/docs/images.md index 8e626567..353a916d 100644 --- a/docs/images.md +++ b/docs/images.md @@ -1,6 +1,6 @@ # Images -Fairwinds supports a number of checks related to the image specified by pods. +Polaris supports a number of checks related to the image specified by pods. key | default | description ----|---------|------------ @@ -11,10 +11,10 @@ key | default | description Docker's `latest` tag is applied by default to images where a tag hasn't been specified. Not specifying a specific version of an image can lead to a wide variety of problems. The underlying image could include unexpected breaking changes that break your application whenever the latest image is pulled. Reusing the same tag for multiple versions of an image can lead to different nodes in the same cluster having different versions of an image, even if the tag is identical. -Related to that, relying on cached versions of a Docker image can become a security vulnerability. By default, an image will be pulled if it isn't already cached on the node attempting to run it. This can result in variations in images that are running per node, or potentially provide a way to gain access to an image without having direct access to the ImagePullSecret. With that in mind, it's often better to ensure the a pod has `pullPolicy: Always` specified, so images are always pulled directly from their source. This is not a check enabled by default with Fairwinds as organizations may not wish to add the overhead involved with pulling images for each pod. +Related to that, relying on cached versions of a Docker image can become a security vulnerability. By default, an image will be pulled if it isn't already cached on the node attempting to run it. This can result in variations in images that are running per node, or potentially provide a way to gain access to an image without having direct access to the ImagePullSecret. With that in mind, it's often better to ensure the a pod has `pullPolicy: Always` specified, so images are always pulled directly from their source. This is not a check enabled by default with Polaris as organizations may not wish to add the overhead involved with pulling images for each pod. ## Further Reading - [What's Wrong With The Docker :latest Tag?](https://vsupalov.com/docker-latest-tag/) -- [Kubernetes’ AlwaysPullImages Admission Control — the Importance, Implementation, and Security Vulnerability in its Absence](https://medium.com/@trstringer/kubernetes-alwayspullimages-admission-control-the-importance-implementation-and-security-d83ff3815840) \ No newline at end of file +- [Kubernetes’ AlwaysPullImages Admission Control — the Importance, Implementation, and Security Vulnerability in its Absence](https://medium.com/@trstringer/kubernetes-alwayspullimages-admission-control-the-importance-implementation-and-security-d83ff3815840) diff --git a/docs/networking.md b/docs/networking.md index de8969bc..bc0df963 100644 --- a/docs/networking.md +++ b/docs/networking.md @@ -1,6 +1,6 @@ # Networking -Fairwinds supports a number of checks related to pod networking. +Polaris supports a number of checks related to pod networking. key | default | description ----|---------|------------ @@ -19,4 +19,4 @@ Setting the `hostPort` attribute on a container will ensure that it is accessibl - [Kubernetes Docs: Configuration Best Practices](https://kubernetes.io/docs/concepts/configuration/overview/#services) -- [Accessing Kubernetes Pods from Outside of the Cluster](http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/) \ No newline at end of file +- [Accessing Kubernetes Pods from Outside of the Cluster](http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/) diff --git a/docs/resources.md b/docs/resources.md index 67f5eb71..350a9aaa 100644 --- a/docs/resources.md +++ b/docs/resources.md @@ -1,6 +1,6 @@ # Resources -Fairwinds supports a number of checks related to CPU and Memory requests and limits. +Polaris supports a number of checks related to CPU and Memory requests and limits. ## Presence Checks @@ -15,7 +15,7 @@ key | default | description ## Range Checks -Fairwinds can also verify that those values fall within a certain range. These checks are not enabled by default, and as such do not have default values. The `cpuRequestRanges`, `cpuLimitRanges`, `memoryRequestRanges`, and `memoryLimitRanges` all support the following attributes: +Polaris can also verify that those values fall within a certain range. These checks are not enabled by default, and as such do not have default values. The `cpuRequestRanges`, `cpuLimitRanges`, `memoryRequestRanges`, and `memoryLimitRanges` all support the following attributes: key | description ----|------------ @@ -40,4 +40,4 @@ Having these values appropriately configured ensures that: - [Kubernetes best practices: Resource requests and limits](https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-resource-requests-and-limits) -- [Vertical Pod Autoscaler (can automatically set resource requests and limits)](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler) \ No newline at end of file +- [Vertical Pod Autoscaler (can automatically set resource requests and limits)](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler) diff --git a/docs/security-capabilities.md b/docs/security-capabilities.md index 9b1896b4..92f4b4a8 100644 --- a/docs/security-capabilities.md +++ b/docs/security-capabilities.md @@ -1,6 +1,6 @@ # Security Capabilities -Fairwinds supports a number of checks to ensure pods are running with a limited set of capabilities. Under `security.capabilities`, there are `error` and `warning` sections indicating the severity of failures for the following checks. +Polaris supports a number of checks to ensure pods are running with a limited set of capabilities. Under `security.capabilities`, there are `error` and `warning` sections indicating the severity of failures for the following checks. key | default | description ----|---------|------------ diff --git a/docs/security.md b/docs/security.md index e6159197..ba7b9a48 100644 --- a/docs/security.md +++ b/docs/security.md @@ -1,6 +1,6 @@ # Security -Fairwinds supports a number of checks related to security. +Polaris supports a number of checks related to security. key | default | description ----|---------|------------ @@ -19,7 +19,7 @@ Additional validations are available to ensure pods are running with a limited s Securing workloads in Kubernetes is an important part of overall cluster security. The overall goal should be to ensure that containers are running with as minimal privileges as possible. This includes avoiding privilege escalation, not running containers with a root user, and using read only file systems wherever possible. -Much of this configuration can be found in the `securityContext` attribute for both Kubernetes pods and containers. Where configuration is available at both a pod and container level, Fairwinds validates both. +Much of this configuration can be found in the `securityContext` attribute for both Kubernetes pods and containers. Where configuration is available at both a pod and container level, Polaris validates both. ## Further Reading - [Kubernetes Docs: Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) diff --git a/main.go b/main.go index 9573ad7e..2b1818c5 100644 --- a/main.go +++ b/main.go @@ -25,11 +25,11 @@ import ( "strings" "github.com/gorilla/mux" - conf "github.com/reactiveops/fairwinds/pkg/config" - "github.com/reactiveops/fairwinds/pkg/dashboard" - "github.com/reactiveops/fairwinds/pkg/kube" - "github.com/reactiveops/fairwinds/pkg/validator" - fwebhook "github.com/reactiveops/fairwinds/pkg/webhook" + conf "github.com/reactiveops/polaris/pkg/config" + "github.com/reactiveops/polaris/pkg/dashboard" + "github.com/reactiveops/polaris/pkg/kube" + "github.com/reactiveops/polaris/pkg/validator" + fwebhook "github.com/reactiveops/polaris/pkg/webhook" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" appsv1 "k8s.io/api/apps/v1" @@ -42,7 +42,7 @@ import ( ) func main() { - dashboard := flag.Bool("dashboard", false, "Runs the webserver for Fairwinds dashboard.") + dashboard := flag.Bool("dashboard", false, "Runs the webserver for Polaris dashboard.") webhook := flag.Bool("webhook", false, "Runs the webhook webserver.") audit := flag.Bool("audit", false, "Runs a one-time audit.") auditPath := flag.String("audit-path", "", "If specified, audits one or more YAML files instead of a cluster") @@ -50,7 +50,7 @@ func main() { webhookPort := flag.Int("webhook-port", 9876, "Port for the webhook webserver") auditOutputURL := flag.String("output-url", "", "Destination URL to send audit results") auditOutputFile := flag.String("output-file", "", "Destination file for audit results") - configPath := flag.String("config", "config.yaml", "Location of Fairwinds configuration file") + configPath := flag.String("config", "config.yaml", "Location of Polaris configuration file") logLevel := flag.String("log-level", logrus.InfoLevel.String(), "Logrus log level") disableWebhookConfigInstaller := flag.Bool("disable-webhook-config-installer", false, "disable the installer in the webhook server, so it won't install webhook configuration resources during bootstrapping") @@ -119,7 +119,7 @@ func startDashboardServer(c conf.Configuration, k *kube.ResourceProvider, port i http.Handle("/static/", http.StripPrefix("/static/", fileServer)) http.Handle("/", router) - logrus.Infof("Starting Fairwinds dashboard server on port %d", port) + logrus.Infof("Starting Polaris dashboard server on port %d", port) logrus.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), nil)) } @@ -131,39 +131,39 @@ func startWebhookServer(c conf.Configuration, disableWebhookConfigInstaller bool os.Exit(1) } - fairwindsResourceName := "fairwinds" - fairwindsNamespaceBytes, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace") + polarisResourceName := "polaris" + polarisNamespaceBytes, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace") if err != nil { // Not exiting here as we have fallback options logrus.Debugf("Error reading namespace information: %v", err) } - fairwindsNamespace := string(fairwindsNamespaceBytes) - if fairwindsNamespace == "" { - fairwindsNamespace = fairwindsResourceName - logrus.Debugf("Could not determine current namespace, creating resources in %s namespace", fairwindsNamespace) + polarisNamespace := string(polarisNamespaceBytes) + if polarisNamespace == "" { + polarisNamespace = polarisResourceName + logrus.Debugf("Could not determine current namespace, creating resources in %s namespace", polarisNamespace) } logrus.Info("Setting up webhook server") - as, err := webhook.NewServer(fairwindsResourceName, mgr, webhook.ServerOptions{ + as, err := webhook.NewServer(polarisResourceName, mgr, webhook.ServerOptions{ Port: int32(port), CertDir: "/tmp/cert", DisableWebhookConfigInstaller: &disableWebhookConfigInstaller, BootstrapOptions: &webhook.BootstrapOptions{ - ValidatingWebhookConfigName: fairwindsResourceName, + ValidatingWebhookConfigName: polarisResourceName, Secret: &apitypes.NamespacedName{ - Namespace: fairwindsNamespace, - Name: fairwindsResourceName, + Namespace: polarisNamespace, + Name: polarisResourceName, }, Service: &webhook.Service{ - Namespace: fairwindsNamespace, - Name: fairwindsResourceName, + Namespace: polarisNamespace, + Name: polarisResourceName, // Selectors should select the pods that runs this webhook server. Selectors: map[string]string{ - "app": fairwindsResourceName, + "app": polarisResourceName, }, }, }, @@ -174,7 +174,7 @@ func startWebhookServer(c conf.Configuration, disableWebhookConfigInstaller bool os.Exit(1) } - logrus.Infof("Fairwinds webhook server listening on port %d", port) + logrus.Infof("Polaris webhook server listening on port %d", port) d := fwebhook.NewWebhook("deploy", mgr, fwebhook.Validator{Config: c}, &appsv1.Deployment{}) logrus.Debug("Registering webhooks to the webhook server") diff --git a/pkg/dashboard/assets/js/charts.js b/pkg/dashboard/assets/js/charts.js index aa88f8ae..b6339f87 100644 --- a/pkg/dashboard/assets/js/charts.js +++ b/pkg/dashboard/assets/js/charts.js @@ -5,9 +5,9 @@ $(function () { labels: ["Passing", "Warning", "Error"], datasets: [{ data: [ - fairwindsAuditData.ClusterSummary.Results.Totals.Successes, - fairwindsAuditData.ClusterSummary.Results.Totals.Warnings, - fairwindsAuditData.ClusterSummary.Results.Totals.Errors, + polarisAuditData.ClusterSummary.Results.Totals.Successes, + polarisAuditData.ClusterSummary.Results.Totals.Warnings, + polarisAuditData.ClusterSummary.Results.Totals.Errors, ], backgroundColor: ['#8BD2DC', '#f26c21', '#a11f4c'], }] diff --git a/pkg/dashboard/dashboard.go b/pkg/dashboard/dashboard.go index 0d46f4f1..312360e7 100644 --- a/pkg/dashboard/dashboard.go +++ b/pkg/dashboard/dashboard.go @@ -21,9 +21,9 @@ import ( "net/http" packr "github.com/gobuffalo/packr/v2" - conf "github.com/reactiveops/fairwinds/pkg/config" - "github.com/reactiveops/fairwinds/pkg/kube" - "github.com/reactiveops/fairwinds/pkg/validator" + conf "github.com/reactiveops/polaris/pkg/config" + "github.com/reactiveops/polaris/pkg/kube" + "github.com/reactiveops/polaris/pkg/validator" "github.com/sirupsen/logrus" "gitlab.com/golang-commonmark/markdown" ) diff --git a/pkg/dashboard/helpers.go b/pkg/dashboard/helpers.go index 065bd8b6..d2b8b5ad 100644 --- a/pkg/dashboard/helpers.go +++ b/pkg/dashboard/helpers.go @@ -15,7 +15,7 @@ package dashboard import ( - "github.com/reactiveops/fairwinds/pkg/validator" + "github.com/reactiveops/polaris/pkg/validator" "strings" ) diff --git a/pkg/dashboard/templates/footer.gohtml b/pkg/dashboard/templates/footer.gohtml index 756986e4..5456f315 100644 --- a/pkg/dashboard/templates/footer.gohtml +++ b/pkg/dashboard/templates/footer.gohtml @@ -1,5 +1,5 @@ {{define "footer"}} {{end}} diff --git a/pkg/dashboard/templates/head.gohtml b/pkg/dashboard/templates/head.gohtml index 45b3b461..4d711ef8 100644 --- a/pkg/dashboard/templates/head.gohtml +++ b/pkg/dashboard/templates/head.gohtml @@ -1,7 +1,7 @@ {{ define "head" }} - Fairwinds + ReactiveOps Polaris diff --git a/pkg/dashboard/templates/main.gohtml b/pkg/dashboard/templates/main.gohtml index 6761744f..b0619a3d 100644 --- a/pkg/dashboard/templates/main.gohtml +++ b/pkg/dashboard/templates/main.gohtml @@ -7,7 +7,7 @@ diff --git a/pkg/dashboard/templates/navbar.gohtml b/pkg/dashboard/templates/navbar.gohtml index a83d0430..01db6ae1 100644 --- a/pkg/dashboard/templates/navbar.gohtml +++ b/pkg/dashboard/templates/navbar.gohtml @@ -5,7 +5,7 @@