UNCLASSIFIED

Commit 4619dcbc authored by bhearn's avatar bhearn
Browse files

anchore redeploy fix

parent d6ec8a0a
......@@ -4,8 +4,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
---
## [1.13.0-bb.7]
### Fixed
- to resolve an issue where Anchore would redeploy after every update, `./chart/templates/engine_secret.yaml` and `./chart/templates/enterprise_feeds_secret.yaml` were modified to set `ANCHORE_SAML_SECRET` to a randomly generated value if not set and the previous secret does not exist
### Changed
- `./chart/templates/engine_configmap.yaml`, `./chart/templates/enterprise_configmap.yaml`, and `./chart/templates/enterprise_feeds_confimap.yaml` were modified to set appropriate saml secret credentials when a saml secret has been randomly generated but left `Null` by the user at `.Values.anchoreGlobal.saml.secret`
## [1.13.0-bb.6]
## Changed
### Changed
- updated bb-test-lib dependency to gluon `0.2.3` to resolve OPA Gatekeeper violations
- updated Redis dependency to `14.1.0-bb.3` to resolve OPA Gatekeeper violations
- set resource requests and limits for all containers to resolve OPA Gatekeeper violations
......
apiVersion: v2
name: anchore-engine
version: 1.13.0-bb.6
version: 1.13.0-bb.7
appVersion: 0.10.0
description: Anchore container analysis and policy evaluation engine service
keywords:
......
......@@ -59,7 +59,7 @@ data:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
keys:
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret }}
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret .Values.anchoreGlobal.oauthEnabled }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
{{- with .Values.anchoreGlobal.saml.publicKeyName }}
......
......@@ -14,7 +14,13 @@ metadata:
type: Opaque
stringData:
ANCHORE_DB_PASSWORD: {{ index .Values "postgresql" "postgresPassword" | quote }}
{{- with .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ . }}
{{- $anchorefullname := include "anchore-engine.fullname" . -}}
{{- $old_secret := lookup "v1" "Secret" .Release.Namespace $anchorefullname }}
{{- if .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ .Values.anchoreGlobal.saml.secret }}
{{- else if or (not $old_secret) (not $old_secret.data) }}
ANCHORE_SAML_SECRET: {{ (randAlphaNum 12) | quote }}
{{ else }}
ANCHORE_SAML_SECRET: {{ b64dec (index $old_secret.data "ANCHORE_SAML_SECRET") }}
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
......@@ -41,7 +41,7 @@ data:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
keys:
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret }}
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret .Values.anchoreGlobal.oauthEnabled }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
{{- with .Values.anchoreGlobal.saml.publicKeyName }}
......
......@@ -35,7 +35,7 @@ data:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
keys:
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret }}
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret .Values.anchoreGlobal.oauthEnabled }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
{{- with .Values.anchoreGlobal.saml.publicKeyName }}
......
......@@ -15,8 +15,14 @@ metadata:
type: Opaque
stringData:
ANCHORE_FEEDS_DB_PASSWORD: {{ index .Values "anchore-feeds-db" "postgresPassword" | quote }}
{{- with .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ . }}
{{- $anchorefullname := include "anchore-engine.fullname" . -}}
{{- $old_secret := lookup "v1" "Secret" .Release.Namespace $anchorefullname }}
{{- if .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ .Values.anchoreGlobal.saml.secret }}
{{- else if or (not $old_secret) (not $old_secret.data) }}
ANCHORE_SAML_SECRET: {{ (randAlphaNum 12) | quote }}
{{ else }}
ANCHORE_SAML_SECRET: {{ b64dec (index $old_secret.data "ANCHORE_SAML_SECRET") }}
{{- end }}
{{- with .Values.anchoreEnterpriseFeeds.msrcApiKey }}
ANCHORE_MSRC_KEY: {{ . | quote }}
......
......@@ -164,6 +164,8 @@ Create chart name and version as used by the chart label.
{{- end -}}
```
---
In `chart/templates/engine_configmap.yaml`, modify the metrics lines as such:
```yaml
......@@ -197,6 +199,8 @@ And set required environment variables in `chart/templates/enterprise_feed_deplo
value: {{ .Values.monitoring.enabled | quote }}
```
---
To resolve a race condition in Big Bang CI pipelines, an additional sleep argument was added in `chart/templates/engine_upgrade_job.yaml`, `enterprise_upgrade_job.yaml`, and `enterprise_feeds_upgrade_jobs.yaml`:
```yaml
......@@ -205,9 +209,36 @@ To resolve a race condition in Big Bang CI pipelines, an additional sleep argume
anchore-manager db --db-connect postgresql://${ANCHORE_DB_USER}:${ANCHORE_DB_PASSWORD}@${ANCHORE_DB_HOST}/${ANCHORE_DB_NAME} upgrade --dontask;
```
Additionally, a field was added to `chart/templates/engine_upgrade_job.yaml`, `enterprise_upgrade_job.yaml`, and `enterprise_feeds_upgrade_jobs.yaml` to allow users to specify container resource requests and limits for the jobs. This was done to resolve OPA Gatekeeper violations around container resources and ratios:
---
To resolve OPA Gatekeeper violations around container resources and ratios, a field was added to `chart/templates/engine_upgrade_job.yaml`, `enterprise_upgrade_job.yaml`, and `enterprise_feeds_upgrade_jobs.yaml` to allow users to specify container resource requests and limits for the jobs:
```yaml
resources:
{{ toYaml .Values.anchoreEngineUpgradeJob.resources | nindent 10 }}
```
---
To resolve an issue where Anchore would redeploy after every update, `./chart/templates/engine_secret.yaml` and `./chart/templates/enterprise_feeds_secret.yaml` were modified to set `ANCHORE_SAML_SECRET` to a randomly generated value if not set and the previous secret does not exist:
```yaml
{{- $anchorefullname := include "anchore-engine.fullname" . -}}
{{- $old_secret := lookup "v1" "Secret" .Release.Namespace $anchorefullname }}
{{- if .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ .Values.anchoreGlobal.saml.secret }}
{{- else if or (not $old_secret) (not $old_secret.data) }}
ANCHORE_SAML_SECRET: {{ (randAlphaNum 12) | quote }}
{{ else }}
ANCHORE_SAML_SECRET: {{ b64dec (index $old_secret.data "ANCHORE_SAML_SECRET") }}
{{- end }}
```
Additionally, `./chart/templates/engine_configmap.yaml`, `./chart/templates/enterprise_configmap.yaml`, and `./chart/templates/enterprise_feeds_confimap.yaml` were modified to set appropriate saml secret credentials when the saml secret has been randomly generated but left `Null` by the user at `.Values.anchoreGlobal.saml.secret`:
```yaml
keys:
{{- if or .Values.anchoreGlobal.saml.secret .Values.anchoreGlobal.saml.useExistingSecret .Values.anchoreGlobal.oauthEnabled }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
```
\ No newline at end of file
......@@ -23,3 +23,124 @@ The Identity Provider must:
- Allow unencrypted requests and responses
Click the [link](https://docs.anchore.com/current/docs/overview/sso/) for more Anchore security information.
## Note on FIPS
With the current version of Anchore Enterprise (3.1.0), certain functions of Anchore may not work on FIPS enabled nodes. This is a [known issue](https://github.com/anchore/anchore-engine/issues/882) that is being worked on. Until a fix is released, please use node affinity to schedule Anchore pods on non-FIPS nodes:
```yaml
# Example Big Bang values
addons:
anchore:
values:
anchoreAnalyzer:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreApi:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreCatalog:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchorePolicyEngine:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreSimpleQueue:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreEngineUpgradeJob:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreEnterpriseFeedsUpgradeJob:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreEnterpriseReports:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreEnterpriseNotifications:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreEnterpriseUi:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
anchoreEnterpriseEngineUpgradeJob:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- <YOUR_NON_FIPS_NODE_LABEL_HERE>
```
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment