mirror of
https://github.com/pgsty/minio.git
synced 2026-11-12 02:25:34 +03:00
Prepare SILO 20261112 release candidate
Harden IAM/bucket/import/replication policy validation, enforce tag and version authorization across read/copy/list/archive endpoints, bind SigV4 credential-scope dates and streaming trailer limits, validate HTTP SSE-KMS contexts as strict UTF-8 JSON, add release-commit and coordinated dependency gates, and pin silo-pkg v3.16.1, Console v2.7.1, mcli 20261112, Go 1.27.4, and Helm chart 7.0.5. Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
+40
-9
@@ -1087,17 +1087,26 @@ func (sys *IAMSys) notifyForServiceAccount(ctx context.Context, accessKey string
|
||||
}
|
||||
|
||||
type newServiceAccountOpts struct {
|
||||
sessionPolicy *policy.Policy
|
||||
accessKey string
|
||||
secretKey string
|
||||
status string // Used by replication snapshots; local creates default to enabled.
|
||||
name, description string
|
||||
expiration *time.Time
|
||||
allowSiteReplicatorAccount bool // allow creating internal service account for site-replication.
|
||||
sessionPolicy *policy.Policy
|
||||
accessKey string
|
||||
secretKey string
|
||||
status string // Used by replication snapshots; local creates default to enabled.
|
||||
name, description string
|
||||
expiration *time.Time
|
||||
allowSiteReplicatorAccount bool // allow creating internal service account for site-replication.
|
||||
preserveEmptyEmbeddedPolicy bool // preserve historical deny-all empty embedded policies on snapshot import/replication.
|
||||
|
||||
claims map[string]any
|
||||
}
|
||||
|
||||
func svcAcctClaimsHaveEmbeddedPolicy(claims map[string]any) bool {
|
||||
if claims == nil {
|
||||
return false
|
||||
}
|
||||
pt, _ := claims[iamPolicyClaimNameSA()].(string)
|
||||
return pt == embeddedPolicyType
|
||||
}
|
||||
|
||||
// marshalServiceAccountPolicy validates a supplied policy and normalizes its
|
||||
// version without changing the caller's policy. An empty policy means inheritance.
|
||||
func marshalServiceAccountPolicy(sp *policy.Policy) ([]byte, error) {
|
||||
@@ -1157,10 +1166,32 @@ func (sys *IAMSys) NewServiceAccount(ctx context.Context, parentUser string, gro
|
||||
m := make(map[string]any)
|
||||
m[parentClaim] = parentUser
|
||||
|
||||
if len(policyBuf) > 0 {
|
||||
switch {
|
||||
case len(policyBuf) > 0:
|
||||
m[policy.SessionPolicyName] = base64.StdEncoding.EncodeToString(policyBuf)
|
||||
m[iamPolicyClaimNameSA()] = embeddedPolicyType
|
||||
} else {
|
||||
case opts.preserveEmptyEmbeddedPolicy:
|
||||
switch {
|
||||
case opts.sessionPolicy != nil:
|
||||
p := *opts.sessionPolicy
|
||||
if p.Version == "" {
|
||||
p.Version = policy.DefaultVersion
|
||||
}
|
||||
buf, merr := json.Marshal(p)
|
||||
if merr != nil {
|
||||
return auth.Credentials{}, time.Time{}, merr
|
||||
}
|
||||
m[policy.SessionPolicyName] = base64.StdEncoding.EncodeToString(buf)
|
||||
m[iamPolicyClaimNameSA()] = embeddedPolicyType
|
||||
default:
|
||||
if raw, ok := opts.claims[policy.SessionPolicyName].(string); ok && raw != "" {
|
||||
m[policy.SessionPolicyName] = raw
|
||||
m[iamPolicyClaimNameSA()] = embeddedPolicyType
|
||||
} else {
|
||||
m[iamPolicyClaimNameSA()] = inheritedPolicyType
|
||||
}
|
||||
}
|
||||
default:
|
||||
m[iamPolicyClaimNameSA()] = inheritedPolicyType
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user