-
Notifications
You must be signed in to change notification settings - Fork 1
fix(openshift): apply route IP allowlist to production only #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alex-struk
wants to merge
5
commits into
develop
Choose a base branch
from
fix/route-ip-whitelist-bcgov-range
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+217
−137
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6f452f3
fix(openshift): correct route ip_allowlist to full BC Gov 142.x range
alex-struk 2c61308
fix(openshift): make route IP allowlist production-only
alex-struk 01021c9
fix(openshift): use ip_allowlist annotation key for prod route restri…
alex-struk 92325ea
chore(openshift): remove dead prod/test/dev kustomize overlays
alex-struk 2ff60b2
chore(openshift): keep prod/test/dev overlays as commented reference
alex-struk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
deployments/openshift/kustomize/components/prod-resources/route-allowlist-backend.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Production-only source-IP allowlist for the backend Route. | ||
| # | ||
| # Merged in only for *-prod namespaces (see components/prod-resources/kustomization.yml, | ||
| # included by scripts/lib/generate-overlay.sh when the namespace ends in -prod). Test/dev | ||
| # and ephemeral PR instances inherit the open base Route and stay reachable without VPN. | ||
| # | ||
| # Value is the full BC Gov public 142.x allocation (ARIN org PBC-51-Z): 142.22.0.0/16– | ||
| # 142.36.0.0/16. This covers VPN egress and the Silver/Gold/Gold-DR NAT pools (all within | ||
| # 142.34.0.0/16). Ref: https://whois.arin.net/rest/org/PBC-51-Z/nets | ||
| # | ||
| # Uses the ip_allowlist annotation key (renamed from ip_whitelist in PR #218 / AI-1341 | ||
| # for inclusive naming; honored by the Silver cluster's OpenShift HAProxy router). | ||
| apiVersion: route.openshift.io/v1 | ||
| kind: Route | ||
| metadata: | ||
| name: backend-services | ||
| annotations: | ||
| haproxy.router.openshift.io/ip_allowlist: >- | ||
| 142.22.0.0/16 142.23.0.0/16 142.24.0.0/16 142.25.0.0/16 142.26.0.0/16 | ||
| 142.27.0.0/16 142.28.0.0/16 142.29.0.0/16 142.30.0.0/16 142.31.0.0/16 | ||
| 142.32.0.0/16 142.33.0.0/16 142.34.0.0/16 142.35.0.0/16 142.36.0.0/16 |
21 changes: 21 additions & 0 deletions
21
deployments/openshift/kustomize/components/prod-resources/route-allowlist-frontend.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Production-only source-IP allowlist for the frontend Route. | ||
| # | ||
| # Merged in only for *-prod namespaces (see components/prod-resources/kustomization.yml, | ||
| # included by scripts/lib/generate-overlay.sh when the namespace ends in -prod). Test/dev | ||
| # and ephemeral PR instances inherit the open base Route and stay reachable without VPN. | ||
| # | ||
| # Value is the full BC Gov public 142.x allocation (ARIN org PBC-51-Z): 142.22.0.0/16– | ||
| # 142.36.0.0/16. This covers VPN egress and the Silver/Gold/Gold-DR NAT pools (all within | ||
| # 142.34.0.0/16). Ref: https://whois.arin.net/rest/org/PBC-51-Z/nets | ||
| # | ||
| # Uses the ip_allowlist annotation key (renamed from ip_whitelist in PR #218 / AI-1341 | ||
| # for inclusive naming; honored by the Silver cluster's OpenShift HAProxy router). | ||
| apiVersion: route.openshift.io/v1 | ||
| kind: Route | ||
| metadata: | ||
| name: frontend | ||
| annotations: | ||
| haproxy.router.openshift.io/ip_allowlist: >- | ||
| 142.22.0.0/16 142.23.0.0/16 142.24.0.0/16 142.25.0.0/16 142.26.0.0/16 | ||
| 142.27.0.0/16 142.28.0.0/16 142.29.0.0/16 142.30.0.0/16 142.31.0.0/16 | ||
| 142.32.0.0/16 142.33.0.0/16 142.34.0.0/16 142.35.0.0/16 142.36.0.0/16 |
42 changes: 26 additions & 16 deletions
42
deployments/openshift/kustomize/overlays/dev/kustomization.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,26 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| namespace: fd34fb-test | ||
| resources: | ||
| - ../../base | ||
| images: | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/backend-services | ||
| newTag: develop-latest | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/temporal | ||
| newTag: develop-latest | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/frontend | ||
| newTag: develop-latest | ||
| commonLabels: | ||
| env: dev | ||
|
|
||
|
|
||
| # ============================================================================= | ||
| # PENDING / NOT WIRED IN — fixed-overlay deploy path for dev. | ||
| # | ||
| # Kept as a legible reference for a possible future "hybrid" deploy model: | ||
| # fixed, committed overlays alongside the generate-overlay.sh + | ||
| # overlays/instance-template script that is required for ephemeral branch | ||
| # instances. Nothing in the pipeline builds this file today. Left fully | ||
| # commented out on purpose so it stays inert until the decision is made. | ||
| # | ||
| # AI-1687 — https://citz-do.atlassian.net/browse/AI-1687 | ||
| # ============================================================================= | ||
| # | ||
| # apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| # kind: Kustomization | ||
| # namespace: fd34fb-test | ||
| # resources: | ||
| # - ../../base | ||
| # images: | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/backend-services | ||
| # newTag: develop-latest | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/temporal | ||
| # newTag: develop-latest | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/frontend | ||
| # newTag: develop-latest | ||
| # commonLabels: | ||
| # env: dev |
30 changes: 19 additions & 11 deletions
30
deployments/openshift/kustomize/overlays/prod/backend-services-configmap.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: backend-services-config | ||
| data: | ||
| FRONTEND_URL: "https://frontend-fd34fb-prod.apps.silver.devops.gov.bc.ca" | ||
| BACKEND_URL: "https://backend-services-fd34fb-prod.apps.silver.devops.gov.bc.ca" | ||
| SSO_REDIRECT_URI: "https://frontend-fd34fb-prod.apps.silver.devops.gov.bc.ca/api/auth/callback" | ||
| SSO_AUTH_SERVER_URL: "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect" | ||
| SSO_REALM: "standard" | ||
| SSO_CLIENT_ID: "ai-adoption-document-intelligence-6162" | ||
| # ============================================================================= | ||
| # PENDING / NOT WIRED IN — configmap patch consumed by the fixed prod overlay | ||
| # (overlays/prod/kustomization.yml). Kept as a legible reference for the future | ||
| # hybrid deploy model; nothing builds it today. Left commented out on purpose. | ||
| # | ||
| # AI-1687 — https://citz-do.atlassian.net/browse/AI-1687 | ||
| # ============================================================================= | ||
| # | ||
| # apiVersion: v1 | ||
| # kind: ConfigMap | ||
| # metadata: | ||
| # name: backend-services-config | ||
| # data: | ||
| # FRONTEND_URL: "https://frontend-fd34fb-prod.apps.silver.devops.gov.bc.ca" | ||
| # BACKEND_URL: "https://backend-services-fd34fb-prod.apps.silver.devops.gov.bc.ca" | ||
| # SSO_REDIRECT_URI: "https://frontend-fd34fb-prod.apps.silver.devops.gov.bc.ca/api/auth/callback" | ||
| # SSO_AUTH_SERVER_URL: "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect" | ||
| # SSO_REALM: "standard" | ||
| # SSO_CLIENT_ID: "ai-adoption-document-intelligence-6162" |
65 changes: 37 additions & 28 deletions
65
deployments/openshift/kustomize/overlays/prod/kustomization.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,37 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| namespace: fd34fb-prod | ||
| resources: | ||
| - ../../base | ||
| patches: | ||
| - path: backend-services-configmap.yml | ||
| target: | ||
| kind: ConfigMap | ||
| name: backend-services-config | ||
| - path: route-allowlist-patch.yml | ||
| target: | ||
| kind: Route | ||
| name: backend-services | ||
| - path: route-allowlist-patch.yml | ||
| target: | ||
| kind: Route | ||
| name: frontend | ||
| images: | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/backend-services | ||
| newTag: main-latest | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/temporal | ||
| newTag: main-latest | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/frontend | ||
| newTag: main-latest | ||
| commonLabels: | ||
| env: prod | ||
|
|
||
| # ============================================================================= | ||
| # PENDING / NOT WIRED IN — fixed-overlay deploy path for prod. | ||
| # | ||
| # Kept as a legible reference for a possible future "hybrid" deploy model: | ||
| # fixed, committed overlays for the stable test/prod environments alongside the | ||
| # generate-overlay.sh + overlays/instance-template script that is required for | ||
| # ephemeral branch instances. Nothing in the pipeline builds this file today — | ||
| # the live deploy path renders EVERY environment (incl. test/prod) from | ||
| # overlays/instance-template. Left fully commented out on purpose so it stays | ||
| # inert until the decision is made. | ||
| # | ||
| # AI-1687 — https://citz-do.atlassian.net/browse/AI-1687 | ||
| # | ||
| # If adopting this for prod: seed it from the CURRENTLY RENDERED object | ||
| # names/labels (a static namePrefix matching today's instance name + the same | ||
| # commonLabels) so it lands as an in-place `oc apply`, NOT a rename/migration. | ||
| # ============================================================================= | ||
| # | ||
| # apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| # kind: Kustomization | ||
| # namespace: fd34fb-prod | ||
| # resources: | ||
| # - ../../base | ||
| # patches: | ||
| # - path: backend-services-configmap.yml | ||
| # target: | ||
| # kind: ConfigMap | ||
| # name: backend-services-config | ||
| # images: | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/backend-services | ||
| # newTag: main-latest | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/temporal | ||
| # newTag: main-latest | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/frontend | ||
| # newTag: main-latest | ||
| # commonLabels: | ||
| # env: prod |
3 changes: 0 additions & 3 deletions
3
deployments/openshift/kustomize/overlays/prod/route-allowlist-patch.yml
This file was deleted.
Oops, something went wrong.
30 changes: 19 additions & 11 deletions
30
deployments/openshift/kustomize/overlays/test/backend-services-configmap.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: backend-services-config | ||
| data: | ||
| FRONTEND_URL: "https://frontend-fd34fb-test.apps.silver.devops.gov.bc.ca" | ||
| BACKEND_URL: "https://backend-services-fd34fb-test.apps.silver.devops.gov.bc.ca" | ||
| SSO_REDIRECT_URI: "https://frontend-fd34fb-test.apps.silver.devops.gov.bc.ca/api/auth/callback" | ||
| SSO_AUTH_SERVER_URL: "https://test.loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect" | ||
| SSO_REALM: "standard" | ||
| SSO_CLIENT_ID: "ai-adoption-document-intelligence-6162" | ||
| # ============================================================================= | ||
| # PENDING / NOT WIRED IN — configmap patch consumed by the fixed test overlay | ||
| # (overlays/test/kustomization.yml). Kept as a legible reference for the future | ||
| # hybrid deploy model; nothing builds it today. Left commented out on purpose. | ||
| # | ||
| # AI-1687 — https://citz-do.atlassian.net/browse/AI-1687 | ||
| # ============================================================================= | ||
| # | ||
| # apiVersion: v1 | ||
| # kind: ConfigMap | ||
| # metadata: | ||
| # name: backend-services-config | ||
| # data: | ||
| # FRONTEND_URL: "https://frontend-fd34fb-test.apps.silver.devops.gov.bc.ca" | ||
| # BACKEND_URL: "https://backend-services-fd34fb-test.apps.silver.devops.gov.bc.ca" | ||
| # SSO_REDIRECT_URI: "https://frontend-fd34fb-test.apps.silver.devops.gov.bc.ca/api/auth/callback" | ||
| # SSO_AUTH_SERVER_URL: "https://test.loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect" | ||
| # SSO_REALM: "standard" | ||
| # SSO_CLIENT_ID: "ai-adoption-document-intelligence-6162" |
70 changes: 39 additions & 31 deletions
70
deployments/openshift/kustomize/overlays/test/kustomization.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,39 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| namespace: fd34fb-test | ||
| resources: | ||
| - ../../base | ||
| patches: | ||
| - path: backend-services-configmap.yml | ||
| target: | ||
| kind: ConfigMap | ||
| name: backend-services-config | ||
| - path: route-allowlist-patch.yml | ||
| target: | ||
| kind: Route | ||
| name: backend-services | ||
| - path: route-allowlist-patch.yml | ||
| target: | ||
| kind: Route | ||
| name: frontend | ||
| images: | ||
| # Pin digest so cluster pulls the image currently in Artifactory (avoids stale tag cache) | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/backend-services | ||
| newTag: develop-latest1 | ||
| # digest: sha256:282be39343c2f570f21ee76f0a81e8af8f5726d59c0820a86228d39d4fa513b1 | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/temporal | ||
| newTag: develop-latest | ||
| - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/frontend | ||
| newTag: develop-latest | ||
| commonLabels: | ||
| env: dev | ||
|
|
||
|
|
||
| # ============================================================================= | ||
| # PENDING / NOT WIRED IN — fixed-overlay deploy path for test. | ||
| # | ||
| # Kept as a legible reference for a possible future "hybrid" deploy model: | ||
| # fixed, committed overlays for the stable test/prod environments alongside the | ||
| # generate-overlay.sh + overlays/instance-template script that is required for | ||
| # ephemeral branch instances. Nothing in the pipeline builds this file today — | ||
| # the live deploy path renders EVERY environment (incl. test/prod) from | ||
| # overlays/instance-template. Left fully commented out on purpose so it stays | ||
| # inert until the decision is made. | ||
| # | ||
| # AI-1687 — https://citz-do.atlassian.net/browse/AI-1687 | ||
| # | ||
| # If adopting this for test: seed it from the CURRENTLY RENDERED object | ||
| # names/labels (a static namePrefix matching today's instance name + the same | ||
| # commonLabels) so it lands as an in-place `oc apply`, NOT a rename/migration. | ||
| # ============================================================================= | ||
| # | ||
| # apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| # kind: Kustomization | ||
| # namespace: fd34fb-test | ||
| # resources: | ||
| # - ../../base | ||
| # patches: | ||
| # - path: backend-services-configmap.yml | ||
| # target: | ||
| # kind: ConfigMap | ||
| # name: backend-services-config | ||
| # images: | ||
| # # Pin digest so cluster pulls the image currently in Artifactory (avoids stale tag cache) | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/backend-services | ||
| # newTag: develop-latest1 | ||
| # # digest: sha256:282be39343c2f570f21ee76f0a81e8af8f5726d59c0820a86228d39d4fa513b1 | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/temporal | ||
| # newTag: develop-latest | ||
| # - name: artifacts.developer.gov.bc.ca/kfd3-fd34fb-local/frontend | ||
| # newTag: develop-latest | ||
| # commonLabels: | ||
| # env: dev |
3 changes: 0 additions & 3 deletions
3
deployments/openshift/kustomize/overlays/test/route-allowlist-patch.yml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.