Skip to content

Commit 72e1088

Browse files
committed
[PLAT-17482] allow enabling fips with helm
Summary: fips enabled will pass in `-Dorg.bouncycastle.ips.approved_only=true` to YBA Test Plan: new ut helm template . --set yugaware.fips.enabled=true args: [ "bin/yugaware", "-Dorg.bouncycastle.fips.approved_only=true", "-Dconfig.file=/data/application.docker.conf" ] helm template . args: [ "bin/yugaware", "-Dconfig.file=/data/application.docker.conf" ] helm template . --set yugaware.fips.enabled=false args: [ "bin/yugaware", "-Dconfig.file=/data/application.docker.conf" ] helm deployment with fips enabled, see logs: ``` YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - FipsStatus.isReady = true YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - CryptoServicesRegistrar.isInApprovedOnlyMode = true YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - Following providers are installed: YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - 0: BCFIPS YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - 1: BCJSSE YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - 2: SUN YW 2025-06-17T22:41:10.343Z [INFO] from AppInit in main - AppInit completed ``` Reviewers: anijhawan, amalyshev Reviewed By: anijhawan, amalyshev Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D44756
1 parent da96085 commit 72e1088

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

stable/yugaware/templates/statefulset.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,13 @@ spec:
537537
resources:
538538
{{ toYaml .Values.yugaware.resources | indent 12 }}
539539
{{- end }}
540-
args: ["bin/yugaware","-Dconfig.file=/data/application.docker.conf"]
540+
args: [
541+
"bin/yugaware",
542+
{{- if .Values.yugaware.fips.enabled }}
543+
"-Dorg.bouncycastle.fips.approved_only=true",
544+
{{- end }}
545+
"-Dconfig.file=/data/application.docker.conf"
546+
]
541547
env:
542548
# Conditionally set these env variables, if runAsUser is not 0(root)
543549
# or 10001(yugabyte).

stable/yugaware/tests/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Unit Testing Helm charts
2+
Unit tests for the yugaware helm charts, which can be used to validate helm templates
3+
gives us our expected results.
4+
5+
This is leveraging https://github.com/helm-unittest/helm-unittest
6+
7+
See https://github.com/quintush/helm-unittest/blob/master/DOCUMENT.md for details on creating new
8+
tests
9+
10+
## Install
11+
```
12+
$ helm plugin install https://github.com/helm-unittest/helm-unittest.git
13+
```
14+
15+
## Run tests
16+
```
17+
$ cd stable/yugabyte
18+
$ helm unittest -f "tests/test_*.yaml" .
19+
```

stable/yugaware/tests/test_fips.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/quintush/helm-unittest/master/schema/helm-testsuite.json
2+
suite: fips enable and disable
3+
templates:
4+
- templates/statefulset.yaml
5+
tests:
6+
- it: FIPS enabled
7+
set:
8+
yugaware:
9+
fips:
10+
enabled: true
11+
asserts:
12+
- contains:
13+
path: spec.template.spec.containers[?(@.name == "yugaware")].args
14+
content: "-Dorg.bouncycastle.fips.approved_only=true"
15+
- it: FIPS disabled
16+
set:
17+
yugaware:
18+
fips:
19+
enabled: false
20+
asserts:
21+
- contains:
22+
path: spec.template.spec.containers[?(@.name == "yugaware")].args
23+
content: "-Dorg.bouncycastle.fips.approved_only=true"
24+
not: true

stable/yugaware/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ yugaware:
130130
# Crash YBA if operator thread is not initialised correctly
131131
kubernetesOperatorCrashOnFailure: true
132132

133+
fips:
134+
# Enable FIPS mode for YugabyteDB Anywhere.
135+
enabled: false
136+
133137
# Create an initial user for YugabyteDB Anywhere. A user is required for YBA workflows.
134138
defaultUser:
135139
enabled: false

0 commit comments

Comments
 (0)