Skip to content

Commit

Permalink
Merge pull request #181 from uc-cdis/feat/neuvector-krum
Browse files Browse the repository at this point in the history
NeuVector chart and policies -  by Krumware
  • Loading branch information
jawadqur authored May 31, 2024
2 parents 95c0e9a + f1eee0f commit 0978c93
Show file tree
Hide file tree
Showing 32 changed files with 3,765 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-05-01T16:37:41Z",
"generated_at": "2024-05-31T15:29:39Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -346,14 +346,14 @@
"hashed_secret": "7422c958ec5a8e5f87c9e81cdf426ef0e193332c",
"is_secret": false,
"is_verified": false,
"line_number": 81,
"line_number": 83,
"type": "Secret Keyword"
},
{
"hashed_secret": "1740c48fa3141d4851b14f97e3bc0f46f7670672",
"is_secret": false,
"is_verified": false,
"line_number": 115,
"line_number": 117,
"type": "Secret Keyword"
}
],
Expand Down
15 changes: 12 additions & 3 deletions helm/gen3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies:
repository: "file://../pidgin"
condition: pidgin.enabled
- name: portal
version: 0.1.14
version: 0.1.15
repository: "file://../portal"
condition: portal.enabled
- name: requestor
Expand Down Expand Up @@ -96,7 +96,6 @@ dependencies:
repository: "file://../wts"
condition: wts.enabled


- name: elasticsearch
version: 7.10.2
repository: "https://helm.elastic.co"
Expand All @@ -106,6 +105,16 @@ dependencies:
repository: "https://charts.bitnami.com/bitnami"
condition: global.dev

# (optional) NeuVector Kubernetes Security Policy templates to protect Gen3
# NeuVector must be installed separately.
# Reference: https://open-docs.neuvector.com/basics/overview
# Reference: https://github.com/neuvector/neuvector-helm
# For more information, please use the Gen3 community Slack.
- name: neuvector
version: "0.1.0"
repository: "file://../neuvector"
condition: neuvector.enabled

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand All @@ -119,7 +128,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.34
version: 0.1.35

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
14 changes: 12 additions & 2 deletions helm/gen3/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gen3

![Version: 0.1.33](https://img.shields.io/badge/Version-0.1.33-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.35](https://img.shields.io/badge/Version-0.1.35-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

Helm chart to deploy Gen3 Data Commons

Expand Down Expand Up @@ -32,9 +32,10 @@ Helm chart to deploy Gen3 Data Commons
| file://../indexd | indexd | 0.1.14 |
| file://../manifestservice | manifestservice | 0.1.14 |
| file://../metadata | metadata | 0.1.12 |
| file://../neuvector | neuvector | 0.1.0 |
| file://../peregrine | peregrine | 0.1.13 |
| file://../pidgin | pidgin | 0.1.10 |
| file://../portal | portal | 0.1.13 |
| file://../portal | portal | 0.1.15 |
| file://../requestor | requestor | 0.1.11 |
| file://../revproxy | revproxy | 0.1.14 |
| file://../sheepdog | sheepdog | 0.1.14 |
Expand All @@ -59,6 +60,7 @@ Helm chart to deploy Gen3 Data Commons
| aws-es-proxy.secrets.awsSecretAccessKey | str | `""` | AWS secret access key for aws-es-proxy |
| elasticsearch.clusterHealthCheckParams | string | `"wait_for_status=yellow&timeout=1s"` | |
| elasticsearch.clusterName | string | `"gen3-elasticsearch"` | |
| elasticsearch.esConfig."elasticsearch.yml" | string | `"# Here we can add elasticsearch config\n"` | |
| elasticsearch.maxUnavailable | int | `0` | |
| elasticsearch.replicas | int | `1` | |
| elasticsearch.singleNode | bool | `true` | |
Expand Down Expand Up @@ -149,6 +151,14 @@ Helm chart to deploy Gen3 Data Commons
| indexd.enabled | bool | `true` | Whether to deploy the indexd subchart. |
| manifestservice.enabled | bool | `true` | Whether to deploy the manifest service subchart. |
| metadata.enabled | bool | `true` | Whether to deploy the metadata subchart. |
| neuvector.DB_HOST | string | `"development-gen3-postgresql"` | |
| neuvector.ES_HOST | string | `"gen3-elasticsearch-master"` | |
| neuvector.enabled | bool | `false` | |
| neuvector.ingress.class | string | `"nginx"` | |
| neuvector.ingress.controller | string | `"nginx-ingress-controller"` | |
| neuvector.ingress.namespace | string | `"nginx"` | |
| neuvector.policies.include | bool | `false` | |
| neuvector.policies.policyMode | string | `"Monitor"` | |
| peregrine.enabled | bool | `true` | Whether to deploy the peregrine subchart. |
| pidgin.enabled | bool | `true` | Whether to deploy the pidgin subchart. |
| portal.enabled | bool | `true` | Whether to deploy the portal subchart. |
Expand Down
29 changes: 29 additions & 0 deletions helm/gen3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,32 @@ elasticsearch:
singleNode: true
replicas: 1
clusterHealthCheckParams: "wait_for_status=yellow&timeout=1s"
esConfig:
elasticsearch.yml: |
# Here we can add elasticsearch config
# (optional) NeuVector Kubernetes Security Policy templates to protect Gen3
# NeuVector must be installed separately.
# Reference: https://open-docs.neuvector.com/basics/overview
# Reference: https://github.com/neuvector/neuvector-helm
# For more information, please use the Gen3 community Slack.
neuvector:
# install Neuvector
enabled: false
policies:
# deploy predefined Neuvector policies for Gen3
include: false
# Discover, Monitor, or Protect
policyMode: Monitor
# Configure your ingress controller information for enabling ingress to containers
ingress:
# service name of your ingress controller
controller: nginx-ingress-controller
# installation namespace of your ingress controller
namespace: nginx
# classname of your ingress
class: nginx
# Required to allow egress to in-cluster database or external, managed database
DB_HOST: development-gen3-postgresql
# hostname/service name for our ElasitcSearch instance, used to allow egress from containers
ES_HOST: gen3-elasticsearch-master
23 changes: 23 additions & 0 deletions helm/neuvector/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
34 changes: 34 additions & 0 deletions helm/neuvector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v2
name: neuvector
description: NeuVector Kubernetes Security Policy templates to protect Gen3

# NeuVector must be installed separately.
# Reference: https://open-docs.neuvector.com/basics/overview
# Reference: https://github.com/neuvector/neuvector-helm
# For more information, please use the Gen3 community Slack.
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

# Todo: Evaluate inclusion of NeuVector installation
# dependencies:
# - name: neuvector
# version: "5.2.2-s1"
# repository: "https://neuvector.github.io/neuvector-helm/core"
21 changes: 21 additions & 0 deletions helm/neuvector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# neuvector

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)

NeuVector Kubernetes Security Policy templates to protect Gen3

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| ARGOCD_PREFIX | string | `"development-gen3"` | |
| DB_HOST | string | `"development-gen3-postgresql"` | |
| ES_HOST | string | `"gen3-elasticsearch-master"` | |
| fullnameOverride | string | `""` | |
| ingress.class | string | `"nginx"` | |
| ingress.controller | string | `"nginx-ingress-controller"` | |
| ingress.namespace | string | `"nginx"` | |
| nameOverride | string | `""` | |
| policies.include | bool | `true` | |
| policies.policyMode | string | `"Monitor"` | |

62 changes: 62 additions & 0 deletions helm/neuvector/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "neuvector.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
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 "neuvector.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "neuvector.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "neuvector.labels" -}}
helm.sh/chart: {{ include "neuvector.chart" . }}
{{ include "neuvector.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "neuvector.selectorLabels" -}}
app.kubernetes.io/name: {{ include "neuvector.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "neuvector.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "neuvector.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Loading

0 comments on commit 0978c93

Please sign in to comment.