Skip to content

Commit 33c4990

Browse files
authored
feat(dev): control internal TLS skip via env and Helm flag (#329)
## 📝 Description This change enables internal services to skip TLS verification in local clusters where a self-signed certificate is used. It ensures reliable bootstrapping and authentication flow during development without requiring custom trust chains. ## ✅ Checklist - [x] I have tested this change - [ ] This change requires documentation update
1 parent b50ec56 commit 33c4990

File tree

10 files changed

+51
-0
lines changed

10 files changed

+51
-0
lines changed

bootstrapper/cmd/init_org.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
"crypto/tls"
45
"net/http"
56
"os"
67
"time"
@@ -87,8 +88,20 @@ var initOrgCmd = &cobra.Command{
8788
func waitForIngress(domain string) {
8889
url := "https://id." + domain + "/realms/semaphore/.well-known/openid-configuration"
8990

91+
insecure := os.Getenv("TLS_SKIP_VERIFY_INTERNAL") == "true"
92+
93+
tlsConfig := &tls.Config{
94+
MinVersion: tls.VersionTLS12,
95+
}
96+
if insecure {
97+
tlsConfig.InsecureSkipVerify = true // #nosec G402
98+
}
99+
90100
client := &http.Client{
91101
Timeout: 10 * time.Second,
102+
Transport: &http.Transport{
103+
TLSClientConfig: tlsConfig,
104+
},
92105
}
93106

94107
req, _ := http.NewRequest("GET", url, nil)

bootstrapper/helm/templates/init-org-job.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ spec:
5959
name: {{ .Values.global.gitlabApp.secretName }}
6060
{{- end }}
6161
env:
62+
{{- if .Values.global.development.skipTlsVerifyInternal }}
63+
- name: TLS_SKIP_VERIFY_INTERNAL
64+
value: "true"
65+
{{- end }}
6266
{{- if .Values.global.organization.defaultAgentType.enabled }}
6367
- name: DEFAULT_AGENT_TYPE_ENABLED
6468
value: "true"

guard/config/runtime.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,7 @@ if System.get_env("AMQP_URL") != nil do
183183
instance_config: [connection: :amqp]
184184
]
185185
end
186+
187+
if System.get_env("TLS_SKIP_VERIFY_INTERNAL") == "true" do
188+
config :openid_connect, finch_transport_opts: [verify: :verify_none]
189+
end

guard/helm/templates/dpl-api.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ spec:
9797
value: "$(KC_ROOT_URL)/realms/$(KC_REALM)/.well-known/openid-configuration"
9898
- name: OIDC_MANAGE_URL
9999
value: "$(KC_LOCAL_URL)/admin/realms/$(KC_REALM)"
100+
{{- if .Values.global.development.skipTlsVerifyInternal }}
101+
- name: TLS_SKIP_VERIFY_INTERNAL
102+
value: "true"
103+
{{- end }}
100104
- name: BASE_DOMAIN
101105
valueFrom:
102106
configMapKeyRef:

guard/helm/templates/dpl-authentication-api.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ spec:
106106
value: "$(KC_ROOT_URL)/realms/$(KC_REALM)/.well-known/openid-configuration"
107107
- name: OIDC_MANAGE_URL
108108
value: "$(KC_LOCAL_URL)/admin/realms/$(KC_REALM)"
109+
{{- if .Values.global.development.skipTlsVerifyInternal }}
110+
- name: TLS_SKIP_VERIFY_INTERNAL
111+
value: "true"
112+
{{- end }}
109113
- name: LOG_LEVEL
110114
value: {{ .Values.authenticationApi.logging.level | quote }}
111115
- name: ENCRYPTOR_URL

guard/helm/templates/dpl-id-api.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ spec:
9797
value: "$(KC_ROOT_URL)/realms/$(KC_REALM)/.well-known/openid-configuration"
9898
- name: OIDC_MANAGE_URL
9999
value: "$(KC_LOCAL_URL)/admin/realms/$(KC_REALM)"
100+
{{- if .Values.global.development.skipTlsVerifyInternal }}
101+
- name: TLS_SKIP_VERIFY_INTERNAL
102+
value: "true"
103+
{{- end }}
100104
- name: BASE_DOMAIN
101105
valueFrom:
102106
configMapKeyRef:

guard/helm/templates/dpl-worker.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ spec:
9090
value: "$(KC_ROOT_URL)/realms/$(KC_REALM)/.well-known/openid-configuration"
9191
- name: OIDC_MANAGE_URL
9292
value: "$(KC_LOCAL_URL)/admin/realms/$(KC_REALM)"
93+
{{- if .Values.global.development.skipTlsVerifyInternal }}
94+
- name: TLS_SKIP_VERIFY_INTERNAL
95+
value: "true"
96+
{{- end }}
9397
- name: POSTGRES_DB_SSL
9498
value: {{ .Values.global.database.ssl | quote }}
9599
- name: POSTGRES_DB_NAME

guard/helm/templates/instance-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ spec:
103103
value: "$(KC_ROOT_URL)/realms/$(KC_REALM)/.well-known/openid-configuration"
104104
- name: OIDC_MANAGE_URL
105105
value: "$(KC_LOCAL_URL)/admin/realms/$(KC_REALM)"
106+
{{- if .Values.global.development.skipTlsVerifyInternal }}
107+
- name: TLS_SKIP_VERIFY_INTERNAL
108+
value: "true"
109+
{{- end }}
106110
- name: BASE_DOMAIN
107111
valueFrom:
108112
configMapKeyRef:

guard/helm/templates/user-api-dpl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ spec:
9696
value: "$(KC_ROOT_URL)/realms/$(KC_REALM)/.well-known/openid-configuration"
9797
- name: OIDC_MANAGE_URL
9898
value: "$(KC_LOCAL_URL)/admin/realms/$(KC_REALM)"
99+
{{- if .Values.global.development.skipTlsVerifyInternal }}
100+
- name: TLS_SKIP_VERIFY_INTERNAL
101+
value: "true"
102+
{{- end }}
99103
- name: INCLUDE_INSTANCE_CONFIG
100104
value: "true"
101105

helm-chart/values.yaml.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ global:
99
#
1010
writableRootFilesystem: false
1111

12+
#
13+
# When true, disables TLS verification for internal service-to-service calls.
14+
# Use only in development environments with self-signed certificates.
15+
#
16+
skipTlsVerifyInternal: false
17+
1218
domain:
1319
ip: ""
1420
name: ""

0 commit comments

Comments
 (0)