Skip to content
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

Decrease the validity of JWTs issued by Dex to 15m #3175

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion pkg/render/dex.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,13 @@ func (c *dexComponent) configMap() *corev1.ConfigMap {
"secretEnv": dexSecretEnv,
},
},
"expiry": map[string]string{
// Default duration is 24h. This is too high for most organizations. Setting it to 15m.
"idTokens": "15m",
},
})
if err != nil {
// Panic since this this would be a developer error, as the marshaled struct is one created by our code.
// Panic since this would be a developer error, as the marshaled struct is one created by our code.
panic(err)
}
return &corev1.ConfigMap{
Expand Down
3 changes: 3 additions & 0 deletions pkg/render/dex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ var _ = Describe("dex rendering tests", func() {
}
Expect(d.Spec.Template.Spec.Containers[0].VolumeMounts).To(BeEquivalentTo(expectedVolumeMounts))
Expect(d.Spec.Template.Spec.Volumes).To(BeEquivalentTo(expectedVolumes))
cm, ok := rtest.GetResource(resources, "tigera-dex", "tigera-dex", "", "v1", "ConfigMap").(*corev1.ConfigMap)
Expect(ok).To(BeTrue())
Expect(cm.Data["config.yaml"]).To(ContainSubstring("idTokens: 15m"))
})

DescribeTable("should render the cluster name properly in the validator", func(clusterDomain string) {
Expand Down
Loading