Increase STS Session duration to 12 hours (#2434)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2022-11-07 12:38:29 -08:00
committed by GitHub
parent cac8445aa1
commit ae2587dcad
2 changed files with 6 additions and 15 deletions

View File

@@ -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
}

View File

@@ -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"
)