| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- {
- "identities": [
- {
- "name": "testuser",
- "credentials": [
- {
- "accessKey": "test-access-key",
- "secretKey": "test-secret-key"
- }
- ],
- "actions": ["Admin"]
- },
- {
- "name": "readonlyuser",
- "credentials": [
- {
- "accessKey": "readonly-access-key",
- "secretKey": "readonly-secret-key"
- }
- ],
- "actions": ["Read"]
- },
- {
- "name": "writeonlyuser",
- "credentials": [
- {
- "accessKey": "writeonly-access-key",
- "secretKey": "writeonly-secret-key"
- }
- ],
- "actions": ["Write"]
- }
- ],
- "iam": {
- "enabled": true,
- "sts": {
- "tokenDuration": "15m",
- "issuer": "seaweedfs-sts",
- "signingKey": "test-sts-signing-key-for-integration-tests"
- },
- "policy": {
- "defaultEffect": "Deny"
- },
- "providers": {
- "oidc": {
- "test-oidc": {
- "issuer": "http://localhost:8080/.well-known/openid_configuration",
- "clientId": "test-client-id",
- "jwksUri": "http://localhost:8080/jwks",
- "userInfoUri": "http://localhost:8080/userinfo",
- "roleMapping": {
- "rules": [
- {
- "claim": "groups",
- "claimValue": "admins",
- "roleName": "S3AdminRole"
- },
- {
- "claim": "groups",
- "claimValue": "users",
- "roleName": "S3ReadOnlyRole"
- },
- {
- "claim": "groups",
- "claimValue": "writers",
- "roleName": "S3WriteOnlyRole"
- }
- ]
- },
- "claimsMapping": {
- "email": "email",
- "displayName": "name",
- "groups": "groups"
- }
- }
- },
- "ldap": {
- "test-ldap": {
- "server": "ldap://localhost:389",
- "baseDN": "dc=example,dc=com",
- "bindDN": "cn=admin,dc=example,dc=com",
- "bindPassword": "admin-password",
- "userFilter": "(uid=%s)",
- "groupFilter": "(memberUid=%s)",
- "attributes": {
- "email": "mail",
- "displayName": "cn",
- "groups": "memberOf"
- },
- "roleMapping": {
- "rules": [
- {
- "claim": "groups",
- "claimValue": "cn=admins,ou=groups,dc=example,dc=com",
- "roleName": "S3AdminRole"
- },
- {
- "claim": "groups",
- "claimValue": "cn=users,ou=groups,dc=example,dc=com",
- "roleName": "S3ReadOnlyRole"
- }
- ]
- }
- }
- }
- },
- "policyStore": {}
- },
- "roles": {
- "S3AdminRole": {
- "trustPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Federated": ["test-oidc", "test-ldap"]
- },
- "Action": "sts:AssumeRoleWithWebIdentity"
- }
- ]
- },
- "attachedPolicies": ["S3AdminPolicy"],
- "description": "Full administrative access to S3 resources"
- },
- "S3ReadOnlyRole": {
- "trustPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Federated": ["test-oidc", "test-ldap"]
- },
- "Action": "sts:AssumeRoleWithWebIdentity"
- }
- ]
- },
- "attachedPolicies": ["S3ReadOnlyPolicy"],
- "description": "Read-only access to S3 resources"
- },
- "S3WriteOnlyRole": {
- "trustPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Federated": ["test-oidc", "test-ldap"]
- },
- "Action": "sts:AssumeRoleWithWebIdentity"
- }
- ]
- },
- "attachedPolicies": ["S3WriteOnlyPolicy"],
- "description": "Write-only access to S3 resources"
- }
- },
- "policies": {
- "S3AdminPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": ["s3:*"],
- "Resource": [
- "arn:seaweed:s3:::*",
- "arn:seaweed:s3:::*/*"
- ]
- }
- ]
- },
- "S3ReadOnlyPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "s3:GetObject",
- "s3:GetObjectVersion",
- "s3:ListBucket",
- "s3:ListBucketVersions",
- "s3:GetBucketLocation",
- "s3:GetBucketVersioning"
- ],
- "Resource": [
- "arn:seaweed:s3:::*",
- "arn:seaweed:s3:::*/*"
- ]
- }
- ]
- },
- "S3WriteOnlyPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "s3:PutObject",
- "s3:PutObjectAcl",
- "s3:DeleteObject",
- "s3:DeleteObjectVersion",
- "s3:InitiateMultipartUpload",
- "s3:UploadPart",
- "s3:CompleteMultipartUpload",
- "s3:AbortMultipartUpload",
- "s3:ListMultipartUploadParts"
- ],
- "Resource": [
- "arn:seaweed:s3:::*/*"
- ]
- }
- ]
- },
- "S3BucketManagementPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": [
- "s3:CreateBucket",
- "s3:DeleteBucket",
- "s3:GetBucketPolicy",
- "s3:PutBucketPolicy",
- "s3:DeleteBucketPolicy",
- "s3:GetBucketVersioning",
- "s3:PutBucketVersioning"
- ],
- "Resource": [
- "arn:seaweed:s3:::*"
- ]
- }
- ]
- },
- "S3IPRestrictedPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": ["s3:*"],
- "Resource": [
- "arn:seaweed:s3:::*",
- "arn:seaweed:s3:::*/*"
- ],
- "Condition": {
- "IpAddress": {
- "aws:SourceIp": ["192.168.1.0/24", "10.0.0.0/8"]
- }
- }
- }
- ]
- },
- "S3TimeBasedPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Action": ["s3:GetObject", "s3:ListBucket"],
- "Resource": [
- "arn:seaweed:s3:::*",
- "arn:seaweed:s3:::*/*"
- ],
- "Condition": {
- "DateGreaterThan": {
- "aws:CurrentTime": "2023-01-01T00:00:00Z"
- },
- "DateLessThan": {
- "aws:CurrentTime": "2025-12-31T23:59:59Z"
- }
- }
- }
- ]
- }
- },
- "bucketPolicyExamples": {
- "PublicReadPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "PublicReadGetObject",
- "Effect": "Allow",
- "Principal": "*",
- "Action": "s3:GetObject",
- "Resource": "arn:seaweed:s3:::example-bucket/*"
- }
- ]
- },
- "DenyDeletePolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "DenyDeleteOperations",
- "Effect": "Deny",
- "Principal": "*",
- "Action": ["s3:DeleteObject", "s3:DeleteBucket"],
- "Resource": [
- "arn:seaweed:s3:::example-bucket",
- "arn:seaweed:s3:::example-bucket/*"
- ]
- }
- ]
- },
- "IPRestrictedAccessPolicy": {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "IPRestrictedAccess",
- "Effect": "Allow",
- "Principal": "*",
- "Action": ["s3:GetObject", "s3:PutObject"],
- "Resource": "arn:seaweed:s3:::example-bucket/*",
- "Condition": {
- "IpAddress": {
- "aws:SourceIp": ["203.0.113.0/24"]
- }
- }
- }
- ]
- }
- }
- }
|