Skip to content

Commit e165d3b

Browse files
ci(backend): Oracle host/servicename from env-scoped secrets; security always on
ORACLEDB_HOST and ORACLEDB_SERVICENAME move from GitHub vars to secrets, passed through the init job (env-scoped secrets don't resolve in the deploy matrix) into the backend Secret and read via secretKeyRef. ILCR_SECURITY_ENABLED is no longer parameterized: deployed pods hardcode "true" so auth can never be switched off from CI config.
1 parent 8e9a23e commit e165d3b

3 files changed

Lines changed: 35 additions & 23 deletions

File tree

.github/workflows/reusable-deploy.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
env:
4646
DB_USER: ${{ secrets.ORACLEDB_USERNAME }}
4747
DB_PASS: ${{ secrets.ORACLEDB_PASSWORD }}
48+
DB_HOST: ${{ secrets.ORACLEDB_HOST }}
49+
DB_SERVICENAME: ${{ secrets.ORACLEDB_SERVICENAME }}
4850
COGNITO_POOL: ${{ secrets.USER_POOLS_ID }}
4951
COGNITO_CLIENT: ${{ secrets.USER_POOLS_WEB_CLIENT_ID }}
5052
steps:
@@ -67,6 +69,8 @@ jobs:
6769
-p NAME='${{ github.event.repository.name }}'
6870
-p SPRING_DATASOURCE_USERNAME="$DB_USER"
6971
-p SPRING_DATASOURCE_PASSWORD="$DB_PASS"
72+
-p ORACLEDB_HOST="$DB_HOST"
73+
-p ORACLEDB_SERVICENAME="$DB_SERVICENAME"
7074
-p COGNITO_USER_POOL="$COGNITO_POOL"
7175
-p COGNITO_CLIENT_ID="$COGNITO_CLIENT"
7276
-p COGNITO_DOMAIN='${{ vars.COGNITO_DOMAIN || 'lza-prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com' }}'
@@ -87,16 +91,13 @@ jobs:
8791
include:
8892
- name: backend
8993
file: backend/openshift.deploy.yml
90-
# Security and datasource flags come from GitHub vars, resolved
91-
# environment-first, and FAIL CLOSED: auth is enforced unless a
92-
# var explicitly opts a scope out. The backend refuses to start
93-
# with security off and the datasource on (DeployedSecurityGuard),
94-
# so a mock-auth deployment requires disabling both — mock auth
95-
# never fronts real data.
94+
# Oracle host/servicename are environment-scoped SECRETS, passed
95+
# through the init job above (env-scoped secrets don't resolve in
96+
# this matrix — GitHub evaluates it before the environment
97+
# attaches) into the backend Secret. ILCR_SECURITY_ENABLED is
98+
# hardcoded "true" in the backend template — deployed pods always
99+
# enforce auth.
96100
parameters: -p IMAGE_TAG="${{ inputs.tag }}"
97-
-p ORACLEDB_HOST="${{ vars.ORACLEDB_HOST }}"
98-
-p ORACLEDB_SERVICENAME="${{ vars.ORACLEDB_SERVICENAME }}"
99-
-p ILCR_SECURITY_ENABLED="${{ vars.ILCR_SECURITY_ENABLED || 'true' }}"
100101
-p ILCR_DATASOURCE_ENABLED="${{ vars.ILCR_DATASOURCE_ENABLED || 'true' }}"
101102
- name: frontend
102103
file: frontend/openshift.deploy.yml

backend/openshift.deploy.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,18 @@ parameters:
3535
- name: MEMORY_LIMIT
3636
description: Container memory limit; the JVM heap sizes itself from this cgroup limit via MaxRAMPercentage (see backend/Dockerfile). Raised for the embedded JasperReports 7 engine (Batik/OpenPDF/fonts add classpath + metaspace + native AWT footprint) per AD-16 "size the reporting path's pod CPU/Mem".
3737
value: "1Gi"
38-
- name: ILCR_SECURITY_ENABLED
39-
description: Enforce Cognito (FAM) JWT auth. "false" installs MockPrincipalFilter, treating every request as an authenticated ILCR_SUBMITTER; DeployedSecurityGuard refuses to start a deployed pod with security off and the datasource on. Fail-closed default.
40-
value: "true"
4138
- name: ILCR_DATASOURCE_ENABLED
42-
description: Connect to the Oracle datasource. Set "false" together with ILCR_SECURITY_ENABLED="false" for a data-less mock-auth smoke deployment.
39+
description: Connect to the Oracle datasource. Set "false" for a data-less smoke deployment. Deployed pods always enforce Cognito (FAM) JWT auth — ILCR_SECURITY_ENABLED is hardcoded "true" below, not parameterized.
4340
value: "true"
4441
- name: LOG_LEVEL
4542
description: Application log level (debug|info|warn|error)
4643
value: "info"
47-
- name: ORACLEDB_HOST
48-
description: Oracle database host; the init container fetches its TCPS cert
49-
required: true
44+
# ORACLEDB_HOST / ORACLEDB_SERVICENAME are not parameters: they come from
45+
# environment-scoped GitHub secrets via the init-created backend Secret
46+
# (common/openshift.init.yml), read below with secretKeyRef.
5047
- name: ORACLEDB_PORT
5148
description: Oracle database TCPS port
5249
value: "1543"
53-
- name: ORACLEDB_SERVICENAME
54-
description: Oracle database service name
55-
required: true
5650
- name: COGNITO_REGION
5751
description: AWS region of the Cognito (FAM) user pool
5852
value: ca-central-1
@@ -94,7 +88,10 @@ objects:
9488
imagePullPolicy: Always
9589
env:
9690
- name: ORACLEDB_HOST
97-
value: ${ORACLEDB_HOST}
91+
valueFrom:
92+
secretKeyRef:
93+
name: ${NAME}-${ZONE}-${COMPONENT}
94+
key: ORACLEDB_HOST
9895
- name: ORACLEDB_PORT
9996
value: ${ORACLEDB_PORT}
10097
- name: ORACLEDB_SECRET
@@ -137,15 +134,21 @@ objects:
137134
- name: APP_VERSION
138135
value: ${IMAGE_TAG}
139136
- name: ILCR_SECURITY_ENABLED
140-
value: ${ILCR_SECURITY_ENABLED}
137+
value: "true"
141138
- name: ILCR_DATASOURCE_ENABLED
142139
value: ${ILCR_DATASOURCE_ENABLED}
143140
- name: ORACLEDB_HOST
144-
value: ${ORACLEDB_HOST}
141+
valueFrom:
142+
secretKeyRef:
143+
name: ${NAME}-${ZONE}-${COMPONENT}
144+
key: ORACLEDB_HOST
145145
- name: ORACLEDB_PORT
146146
value: ${ORACLEDB_PORT}
147147
- name: ORACLEDB_SERVICENAME
148-
value: ${ORACLEDB_SERVICENAME}
148+
valueFrom:
149+
secretKeyRef:
150+
name: ${NAME}-${ZONE}-${COMPONENT}
151+
key: ORACLEDB_SERVICENAME
149152
- name: ORACLEDB_KEYSTORE
150153
value: /cert/jssecacerts
151154
- name: COGNITO_REGION

common/openshift.init.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ parameters:
1919
- name: ORACLEDB_KEYSTORE_SECRET
2020
description: Password for the Oracle keystore built by the backend init container
2121
value: changeit
22+
- name: ORACLEDB_HOST
23+
description: Oracle database host (environment-scoped GitHub secret)
24+
required: true
25+
- name: ORACLEDB_SERVICENAME
26+
description: Oracle database service name (environment-scoped GitHub secret)
27+
required: true
2228
- name: COGNITO_USER_POOL
2329
description: Cognito (FAM) user pool ID for JWT validation
2430
required: true
@@ -62,6 +68,8 @@ objects:
6268
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
6369
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
6470
ORACLEDB_KEYSTORE_SECRET: ${ORACLEDB_KEYSTORE_SECRET}
71+
ORACLEDB_HOST: ${ORACLEDB_HOST}
72+
ORACLEDB_SERVICENAME: ${ORACLEDB_SERVICENAME}
6573
COGNITO_USER_POOL: ${COGNITO_USER_POOL}
6674
COGNITO_CLIENT_ID: ${COGNITO_CLIENT_ID}
6775

0 commit comments

Comments
 (0)