From 9404925b8ff362c83537ae9f93d610d9f8aab955 Mon Sep 17 00:00:00 2001 From: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Date: Mon, 7 Nov 2022 10:38:05 -0800 Subject: [PATCH] Increase STS Session duration to 12 hours Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> --- pkg/auth/token/config.go | 14 +++----------- pkg/auth/token/const.go | 7 +++---- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/pkg/auth/token/config.go b/pkg/auth/token/config.go index d482c5f4d3..9ee918881d 100644 --- a/pkg/auth/token/config.go +++ b/pkg/auth/token/config.go @@ -23,19 +23,11 @@ import ( "github.com/minio/pkg/env" ) -// GetConsoleSTSDuration returns the default session duration for the STS requested tokens (defaults to 1h) +// GetConsoleSTSDuration returns the default session duration for the STS requested tokens (defaults to 12h) func GetConsoleSTSDuration() time.Duration { - durationSeconds := env.Get(ConsoleSTSDurationSeconds, "") - if durationSeconds != "" { - duration, err := time.ParseDuration(durationSeconds + "s") - if err != nil { - duration = 1 * time.Hour - } - return duration - } - duration, err := time.ParseDuration(env.Get(ConsoleSTSDuration, "1h")) + duration, err := time.ParseDuration(env.Get(ConsoleSTSDuration, "12h")) if err != nil { - duration = 1 * time.Hour + duration = 12 * time.Hour } return duration } diff --git a/pkg/auth/token/const.go b/pkg/auth/token/const.go index 17182269b8..ad37505658 100644 --- a/pkg/auth/token/const.go +++ b/pkg/auth/token/const.go @@ -17,8 +17,7 @@ package token const ( - ConsoleSTSDurationSeconds = "CONSOLE_STS_DURATION_SECONDS" // (deprecated), set value in seconds for sts session, ie: 3600 - ConsoleSTSDuration = "CONSOLE_STS_DURATION" // time.Duration format, ie: 3600s, 2h45m, 1h, etc - ConsolePBKDFPassphrase = "CONSOLE_PBKDF_PASSPHRASE" - ConsolePBKDFSalt = "CONSOLE_PBKDF_SALT" + ConsoleSTSDuration = "CONSOLE_STS_DURATION" // time.Duration format, ie: 3600s, 2h45m, 1h, etc + ConsolePBKDFPassphrase = "CONSOLE_PBKDF_PASSPHRASE" + ConsolePBKDFSalt = "CONSOLE_PBKDF_SALT" )