Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0ad1092
sync changes to master from release-0.18.0
akhilnittala May 29, 2026
a89b09d
Merge branch 'argoproj-labs:master' into master
akhilnittala Jun 4, 2026
6348f0e
Merge branch 'argoproj-labs:master' into master
akhilnittala Jun 11, 2026
1311c6e
Merge branch 'argoproj-labs:master' into master
akhilnittala Jun 16, 2026
f1c338a
Merge branch 'argoproj-labs:master' into master
akhilnittala Jun 23, 2026
80e93f8
Merge branch 'argoproj-labs:master' into master
akhilnittala Jun 24, 2026
d024e0c
Merge branch 'argoproj-labs:master' into master
akhilnittala Jun 29, 2026
9b21cf6
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 3, 2026
1bc199c
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 7, 2026
eb3a25d
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 7, 2026
c9e571d
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 8, 2026
3cfbf0d
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 14, 2026
7aabeaf
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 20, 2026
2b78dee
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 27, 2026
86459ca
Merge branch 'argoproj-labs:master' into master
akhilnittala Jul 31, 2026
606d2d2
Merge branch 'argoproj-labs:master' into master
akhilnittala Sep 7, 2026
36fb6ac
Merge branch 'argoproj-labs:master' into master
akhilnittala Sep 10, 2026
6fa85c6
Configure TLS Parameters
akhilnittala Sep 11, 2026
edc98ac
Configure TLS Parameters
akhilnittala Sep 11, 2026
7152dc2
Configure TLS Parameters
akhilnittala Sep 11, 2026
7984f5d
Configure TLS Parameters
akhilnittala Sep 15, 2026
16c18f6
Configure TLS Parameters
akhilnittala Sep 15, 2026
84342f2
Configure TLS Parameters
akhilnittala Sep 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const (
ArgoCDDexServerTokenRenewalThresholdPercent int64 = 33

// ArgoCDDefaultDexVersion is the Dex container image tag to use when not specified.
ArgoCDDefaultDexVersion = "sha256:8499afd690c437f52301efd2b05b2455da5bd2dfc20332cd697dc9937f808462" // v2.45.1
ArgoCDDefaultDexVersion = "sha256:f5d77499df7ea3ff0bdc5f9e218e4be8fac3b91a1b29b64a7158a5876850fb20" // v2.45.1
Comment thread
akhilnittala marked this conversation as resolved.
Outdated

// ArgoCDDefaultDexRunAsUser is the numeric UID of the "dex" user declared in the Dex image.
// Kubernetes requires a numeric runAsUser when runAsNonRoot is true and the image USER is a named string.
Expand Down
3 changes: 1 addition & 2 deletions controllers/argocd/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ func (r *ReconcileArgoCD) reconcileArgoConfigMap(cr *argoproj.ArgoCD) error {

// create dex config if dex is enabled through `.spec.sso`
if UseDex(cr) {
dexConfig := getDexConfig(cr)

dexConfig := getDexConfig(cr, r.CentralTLSConfigProfile)
// Append the default OpenShift dex config if the openShiftOAuth is requested through `.spec.sso.dex`.
if cr.Spec.SSO != nil && cr.Spec.SSO.Dex != nil && cr.Spec.SSO.Dex.OpenShiftOAuth {
cfg, err := r.getOpenShiftDexConfig(cr)
Expand Down
9 changes: 5 additions & 4 deletions controllers/argocd/dex.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
argoproj "github.com/argoproj-labs/argocd-operator/api/v1beta1"
"github.com/argoproj-labs/argocd-operator/common"
"github.com/argoproj-labs/argocd-operator/controllers/argoutil"
tlsProfile "github.com/argoproj-labs/argocd-operator/pkg/tlsprofile"
)

// DexConnector represents an authentication connector for Dex.
Expand Down Expand Up @@ -216,7 +217,7 @@ func (r *ReconcileArgoCD) reconcileDexLegacySATokenSecrets(cr *argoproj.ArgoCD)
// reconcileDexConfiguration will ensure that Dex is configured properly.
func (r *ReconcileArgoCD) reconcileDexConfiguration(cm *corev1.ConfigMap, cr *argoproj.ArgoCD) error {
actual := cm.Data[common.ArgoCDKeyDexConfig]
desired := getDexConfig(cr)
desired := getDexConfig(cr, r.CentralTLSConfigProfile)

// Append the default OpenShift dex config if the openShiftOAuth is requested through `.spec.sso.dex`.
if cr.Spec.SSO != nil && cr.Spec.SSO.Dex != nil && cr.Spec.SSO.Dex.OpenShiftOAuth {
Expand Down Expand Up @@ -304,16 +305,16 @@ func (r *ReconcileArgoCD) getOpenShiftDexConfig(cr *argoproj.ArgoCD) (string, er
dex["connectors"] = connectors

// add dex config from the Argo CD CR.
if err := addDexConfigFromCR(cr, dex); err != nil {
if err := addDexConfigFromCR(cr, dex, r.CentralTLSConfigProfile); err != nil {
return "", err
}

bytes, err := yaml.Marshal(dex)
return string(bytes), err
}

func addDexConfigFromCR(cr *argoproj.ArgoCD, dex map[string]any) error {
dexCfgStr := getDexConfig(cr)
func addDexConfigFromCR(cr *argoproj.ArgoCD, dex map[string]any, centralTLSConfig tlsProfile.TLSConfigProfile) error {
dexCfgStr := getDexConfig(cr, centralTLSConfig)
if dexCfgStr == "" {
return nil
}
Expand Down
22 changes: 21 additions & 1 deletion controllers/argocd/dexUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
argoproj "github.com/argoproj-labs/argocd-operator/api/v1beta1"
"github.com/argoproj-labs/argocd-operator/common"
"github.com/argoproj-labs/argocd-operator/controllers/argoutil"
tlsProfile "github.com/argoproj-labs/argocd-operator/pkg/tlsprofile"
)

// getDexContainerImage will return the container image for the Dex server.
Expand Down Expand Up @@ -78,8 +79,27 @@ func getDexResources(cr *argoproj.ArgoCD) corev1.ResourceRequirements {
return resources
}

func getDexConfig(cr *argoproj.ArgoCD) string {
func getDexConfig(cr *argoproj.ArgoCD, centralTLSConfig tlsProfile.TLSConfigProfile) string {
config := common.ArgoCDDefaultDexConfig
// build TLSMinVersion, TLSCiphers, TLSCurvePreferences
if !centralTLSConfig.DisableClusterTLSProfile {
config += "\nweb:"
if v := argoutil.TLSProtocolVersionString(centralTLSConfig.MinVersion); v != "" {
config += fmt.Sprintf("\n tlsMinVersion: %q", v)
}
if ciphers := argoutil.MapCipherSuites(centralTLSConfig.Ciphers); len(ciphers) > 0 {
config += "\n tlsCiphers:"
for _, cipher := range ciphers {
config += fmt.Sprintf("\n - %q", cipher)
}
}
if len(centralTLSConfig.CurvePreferences) > 0 {
config += "\n tlsCurvePreferences:"
for _, curve := range centralTLSConfig.CurvePreferences {
config += fmt.Sprintf("\n - %q", curve)
}
Comment thread
akhilnittala marked this conversation as resolved.
}
}

// Allow override of config from CR
if cr.Spec.ExtraConfig["dex.config"] != "" {
Expand Down
136 changes: 135 additions & 1 deletion controllers/argocd/dex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
argoproj "github.com/argoproj-labs/argocd-operator/api/v1beta1"
"github.com/argoproj-labs/argocd-operator/common"
"github.com/argoproj-labs/argocd-operator/controllers/argoutil"
tlsProfile "github.com/argoproj-labs/argocd-operator/pkg/tlsprofile"
)

func TestReconcileArgoCD_reconcileDexDeployment_with_dex_disabled(t *testing.T) {
Expand Down Expand Up @@ -592,7 +593,7 @@ func TestReconcileArgoCD_reconcileDexDeployment_withUpdate(t *testing.T) {
Containers: []corev1.Container{
{
Name: "dex",
Image: "ghcr.io/dexidp/dex@sha256:8499afd690c437f52301efd2b05b2455da5bd2dfc20332cd697dc9937f808462", // (v2.45.1) NOTE: this value is modified by dependency update script
Image: "ghcr.io/dexidp/dex@sha256:f5d77499df7ea3ff0bdc5f9e218e4be8fac3b91a1b29b64a7158a5876850fb20", // (v2.45.1) NOTE: this value is modified by dependency update script
Command: []string{
"/shared/argocd-dex",
"rundex",
Expand Down Expand Up @@ -1617,3 +1618,136 @@ func TestReconcileArgoCD_reconcileDexDeployment_customLabelsAndAnnotations(t *te
assert.False(t, hasCustomAnnotation)
assert.False(t, hasCustomLabel)
}

func TestGetDexConfig(t *testing.T) {
cr := &argoproj.ArgoCD{
Spec: argoproj.ArgoCDSpec{
ExtraConfig: map[string]string{},
},
}
tests := []struct {
name string
centralTLSConfig tlsProfile.TLSConfigProfile
expectedContains []string
expectedNotContain []string
}{
{
name: "TLS profile disabled",
centralTLSConfig: tlsProfile.TLSConfigProfile{
DisableClusterTLSProfile: true,
MinVersion: configv1.TLSProtocolVersion("VersionTLS13"),
Ciphers: []string{
"TLS_AES_128_GCM_SHA256",
},
CurvePreferences: []string{
"X25519MLKEM768",
},
},
expectedNotContain: []string{
"web:",
"tlsMinVersion:",
"tlsCiphers:",
"tlsCurvePreferences:",
},
},
{
name: "TLS minimum version",
centralTLSConfig: tlsProfile.TLSConfigProfile{
MinVersion: configv1.TLSProtocolVersion("VersionTLS12"),
},
expectedContains: []string{
"web:",
`tlsMinVersion: "1.2"`,
},
expectedNotContain: []string{
"tlsCiphers:",
"tlsCurvePreferences:",
},
},
{
name: "TLS cipher suites",
centralTLSConfig: tlsProfile.TLSConfigProfile{
Ciphers: []string{
"TLS_AES_128_GCM_SHA256",
"TLS_AES_256_GCM_SHA384",
},
},
expectedContains: []string{
"web:",
"tlsCiphers:",
`- "TLS_AES_128_GCM_SHA256"`,
`- "TLS_AES_256_GCM_SHA384"`,
},
expectedNotContain: []string{
"tlsMinVersion:",
"tlsCurvePreferences:",
},
},
{
name: "TLS curve preferences",
centralTLSConfig: tlsProfile.TLSConfigProfile{
CurvePreferences: []string{
"X25519MLKEM768",
"X25519",
},
},
expectedContains: []string{
"web:",
"tlsCurvePreferences:",
`- "X25519MLKEM768"`,
`- "X25519"`,
},
expectedNotContain: []string{
"tlsMinVersion:",
"tlsCiphers:",
},
},
{
name: "all TLS settings",
centralTLSConfig: tlsProfile.TLSConfigProfile{
MinVersion: configv1.TLSProtocolVersion("VersionTLS13"),
Ciphers: []string{
"TLS_AES_128_GCM_SHA256",
"TLS_AES_256_GCM_SHA384",
},
CurvePreferences: []string{
"X25519MLKEM768",
"X25519",
},
},
expectedContains: []string{
"web:",
`tlsMinVersion: "1.3"`,
"tlsCiphers:",
`- "TLS_AES_128_GCM_SHA256"`,
`- "TLS_AES_256_GCM_SHA384"`,
"tlsCurvePreferences:",
`- "X25519MLKEM768"`,
`- "X25519"`,
},
},
{
name: "empty TLS configuration",
centralTLSConfig: tlsProfile.TLSConfigProfile{},
expectedNotContain: []string{
"tlsMinVersion:",
"tlsCiphers:",
"tlsCurvePreferences:",
},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
config := getDexConfig(cr, tt.centralTLSConfig)

for _, expected := range tt.expectedContains {
assert.Contains(t, config, expected)
}

for _, notExpected := range tt.expectedNotContain {
assert.NotContains(t, config, notExpected)
}
})
}
}
4 changes: 4 additions & 0 deletions controllers/argocd/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/go-logr/logr"

"github.com/argoproj-labs/argocd-operator/common"
tlsProfile "github.com/argoproj-labs/argocd-operator/pkg/tlsprofile"

"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -67,6 +68,9 @@ func makeTestReconciler(client client.Client, sch *runtime.Scheme, k8sClient kub
LocalUsers: &LocalUsersInfo{
tokenRenewalTimers: map[string]*tokenRenewalTimer{},
},
CentralTLSConfigProfile: tlsProfile.TLSConfigProfile{
DisableClusterTLSProfile: true,
},
}
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/tlsprofile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ type TLSConfigProfile struct {
MinVersion configv1.TLSProtocolVersion
// Ciphers specifies the list of supported TLS cipher suites in cluster.
Ciphers []string
// CurvePreferences specifies the list of supported TLS curve preferences in cluster.
CurvePreferences []string
}
Loading