iam_config_distributed.json 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {
  2. "sts": {
  3. "tokenDuration": "1h",
  4. "maxSessionLength": "12h",
  5. "issuer": "seaweedfs-sts",
  6. "signingKey": "dGVzdC1zaWduaW5nLWtleS0zMi1jaGFyYWN0ZXJzLWxvbmc=",
  7. "providers": [
  8. {
  9. "name": "keycloak-oidc",
  10. "type": "oidc",
  11. "enabled": true,
  12. "config": {
  13. "issuer": "http://keycloak:8080/realms/seaweedfs-test",
  14. "clientId": "seaweedfs-s3",
  15. "clientSecret": "seaweedfs-s3-secret",
  16. "jwksUri": "http://keycloak:8080/realms/seaweedfs-test/protocol/openid-connect/certs",
  17. "scopes": ["openid", "profile", "email", "roles"],
  18. "claimsMapping": {
  19. "usernameClaim": "preferred_username",
  20. "groupsClaim": "roles"
  21. }
  22. }
  23. },
  24. {
  25. "name": "mock-provider",
  26. "type": "mock",
  27. "enabled": false,
  28. "config": {
  29. "issuer": "http://localhost:9999",
  30. "jwksEndpoint": "http://localhost:9999/jwks"
  31. }
  32. }
  33. ]
  34. },
  35. "policy": {
  36. "defaultEffect": "Deny"
  37. },
  38. "roleStore": {},
  39. "roles": [
  40. {
  41. "roleName": "S3AdminRole",
  42. "roleArn": "arn:seaweed:iam::role/S3AdminRole",
  43. "trustPolicy": {
  44. "Version": "2012-10-17",
  45. "Statement": [
  46. {
  47. "Effect": "Allow",
  48. "Principal": {
  49. "Federated": "keycloak-oidc"
  50. },
  51. "Action": ["sts:AssumeRoleWithWebIdentity"],
  52. "Condition": {
  53. "StringEquals": {
  54. "roles": "s3-admin"
  55. }
  56. }
  57. }
  58. ]
  59. },
  60. "attachedPolicies": ["S3AdminPolicy"],
  61. "description": "Full S3 administrator access role"
  62. },
  63. {
  64. "roleName": "S3ReadOnlyRole",
  65. "roleArn": "arn:seaweed:iam::role/S3ReadOnlyRole",
  66. "trustPolicy": {
  67. "Version": "2012-10-17",
  68. "Statement": [
  69. {
  70. "Effect": "Allow",
  71. "Principal": {
  72. "Federated": "keycloak-oidc"
  73. },
  74. "Action": ["sts:AssumeRoleWithWebIdentity"],
  75. "Condition": {
  76. "StringEquals": {
  77. "roles": "s3-read-only"
  78. }
  79. }
  80. }
  81. ]
  82. },
  83. "attachedPolicies": ["S3ReadOnlyPolicy"],
  84. "description": "Read-only access to S3 resources"
  85. },
  86. {
  87. "roleName": "S3ReadWriteRole",
  88. "roleArn": "arn:seaweed:iam::role/S3ReadWriteRole",
  89. "trustPolicy": {
  90. "Version": "2012-10-17",
  91. "Statement": [
  92. {
  93. "Effect": "Allow",
  94. "Principal": {
  95. "Federated": "keycloak-oidc"
  96. },
  97. "Action": ["sts:AssumeRoleWithWebIdentity"],
  98. "Condition": {
  99. "StringEquals": {
  100. "roles": "s3-read-write"
  101. }
  102. }
  103. }
  104. ]
  105. },
  106. "attachedPolicies": ["S3ReadWritePolicy"],
  107. "description": "Read-write access to S3 resources"
  108. }
  109. ],
  110. "policies": [
  111. {
  112. "name": "S3AdminPolicy",
  113. "document": {
  114. "Version": "2012-10-17",
  115. "Statement": [
  116. {
  117. "Effect": "Allow",
  118. "Action": "s3:*",
  119. "Resource": "*"
  120. }
  121. ]
  122. }
  123. },
  124. {
  125. "name": "S3ReadOnlyPolicy",
  126. "document": {
  127. "Version": "2012-10-17",
  128. "Statement": [
  129. {
  130. "Effect": "Allow",
  131. "Action": [
  132. "s3:GetObject",
  133. "s3:GetObjectAcl",
  134. "s3:GetObjectVersion",
  135. "s3:ListBucket",
  136. "s3:ListBucketVersions"
  137. ],
  138. "Resource": [
  139. "arn:seaweed:s3:::*",
  140. "arn:seaweed:s3:::*/*"
  141. ]
  142. }
  143. ]
  144. }
  145. },
  146. {
  147. "name": "S3ReadWritePolicy",
  148. "document": {
  149. "Version": "2012-10-17",
  150. "Statement": [
  151. {
  152. "Effect": "Allow",
  153. "Action": [
  154. "s3:GetObject",
  155. "s3:GetObjectAcl",
  156. "s3:GetObjectVersion",
  157. "s3:PutObject",
  158. "s3:PutObjectAcl",
  159. "s3:DeleteObject",
  160. "s3:ListBucket",
  161. "s3:ListBucketVersions"
  162. ],
  163. "Resource": [
  164. "arn:seaweed:s3:::*",
  165. "arn:seaweed:s3:::*/*"
  166. ]
  167. }
  168. ]
  169. }
  170. }
  171. ]
  172. }