iam_config_docker.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. }
  19. }
  20. ]
  21. },
  22. "policy": {
  23. "defaultEffect": "Deny"
  24. },
  25. "roles": [
  26. {
  27. "roleName": "S3AdminRole",
  28. "roleArn": "arn:seaweed:iam::role/S3AdminRole",
  29. "trustPolicy": {
  30. "Version": "2012-10-17",
  31. "Statement": [
  32. {
  33. "Effect": "Allow",
  34. "Principal": {
  35. "Federated": "keycloak-oidc"
  36. },
  37. "Action": ["sts:AssumeRoleWithWebIdentity"],
  38. "Condition": {
  39. "StringEquals": {
  40. "roles": "s3-admin"
  41. }
  42. }
  43. }
  44. ]
  45. },
  46. "attachedPolicies": ["S3AdminPolicy"],
  47. "description": "Full S3 administrator access role"
  48. },
  49. {
  50. "roleName": "S3ReadOnlyRole",
  51. "roleArn": "arn:seaweed:iam::role/S3ReadOnlyRole",
  52. "trustPolicy": {
  53. "Version": "2012-10-17",
  54. "Statement": [
  55. {
  56. "Effect": "Allow",
  57. "Principal": {
  58. "Federated": "keycloak-oidc"
  59. },
  60. "Action": ["sts:AssumeRoleWithWebIdentity"],
  61. "Condition": {
  62. "StringEquals": {
  63. "roles": "s3-read-only"
  64. }
  65. }
  66. }
  67. ]
  68. },
  69. "attachedPolicies": ["S3ReadOnlyPolicy"],
  70. "description": "Read-only access to S3 resources"
  71. },
  72. {
  73. "roleName": "S3ReadWriteRole",
  74. "roleArn": "arn:seaweed:iam::role/S3ReadWriteRole",
  75. "trustPolicy": {
  76. "Version": "2012-10-17",
  77. "Statement": [
  78. {
  79. "Effect": "Allow",
  80. "Principal": {
  81. "Federated": "keycloak-oidc"
  82. },
  83. "Action": ["sts:AssumeRoleWithWebIdentity"],
  84. "Condition": {
  85. "StringEquals": {
  86. "roles": "s3-read-write"
  87. }
  88. }
  89. }
  90. ]
  91. },
  92. "attachedPolicies": ["S3ReadWritePolicy"],
  93. "description": "Read-write access to S3 resources"
  94. }
  95. ],
  96. "policies": [
  97. {
  98. "name": "S3AdminPolicy",
  99. "document": {
  100. "Version": "2012-10-17",
  101. "Statement": [
  102. {
  103. "Effect": "Allow",
  104. "Action": "s3:*",
  105. "Resource": "*"
  106. }
  107. ]
  108. }
  109. },
  110. {
  111. "name": "S3ReadOnlyPolicy",
  112. "document": {
  113. "Version": "2012-10-17",
  114. "Statement": [
  115. {
  116. "Effect": "Allow",
  117. "Action": [
  118. "s3:GetObject",
  119. "s3:GetObjectAcl",
  120. "s3:GetObjectVersion",
  121. "s3:ListBucket",
  122. "s3:ListBucketVersions"
  123. ],
  124. "Resource": [
  125. "arn:seaweed:s3:::*",
  126. "arn:seaweed:s3:::*/*"
  127. ]
  128. }
  129. ]
  130. }
  131. },
  132. {
  133. "name": "S3ReadWritePolicy",
  134. "document": {
  135. "Version": "2012-10-17",
  136. "Statement": [
  137. {
  138. "Effect": "Allow",
  139. "Action": [
  140. "s3:GetObject",
  141. "s3:GetObjectAcl",
  142. "s3:GetObjectVersion",
  143. "s3:PutObject",
  144. "s3:PutObjectAcl",
  145. "s3:DeleteObject",
  146. "s3:ListBucket",
  147. "s3:ListBucketVersions"
  148. ],
  149. "Resource": [
  150. "arn:seaweed:s3:::*",
  151. "arn:seaweed:s3:::*/*"
  152. ]
  153. }
  154. ]
  155. }
  156. }
  157. ]
  158. }