EventManager: disable commands by default

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-11-10 11:52:31 +01:00
parent 3dd412f6e3
commit b524da11e9
4 changed files with 47 additions and 17 deletions

View File

@@ -59,7 +59,7 @@ var (
ActionTypeDataRetentionCheck, ActionTypePasswordExpirationCheck, ActionTypeUserExpirationCheck,
ActionTypeUserInactivityCheck, ActionTypeIDPAccountCheck, ActionTypeRotateLogs}
// EnabledActionCommands defines the system commands that can be executed via EventManager,
// an empty list means that any command is allowed to be executed.
// an empty list means that no command is allowed to be executed.
EnabledActionCommands []string
)
@@ -455,9 +455,6 @@ func (c *EventActionHTTPConfig) GetHTTPClient() *http.Client {
// IsActionCommandAllowed returns true if the specified command is allowed
func IsActionCommandAllowed(cmd string) bool {
if len(EnabledActionCommands) == 0 {
return true
}
return slices.Contains(EnabledActionCommands, cmd)
}