mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 08:13:28 +03:00
automatically generate root credentials with KMS (#19025)
With this commit, MinIO generates root credentials automatically and deterministically if: - No root credentials have been set. - A KMS (KES) is configured. - API access for the root credentials is disabled (lockdown mode). Before, MinIO defaults to `minioadmin` for both the access and secret keys. Now, MinIO generates unique root credentials automatically on startup using the KMS. Therefore, it uses the KMS HMAC function to generate pseudo-random values. These values never change as long as the KMS key remains the same, and the KMS key must continue to exist since all IAM data is encrypted with it. Backward compatibility: This commit should not cause existing deployments to break. It only changes the root credentials of deployments that have a KMS configured (KES, not a static key) but have not set any admin credentials. Such implementations should be rare or not exist at all. Even if the worst case would be updating root credentials in mc or other clients used to administer the cluster. Root credentials are anyway not intended for regular S3 operations. Signed-off-by: Andreas Auernhammer <github@aead.dev>
This commit is contained in:
committed by
GitHub
parent
8f03c6e0db
commit
09626d78ff
@@ -20,7 +20,7 @@ package kms
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/minio/kes-go"
|
||||
"github.com/minio/kms-go/kes"
|
||||
)
|
||||
|
||||
// PolicyManager is the generic interface that handles KMS policy] operations
|
||||
@@ -29,20 +29,9 @@ type PolicyManager interface {
|
||||
// e.g. who created the policy at which point in time.
|
||||
DescribePolicy(ctx context.Context, policy string) (*kes.PolicyInfo, error)
|
||||
|
||||
// AssignPolicy assigns a policy to an identity.
|
||||
// An identity can have at most one policy while the same policy can be assigned to multiple identities.
|
||||
// The assigned policy defines which API calls this identity can perform.
|
||||
// It's not possible to assign a policy to the admin identity.
|
||||
// Further, an identity cannot assign a policy to itself.
|
||||
AssignPolicy(ctx context.Context, policy, identity string) error
|
||||
|
||||
// GetPolicy gets a policy from KMS.
|
||||
GetPolicy(ctx context.Context, policy string) (*kes.Policy, error)
|
||||
|
||||
// ListPolicies lists all policies.
|
||||
ListPolicies(ctx context.Context) (*kes.ListIter[string], error)
|
||||
|
||||
// DeletePolicy deletes a policy from KMS.
|
||||
// All identities that have been assigned to this policy will lose all authorization privileges.
|
||||
DeletePolicy(ctx context.Context, policy string) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user