Add canned `diagnostics` policy for admin users (#8937)

master
poornas 5 years ago committed by GitHub
parent e9c111c8d0
commit 301c50b721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/iam.go
  2. 13
      pkg/iam/policy/constants.go

@ -1392,6 +1392,10 @@ func setDefaultCannedPolicies(policies map[string]iampolicy.Policy) {
if !ok {
policies["readwrite"] = iampolicy.ReadWrite
}
_, ok = policies["diagnostics"]
if !ok {
policies["diagnostics"] = iampolicy.AdminDiagnostics
}
}
// buildUserGroupMemberships - builds the memberships map. IMPORTANT:

@ -64,3 +64,16 @@ var WriteOnly = Policy{
},
},
}
// AdminDiagnostics - provides admin diagnostics access.
var AdminDiagnostics = Policy{
Version: DefaultVersion,
Statements: []Statement{
{
SID: policy.ID(""),
Effect: policy.Allow,
Actions: NewActionSet(PerfInfoAdminAction, ProfilingAdminAction, TraceAdminAction, ConsoleLogAdminAction, ServerInfoAdminAction, ServerHardwareInfoAdminAction),
Resources: NewResourceSet(NewResource("*", "")),
},
},
}

Loading…
Cancel
Save