From 834aeacaad06831684e15a0af80f1acd010d3192 Mon Sep 17 00:00:00 2001 From: nissim Date: Thu, 11 Apr 2019 16:44:08 +0300 Subject: [PATCH] Update Aqua Security Helm Charts --- README.md | 25 ++- enforcer/LICENSE | 201 ++++++++++++++++++ enforcer/README.md | 70 ++++++ enforcer/templates/NOTES.txt | 12 ++ enforcer/templates/enforcer-daemonset.yaml | 8 + enforcer/templates/enforcer-token-secret.yaml | 2 + enforcer/values.yaml | 9 +- scanner/LICENSE | 201 ++++++++++++++++++ scanner/README.md | 54 +++++ scanner/templates/NOTES.txt | 12 ++ scanner/templates/scanner-deployment.yaml | 2 +- scanner/values.yaml | 9 +- server/LICENSE | 201 ++++++++++++++++++ server/README.md | 113 ++++++++++ server/templates/NOTES.txt | 12 ++ server/templates/db-deployment.yaml | 8 + server/templates/db-password-secret.yaml | 18 ++ server/templates/gate-deployment.yaml | 26 ++- server/templates/web-deployment.yaml | 46 +++- server/templates/web-secrets.yaml | 2 + server/values.yaml | 11 +- 21 files changed, 1019 insertions(+), 23 deletions(-) create mode 100644 enforcer/LICENSE create mode 100644 enforcer/README.md create mode 100644 enforcer/templates/NOTES.txt create mode 100644 scanner/LICENSE create mode 100644 scanner/README.md create mode 100644 scanner/templates/NOTES.txt create mode 100644 server/LICENSE create mode 100644 server/README.md create mode 100644 server/templates/NOTES.txt diff --git a/README.md b/README.md index 83fa38d9..345c46e1 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ These are Helm charts for installation and maintenance of Aqua Container Securit - [Console](#console) - [Enforcer](#enforcer-1) - [Scanner](#scanner-1) - - [Issues and feedback](#issues-and-feedback) + - [Support](#support) ## Chart Details @@ -199,7 +199,6 @@ The following table lists the configurable parameters of the Console and Enforce | `imageCredentials.name` | Your Docker pull image secret name | `csp-registry-secret` | | `imageCredentials.username` | Your Docker registry (DockerHub, etc.) username | `N/A` | | `imageCredentials.password` | Your Docker registry (DockerHub, etc.) password | `N/A` | -| `imageCredentials.email` | Your Docker registry (DockerHub, etc.) email | `N/A` | | `rbac.enabled` | Create a service account and a ClusterRole | `false` | | `rbac.roleRef` | Use an existing ClusterRole | `` | | `admin.token` | Use this Aqua license token | `N/A` | @@ -243,7 +242,6 @@ The following table lists the configurable parameters of the Console and Enforce | `imageCredentials.name` | Your Docker pull image secret name | `aqua-image-pull-secret` | | `imageCredentials.username` | Your Docker registry (DockerHub, etc.) username | `N/A` | | `imageCredentials.password` | Your Docker registry (DockerHub, etc.) password | `N/A` | -| `imageCredentials.email` | Your Docker registry (DockerHub, etc.) email | `N/A` | | `enforcerToken` | Aqua Enforcer token | `N/A` | | `server` | Gateway host name | `aqua-gateway` | | `port` | Gateway port | `3622` | @@ -251,7 +249,24 @@ The following table lists the configurable parameters of the Console and Enforce ### Scanner +| Parameter | Description | Default | +| --------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------- | +| `rbac.enabled` | Create a service account and a ClusterRole | `false` | +| `rbac.roleRef` | Use an existing ClusterRole | `` | +| `admin.token` | Use this Aqua license token | `N/A` | +| `admin.password` | Use this Aqua admin password | `N/A` | +| `docker.socket.path` | Docker Socket Path | `/var/run/docker.sock` | +| `serviceAccount` | Service Account to use | `csp-sa` | +| `server.serviceName` | Service name of aqua server ui | `csp-consul-svc` | +| `server.port` | service svc port | `8080` | +| `docker.socket.path` | Docker Socket Path | `/var/run/docker.sock` | +| `docker.socket.path` | Docker Socket Path | `/var/run/docker.sock` | +| `enabled` | Enable the Scanner-CLI component | `false` | +| `replicaCount` | Number of Scanner-CLI replicas to run | `1` | +| `user` | Username for the scanner user assigned to the Scanner role | `N/A` | +| `password` | Password for scanner user | `N/A` | + -## Issues and feedback +## Support -If you encounter any problems or would like to give us feedback on deployments, we encourage you to raise issues here on GitHub. +If you encounter any problems or would like to give us feedback on deployments, we encourage you to raise issues here on GitHub please contact us at https://github.com/aquasecurity. \ No newline at end of file diff --git a/enforcer/LICENSE b/enforcer/LICENSE new file mode 100644 index 00000000..8dada3ed --- /dev/null +++ b/enforcer/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/enforcer/README.md b/enforcer/README.md new file mode 100644 index 00000000..bd8bce13 --- /dev/null +++ b/enforcer/README.md @@ -0,0 +1,70 @@ + + +# Aqua Security Enforcer Helm Chart + +These are Helm charts for installation and maintenance of Aqua Container Security Enforcer + +## Contents + +- [Aqua Security Enforcer Helm Chart](#aqua-security-enforcer-helm-chart) + - [Contents](#contents) + - [Prerequisites](#prerequisites) + - [Container Registry Credentials](#container-registry-credentials) + - [Installing the Charts](#installing-the-charts) + - [Configurable Variables](#configurable-variables) + - [Enforcer](#enforcer) + - [Issues and feedback](#issues-and-feedback) + - [Support](#support) + +## Prerequisites + +### Container Registry Credentials + +The Aqua server (Console and Gateway) components are available in our private repository, which requires authentication. By default, the charts create a secret based on the values.yaml. + +First, create a new namespace named "aqua": + +```bash +kubectl create namespace aqua +``` + +Next, **(Optional)** create the secret: + +```bash +kubectl create secret docker-registry csp-registry-secret --docker-server="registry.aquasec.com" --namespace aqua --docker-username="jg@example.com" --docker-password="Truckin" --docker-email="jg@example.com" +``` + +## Installing the Charts + +Clone the GitHub repository with the charts + +```bash +git clone https://github.com/aquasecurity/aqua-helm.git +cd aqua-helm/ +``` + +```bash +helm upgrade --install --namespace aqua csp-enforcer ./enforcer --set imageCredentials.username=<>,imageCredentials.password=<>,enforcerToken= +``` + +## Configurable Variables + +### Enforcer + +| Parameter | Description | Default | +| --------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------- | +| `imageCredentials.create` | Set if to create new pull image secret | `false` | +| `imageCredentials.name` | Your Docker pull image secret name | `aqua-image-pull-secret` | +| `imageCredentials.username` | Your Docker registry (DockerHub, etc.) username | `N/A` | +| `imageCredentials.password` | Your Docker registry (DockerHub, etc.) password | `N/A` | +| `enforcerToken` | Aqua Enforcer token | `N/A` | +| `server` | Gateway host name | `aqua-gateway` | +| `port` | Gateway port | `3622` | + +## Issues and feedback + +If you encounter any problems or would like to give us feedback on deployments, we encourage you to raise issues here on GitHub. + +## Support + +If you encounter any problems or would like to give us feedback on deployments, we encourage you to raise issues here on GitHub please contact us at https://github.com/aquasecurity. \ No newline at end of file diff --git a/enforcer/templates/NOTES.txt b/enforcer/templates/NOTES.txt new file mode 100644 index 00000000..d69013ac --- /dev/null +++ b/enforcer/templates/NOTES.txt @@ -0,0 +1,12 @@ + +Thank you for installing Aqua Security Enforcer. + +Now that you have deployed Aqua Enforcer, you should look over the docs on using: + +https://read.aquasec.com/docs + + +Your release is named {{ .Release.Name }}. To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get {{ .Release.Name }} diff --git a/enforcer/templates/enforcer-daemonset.yaml b/enforcer/templates/enforcer-daemonset.yaml index f0405be4..e7f63f7e 100644 --- a/enforcer/templates/enforcer-daemonset.yaml +++ b/enforcer/templates/enforcer-daemonset.yaml @@ -47,11 +47,19 @@ spec: - SYS_CHROOT {{- end }} env: + {{- if .Values.enforcerTokenSecretName }} + - name: AQUA_TOKEN + valueFrom: + secretKeyRef: + name: {{ .Values.enforcerTokenSecretName }} + key: {{ .Values.enforcerTokenSecretKey }} + {{- else }} - name: AQUA_TOKEN valueFrom: secretKeyRef: name: {{ .Release.Name }}-token key: token + {{- end }} - name: AQUA_SERVER value: {{ .Values.gate.host | default "csp-gateway-svc" }}:{{ .Values.gate.port | default "3622" }} - name: AQUA_INSTALL_PATH diff --git a/enforcer/templates/enforcer-token-secret.yaml b/enforcer/templates/enforcer-token-secret.yaml index 54931cef..316e503b 100644 --- a/enforcer/templates/enforcer-token-secret.yaml +++ b/enforcer/templates/enforcer-token-secret.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.enforcerTokenSecretName }} --- apiVersion: v1 kind: Secret @@ -11,3 +12,4 @@ metadata: type: Opaque data: token: {{ (required "A valid .Values.enforcerToken entry required!" .Values.enforcerToken) | b64enc }} +{{- end }} \ No newline at end of file diff --git a/enforcer/values.yaml b/enforcer/values.yaml index eba95e49..691dbe41 100644 --- a/enforcer/values.yaml +++ b/enforcer/values.yaml @@ -5,14 +5,13 @@ imageCredentials: registry: "registry.aquasec.com" #REQUIRED only if create is true, for dockerhub - "index.docker.io/v1/" username: "" password: "" - email: "example@gmail.com" # example enforcerToken: "" -privileged: true -docker: - socket: - path: "/var/run/docker.sock" # pks - /var/vcap/data/sys/run/docker/docker.sock +enforcerTokenSecretName: null +enforcerTokenSecretKey: null + +privileged: true hostRunPath: "/var/run" # pks - /var/vcap/sys/run/docker runcInterception: false # pks - true , dockerless - true to enable and false to not diff --git a/scanner/LICENSE b/scanner/LICENSE new file mode 100644 index 00000000..8dada3ed --- /dev/null +++ b/scanner/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/scanner/README.md b/scanner/README.md new file mode 100644 index 00000000..358f521e --- /dev/null +++ b/scanner/README.md @@ -0,0 +1,54 @@ + + +# Aqua Security Scanner Helm Chart + +These are Helm charts for installation and maintenance of Aqua Container Security Platform Scanner CLI. + +## Contents + +- [Aqua Security Scanner Helm Chart](#aqua-security-scanner-helm-chart) + - [Contents](#contents) + - [Installing the Chart](#installing-the-chart) + - [Configurable Variables](#configurable-variables) + - [Scanner](#scanner) + - [Support](#support) + +## Installing the Chart + +Clone the GitHub repository with the chart + +```bash +git clone https://github.com/aquasecurity/aqua-helm.git +cd aqua-helm/ +``` + +```bash +helm upgrade --install --namespace aqua scanner ./scanner --set imageCredentials.username=<>,imageCredentials.password=<> +``` + +## Configurable Variables + +The following table lists the configurable parameters of the Console and Enforcer charts with their default values. + +### Scanner + +| Parameter | Description | Default | +| --------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------- | +| `rbac.enabled` | Create a service account and a ClusterRole | `false` | +| `rbac.roleRef` | Use an existing ClusterRole | `` | +| `admin.token` | Use this Aqua license token | `N/A` | +| `admin.password` | Use this Aqua admin password | `N/A` | +| `docker.socket.path` | Docker Socket Path | `/var/run/docker.sock` | +| `serviceAccount` | Service Account to use | `csp-sa` | +| `server.serviceName` | Service name of aqua server ui | `csp-consul-svc` | +| `server.port` | service svc port | `8080` | +| `docker.socket.path` | Docker Socket Path | `/var/run/docker.sock` | +| `docker.socket.path` | Docker Socket Path | `/var/run/docker.sock` | +| `enabled` | Enable the Scanner-CLI component | `false` | +| `replicaCount` | Number of Scanner-CLI replicas to run | `1` | +| `user` | Username for the scanner user assigned to the Scanner role | `N/A` | +| `password` | Password for scanner user | `N/A` | + +## Support + +If you encounter any problems or would like to give us feedback on deployments, we encourage you to raise issues here on GitHub please contact us at https://github.com/aquasecurity. \ No newline at end of file diff --git a/scanner/templates/NOTES.txt b/scanner/templates/NOTES.txt new file mode 100644 index 00000000..6b8c9224 --- /dev/null +++ b/scanner/templates/NOTES.txt @@ -0,0 +1,12 @@ + +Thank you for installing Aqua Security Scanner. + +Now that you have deployed Aqua Scanner, you should look over the docs on using: + +https://read.aquasec.com/docs + + +Your release is named {{ .Release.Name }}. To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get {{ .Release.Name }} diff --git a/scanner/templates/scanner-deployment.yaml b/scanner/templates/scanner-deployment.yaml index 78c74968..838dba87 100644 --- a/scanner/templates/scanner-deployment.yaml +++ b/scanner/templates/scanner-deployment.yaml @@ -23,7 +23,7 @@ spec: serviceAccount: {{ .Values.serviceAccount }} containers: - name: scanner - image: "{{ .Values.imageCredentials.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: "{{ .Values.image.pullPolicy }}" args: - "daemon" diff --git a/scanner/values.yaml b/scanner/values.yaml index 09c1d75e..dc322fca 100644 --- a/scanner/values.yaml +++ b/scanner/values.yaml @@ -1,11 +1,4 @@ -imageCredentials: - create: false - name: csp-registry-secret # When create is false please specify - repositoryUriPrefix: "registry.aquasec.com" # for dockerhub - "docker.io" - registry: "registry.aquasec.com" #REQUIRED only if create is true, for dockerhub - "index.docker.io/v1/" - username: "" - password: "" - email: "example@gmail.com" # example +repositoryUriPrefix: "registry.aquasec.com" # for dockerhub - "docker.io" docker: socket: diff --git a/server/LICENSE b/server/LICENSE new file mode 100644 index 00000000..8dada3ed --- /dev/null +++ b/server/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/README.md b/server/README.md new file mode 100644 index 00000000..20f7220b --- /dev/null +++ b/server/README.md @@ -0,0 +1,113 @@ + + +# Aqua Security Server Helm Chart + +These are Helm charts for installation and maintenance of Aqua Container Security Platform Console Server, Gateway, Database and Scanner CLI + +## Contents + +- [Aqua Security Server Helm Chart](#aqua-security-server-helm-chart) + - [Contents](#contents) + - [Prerequisites](#prerequisites) + - [Container Registry Credentials](#container-registry-credentials) + - [PostgreSQL database](#postgresql-database) + - [Installing the Chart](#installing-the-chart) + - [Server (console)](#server-console) + - [Configurable Variables](#configurable-variables) + - [Console](#console) + - [Support](#support) + +## Prerequisites + +### Container Registry Credentials + +The Aqua server (Console and Gateway) components are available in our private repository, which requires authentication. By default, the charts create a secret based on the values.yaml. + +First, create a new namespace named "aqua": + +```bash +kubectl create namespace aqua +``` + +Next, **(Optional)** create the secret: + +```bash +kubectl create secret docker-registry csp-registry-secret --docker-server="registry.aquasec.com" --namespace aqua --docker-username="jg@example.com" --docker-password="Truckin" --docker-email="jg@example.com" +``` + +### PostgreSQL database + +Aqua Security recommends implementing a highly-available PostgreSQL database. By default, the console chart will install a PostgreSQL database and attach it to persistent storage for POC usage and testing. For production use, one may override this default behavior and specify an existing PostgreSQL database by setting the following variables in values.yaml: + +```yaml +db: + external: + enabled: true + name: example-aquasec + host: aquasec-db + port: 5432 + user: aquasec-db-username + password: verysecret +``` +## Installing the Chart + +Clone the GitHub repository with the charts + +```bash +git clone https://github.com/aquasecurity/aqua-helm.git +cd aqua-helm/ +``` + +### Server (console) + +```bash +helm upgrade --install --namespace aqua csp ./server --set imageCredentials.username=<>,imageCredentials.password=<> +``` + +## Configurable Variables + +### Console + +| Parameter | Description | Default | +| --------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------- | +| `imageCredentials.create` | Set if to create new pull image secret | `true` | +| `imageCredentials.name` | Your Docker pull image secret name | `csp-registry-secret` | +| `imageCredentials.username` | Your Docker registry (DockerHub, etc.) username | `N/A` | +| `imageCredentials.password` | Your Docker registry (DockerHub, etc.) password | `N/A` | +| `rbac.enabled` | Create a service account and a ClusterRole | `false` | +| `rbac.roleRef` | Use an existing ClusterRole | `` | +| `admin.token` | Use this Aqua license token | `N/A` | +| `admin.password` | Use this Aqua admin password | `N/A` | +| `db.external.enabled` | Avoid installing a Postgres container and use an external database instead | `false` | +| `db.external.name` | PostgreSQL DB name | ``N/A`` | +| `db.external.host` | PostgreSQL DB hostname | ``N/A`` | +| `db.external.port` | PostgreSQL DB port | `N/A` | +| `db.external.user` | PostgreSQL DB username | `N/A` | +| `db.external.password` | PostgreSQL DB password | `N/A` | +| `db.image.repository` | Default PostgreSQL Docker image repository | `database` | +| `db.image.tag` | Default PostgreSQL Docker image tag | `4.0` | +| `db.service.type` | Default PostgreSQL service type | `ClusterIP` | +| `db.persistence.enabled` | Enable a use of a PostgreSQL PVC | `true` | +| `db.persistence.storageClass` | PostgreSQL PVC StorageClass | `default` | +| `db.persistence.size` | PostgreSQL PVC volume size | `30Gi` | +| `db.persistence.accessMode` | PostgreSQL PVC volume AccessMode | `ReadWriteOnce` | +| `db.resources` | PostgreSQL pod resources | `{}` | +| `web.service.type` | Web service type | `ClusterIP` | +| `web.ingress.enabled` | Install ingress for the web component | `false` | +| `web.image.repository` | Default Web Docker image repository | `server` | +| `web.image.tag` | Default Web Docker image tag | `4.0` | +| `web.ingress.annotations` | Web ingress annotations | `{}` | +| `web.ingress.hosts` | Web ingress hosts definition | `[]` | +| `web.ingress.tls` | Web ingress tls | `[]` | +| `gate.service.type` | Gate service type | `ClusterIP` | +| `gate.image.repository` | Default Gate Docker image repository | `gate` | +| `gate.image.tag` | Default Gate Docker image tag | `4.0` | +| `gate.publicIP` | Default Gate service public IP | `` | +| `scanner.enabled` | Enable the Scanner-CLI component | `false` | +| `scanner.replicas` | Number of Scanner-CLI replicas to run | `1` | +| `scanner.user` | Username for the scanner user assigned to the Scanner role | `N/A` | +| `scanner.password` | Password for scanner user | `N/A` | + +## Support + +If you encounter any problems or would like to give us feedback on deployments, we encourage you to raise issues here on GitHub please contact us at https://github.com/aquasecurity. \ No newline at end of file diff --git a/server/templates/NOTES.txt b/server/templates/NOTES.txt new file mode 100644 index 00000000..4ac3e7b5 --- /dev/null +++ b/server/templates/NOTES.txt @@ -0,0 +1,12 @@ + +Thank you for installing Aqua Security Server. + +Now that you have deployed Aqua Server, you should look over the docs on using: + +https://read.aquasec.com/docs + + +Your release is named {{ .Release.Name }}. To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get {{ .Release.Name }} diff --git a/server/templates/db-deployment.yaml b/server/templates/db-deployment.yaml index 25781e43..b38a9c4d 100644 --- a/server/templates/db-deployment.yaml +++ b/server/templates/db-deployment.yaml @@ -26,11 +26,19 @@ spec: image: "{{ .Values.imageCredentials.repositoryUriPrefix }}/{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}" imagePullPolicy: "{{ .Values.db.image.pullPolicy }}" env: + {{- if .Values.db.passwordSecret }} + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.db.dbPasswordName }} + key: {{ .Values.db.dbPasswordKey }} + {{- else }} - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: {{ .Release.Name }}-database-password key: db-password + {{- end }} - name: PGDATA value: "/var/lib/postgresql/data/db-files" - name: POD_IP diff --git a/server/templates/db-password-secret.yaml b/server/templates/db-password-secret.yaml index 697a0d1f..b6e220a5 100644 --- a/server/templates/db-password-secret.yaml +++ b/server/templates/db-password-secret.yaml @@ -1,4 +1,5 @@ +{{- if not .Values.db.passwordSecret }} {{- if .Values.db.external.enabled }} --- apiVersion: v1 @@ -16,6 +17,22 @@ metadata: type: Opaque data: db-password: {{ .Values.db.external.password | b64enc | quote }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-database-audit-password + labels: + app: {{ .Release.Name }}-database + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": before-hook-creation +type: Opaque +data: + db-audit-password: {{ .Values.db.external.auditPassword | b64enc | quote }} {{- else }} --- apiVersion: v1 @@ -34,3 +51,4 @@ type: Opaque data: db-password: {{ randAlphaNum 20 | b64enc | quote }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/server/templates/gate-deployment.yaml b/server/templates/gate-deployment.yaml index 660df58e..89a13caa 100644 --- a/server/templates/gate-deployment.yaml +++ b/server/templates/gate-deployment.yaml @@ -36,11 +36,19 @@ spec: value: "0.0.0.0:8082" - name: SCALOCK_DBUSER value: {{ .Values.db.external.enabled | ternary .Values.db.external.user "postgres" }} + {{- if .Values.db.passwordSecret }} + - name: SCALOCK_DBPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.db.dbPasswordName }} + key: {{ .Values.db.dbPasswordKey }} + {{- else }} - name: SCALOCK_DBPASSWORD valueFrom: secretKeyRef: name: {{ .Release.Name }}-database-password key: db-password + {{- end }} - name: SCALOCK_DBNAME value: {{ .Values.db.external.enabled | ternary .Values.db.external.name "scalock" }} - name: SCALOCK_DBHOST @@ -53,11 +61,27 @@ spec: value: {{ .Values.db.external.enabled | ternary .Values.db.external.port "5432" | quote }} - name: SCALOCK_AUDIT_DBUSER value: {{ .Values.db.external.enabled | ternary .Values.db.external.auditUser "postgres" }} + {{- if .Values.db.passwordSecret }} + - name: SCALOCK_AUDIT_DBPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.db.dbAuditPasswordName }} + key: {{ .Values.db.dbAuditPasswordKey }} + {{- else }} + {{- if .Values.db.external.enabled }} + - name: SCALOCK_AUDIT_DBPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-database-audit-password + key: db-audit-password + {{- else }} - name: SCALOCK_AUDIT_DBPASSWORD valueFrom: secretKeyRef: name: {{ .Release.Name }}-database-password - key: db-password + key: db-password + {{- end }} + {{- end }} - name: SCALOCK_AUDIT_DBNAME value: {{ .Values.db.external.enabled | ternary .Values.db.external.auditName "slk_audit" }} - name: SCALOCK_AUDIT_DBHOST diff --git a/server/templates/web-deployment.yaml b/server/templates/web-deployment.yaml index 3e30dce4..5c57a668 100644 --- a/server/templates/web-deployment.yaml +++ b/server/templates/web-deployment.yaml @@ -32,11 +32,19 @@ spec: env: - name: SCALOCK_DBUSER value: {{ .Values.db.external.enabled | ternary .Values.db.external.user "postgres" }} + {{- if .Values.db.passwordSecret }} + - name: SCALOCK_DBPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.db.dbPasswordName }} + key: {{ .Values.db.dbPasswordKey }} + {{- else }} - name: SCALOCK_DBPASSWORD valueFrom: secretKeyRef: name: {{ .Release.Name }}-database-password key: db-password + {{- end }} - name: SCALOCK_DBNAME value: {{ .Values.db.external.enabled | ternary .Values.db.external.name "scalock" }} - name: SCALOCK_DBHOST @@ -49,11 +57,27 @@ spec: value: {{ .Values.db.external.enabled | ternary .Values.db.external.port "5432" | quote }} - name: SCALOCK_AUDIT_DBUSER value: {{ .Values.db.external.enabled | ternary .Values.db.external.auditUser "postgres" }} + {{- if .Values.db.passwordSecret }} + - name: SCALOCK_AUDIT_DBPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.db.dbAuditPasswordName }} + key: {{ .Values.db.dbAuditPasswordKey }} + {{- else }} + {{- if .Values.db.external.enabled }} + - name: SCALOCK_AUDIT_DBPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-database-audit-password + key: db-audit-password + {{- else }} - name: SCALOCK_AUDIT_DBPASSWORD valueFrom: secretKeyRef: name: {{ .Release.Name }}-database-password - key: db-password + key: db-password + {{- end }} + {{- end }} - name: SCALOCK_AUDIT_DBNAME value: {{ .Values.db.external.enabled | ternary .Values.db.external.auditName "slk_audit" }} - name: SCALOCK_AUDIT_DBHOST @@ -64,6 +88,13 @@ spec: {{- end }} - name: SCALOCK_AUDIT_DBPORT value: {{ .Values.db.external.enabled | ternary .Values.db.external.auditPort "5432" | quote }} + {{- if .Values.admin.secretname }} + - name: LICENSE_TOKEN + valueFrom: + secretKeyRef: + name: {{ .Values.admin.secretname }} + key: {{ .Values.admin.tokenkey }} + {{- else }} {{- if .Values.admin.token }} - name: LICENSE_TOKEN valueFrom: @@ -71,6 +102,14 @@ spec: name: {{ .Release.Name }}-console-secrets key: license-token {{- end }} + {{- end }} + {{- if .Values.admin.secretname }} + - name: ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.admin.secretname }} + key: {{ .Values.admin.passwordkey }} + {{- else }} {{- if .Values.admin.password }} - name: ADMIN_PASSWORD valueFrom: @@ -78,6 +117,7 @@ spec: name: {{ .Release.Name }}-console-secrets key: admin-password {{- end }} + {{- end }} {{- if .Values.db.ssl }} - name: SCALOCK_DBSSL value: require @@ -105,6 +145,10 @@ spec: - name: DISABLE_IP_BAN value: "0" {{- end }} + {{- if Values.clustermode }} + - name: CLUSTER_MODE + value: "enable" + {{- end }} ports: - containerPort: 8080 protocol: TCP diff --git a/server/templates/web-secrets.yaml b/server/templates/web-secrets.yaml index dc870b89..c392b114 100644 --- a/server/templates/web-secrets.yaml +++ b/server/templates/web-secrets.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.admin.secretname }} {{- if or (( .Values.admin.password) .Values.admin.token) }} --- apiVersion: v1 @@ -19,4 +20,5 @@ data: {{- if .Values.admin.token }} license-token: {{ .Values.admin.token | b64enc | quote }} {{- end }} +{{- end }} {{- end }} \ No newline at end of file diff --git a/server/values.yaml b/server/values.yaml index 3df98b66..5bd2d679 100644 --- a/server/values.yaml +++ b/server/values.yaml @@ -6,18 +6,20 @@ imageCredentials: registry: "registry.aquasec.com" #REQUIRED only if create is true, for dockerhub - "index.docker.io/v1/" username: "" password: "" - email: "example@gmail.com" rbac: enabled: true roleRef: privileged: true +clustermode: false admin: token: password: - clustermode: false + secretname: null + tokenkey: null + passwordkey: null docker: socket: @@ -38,6 +40,11 @@ db: auditPort: auditUser: auditPassword: + passwordSecret: null + dbPasswordName: null + dbPasswordKey: null + dbAuditPasswordName: null + dbAuditPasswordKey: null ssl: false auditssl: false image: