|
1 | 1 | {
|
2 | 2 | "version": "1.0",
|
3 | 3 | "examples": {
|
| 4 | + "CheckAccessNotGranted": [ |
| 5 | + { |
| 6 | + "input": { |
| 7 | + "access": [ |
| 8 | + { |
| 9 | + "actions": [ |
| 10 | + "s3:PutObject" |
| 11 | + ] |
| 12 | + } |
| 13 | + ], |
| 14 | + "policyDocument": "{\"Version\":\"2012-10-17\",\"Id\":\"123\",\"Statement\":[{\"Sid\":\"AllowJohnDoe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/JohnDoe\"},\"Action\":\"s3:GetObject\",\"Resource\":\"*\"}]}", |
| 15 | + "policyType": "RESOURCE_POLICY" |
| 16 | + }, |
| 17 | + "output": { |
| 18 | + "message": "The policy document does not grant access to perform the listed actions or resources.", |
| 19 | + "result": "PASS" |
| 20 | + }, |
| 21 | + "id": "example-1", |
| 22 | + "title": "Passing check. Restrictive identity policy." |
| 23 | + }, |
| 24 | + { |
| 25 | + "input": { |
| 26 | + "access": [ |
| 27 | + { |
| 28 | + "resources": [ |
| 29 | + "arn:aws:s3:::sensitive-bucket/*" |
| 30 | + ] |
| 31 | + } |
| 32 | + ], |
| 33 | + "policyDocument": "{\"Version\":\"2012-10-17\",\"Id\":\"123\",\"Statement\":[{\"Sid\":\"AllowJohnDoe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/JohnDoe\"},\"Action\":\"s3:PutObject\",\"Resource\":\"arn:aws:s3:::non-sensitive-bucket/*\"}]}", |
| 34 | + "policyType": "RESOURCE_POLICY" |
| 35 | + }, |
| 36 | + "output": { |
| 37 | + "message": "The policy document does not grant access to perform the listed actions or resources.", |
| 38 | + "result": "PASS" |
| 39 | + }, |
| 40 | + "id": "example-2", |
| 41 | + "title": "Passing check. Restrictive S3 Bucket resource policy." |
| 42 | + }, |
| 43 | + { |
| 44 | + "input": { |
| 45 | + "access": [ |
| 46 | + { |
| 47 | + "resources": [ |
| 48 | + "arn:aws:s3:::my-bucket/*" |
| 49 | + ] |
| 50 | + } |
| 51 | + ], |
| 52 | + "policyDocument": "{\"Version\":\"2012-10-17\",\"Id\":\"123\",\"Statement\":[{\"Sid\":\"AllowJohnDoe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/JohnDoe\"},\"Action\":\"s3:PutObject\",\"Resource\":\"arn:aws:s3:::my-bucket/*\"}]}", |
| 53 | + "policyType": "RESOURCE_POLICY" |
| 54 | + }, |
| 55 | + "output": { |
| 56 | + "message": "The policy document grants access to perform one or more of the listed actions or resources.", |
| 57 | + "reasons": [ |
| 58 | + { |
| 59 | + "description": "One or more of the listed actions or resources in the statement with sid: AllowJohnDoe.", |
| 60 | + "statementId": "AllowJohnDoe", |
| 61 | + "statementIndex": 0 |
| 62 | + } |
| 63 | + ], |
| 64 | + "result": "FAIL" |
| 65 | + }, |
| 66 | + "id": "example-3", |
| 67 | + "title": "Failing check. Permissive S3 Bucket resource policy." |
| 68 | + } |
| 69 | + ], |
| 70 | + "CheckNoPublicAccess": [ |
| 71 | + { |
| 72 | + "input": { |
| 73 | + "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Bob\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::111122223333:user/JohnDoe\"},\"Action\":[\"s3:GetObject\"]}]}", |
| 74 | + "resourceType": "AWS::S3::Bucket" |
| 75 | + }, |
| 76 | + "output": { |
| 77 | + "message": "The resource policy does not grant public access for the given resource type.", |
| 78 | + "result": "PASS" |
| 79 | + }, |
| 80 | + "id": "example-1", |
| 81 | + "title": "Passing check. S3 Bucket policy without public access." |
| 82 | + }, |
| 83 | + { |
| 84 | + "input": { |
| 85 | + "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Bob\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:GetObject\"]}]}", |
| 86 | + "resourceType": "AWS::S3::Bucket" |
| 87 | + }, |
| 88 | + "output": { |
| 89 | + "message": "The resource policy grants public access for the given resource type.", |
| 90 | + "reasons": [ |
| 91 | + { |
| 92 | + "description": "Public access granted in the following statement with sid: Bob.", |
| 93 | + "statementId": "Bob", |
| 94 | + "statementIndex": 0 |
| 95 | + } |
| 96 | + ], |
| 97 | + "result": "FAIL" |
| 98 | + }, |
| 99 | + "id": "example-2", |
| 100 | + "title": "Failing check. S3 Bucket policy with public access." |
| 101 | + } |
| 102 | + ], |
| 103 | + "GenerateFindingRecommendation": [ |
| 104 | + { |
| 105 | + "input": { |
| 106 | + "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a", |
| 107 | + "id": "finding-id" |
| 108 | + }, |
| 109 | + "output": { |
| 110 | + }, |
| 111 | + "id": "example-1", |
| 112 | + "title": "Successfully started generating finding recommendation" |
| 113 | + }, |
| 114 | + { |
| 115 | + "input": { |
| 116 | + "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a", |
| 117 | + "id": "!" |
| 118 | + }, |
| 119 | + "id": "example-2", |
| 120 | + "title": "Failed field validation for id value" |
| 121 | + } |
| 122 | + ], |
| 123 | + "GetFindingRecommendation": [ |
| 124 | + { |
| 125 | + "input": { |
| 126 | + "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a", |
| 127 | + "id": "finding-id", |
| 128 | + "maxResults": 3, |
| 129 | + "nextToken": "token" |
| 130 | + }, |
| 131 | + "output": { |
| 132 | + "completedAt": "2000-01-01T00:00:01Z", |
| 133 | + "recommendationType": "UnusedPermissionRecommendation", |
| 134 | + "recommendedSteps": [ |
| 135 | + { |
| 136 | + "unusedPermissionsRecommendedStep": { |
| 137 | + "existingPolicyId": "policy-id", |
| 138 | + "recommendedAction": "DETACH_POLICY" |
| 139 | + } |
| 140 | + }, |
| 141 | + { |
| 142 | + "unusedPermissionsRecommendedStep": { |
| 143 | + "existingPolicyId": "policy-id", |
| 144 | + "recommendedAction": "CREATE_POLICY", |
| 145 | + "recommendedPolicy": "policy-content" |
| 146 | + } |
| 147 | + } |
| 148 | + ], |
| 149 | + "resourceArn": "arn:aws:iam::111122223333:role/test", |
| 150 | + "startedAt": "2000-01-01T00:00:00Z", |
| 151 | + "status": "SUCCEEDED" |
| 152 | + }, |
| 153 | + "id": "example-1", |
| 154 | + "title": "Successfully fetched finding recommendation" |
| 155 | + }, |
| 156 | + { |
| 157 | + "input": { |
| 158 | + "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a", |
| 159 | + "id": "finding-id", |
| 160 | + "maxResults": 3 |
| 161 | + }, |
| 162 | + "output": { |
| 163 | + "recommendationType": "UnusedPermissionRecommendation", |
| 164 | + "resourceArn": "arn:aws:iam::111122223333:role/test", |
| 165 | + "startedAt": "2000-01-01T00:00:00Z", |
| 166 | + "status": "IN_PROGRESS" |
| 167 | + }, |
| 168 | + "id": "example-2", |
| 169 | + "title": "In progress finding recommendation" |
| 170 | + }, |
| 171 | + { |
| 172 | + "input": { |
| 173 | + "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a", |
| 174 | + "id": "finding-id", |
| 175 | + "maxResults": 3 |
| 176 | + }, |
| 177 | + "output": { |
| 178 | + "completedAt": "2000-01-01T00:00:01Z", |
| 179 | + "error": { |
| 180 | + "code": "SERVICE_ERROR", |
| 181 | + "message": "Service error. Please try again." |
| 182 | + }, |
| 183 | + "recommendationType": "UnusedPermissionRecommendation", |
| 184 | + "resourceArn": "arn:aws:iam::111122223333:role/test", |
| 185 | + "startedAt": "2000-01-01T00:00:00Z", |
| 186 | + "status": "FAILED" |
| 187 | + }, |
| 188 | + "id": "example-3", |
| 189 | + "title": "Failed finding recommendation" |
| 190 | + }, |
| 191 | + { |
| 192 | + "input": { |
| 193 | + "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a", |
| 194 | + "id": "!" |
| 195 | + }, |
| 196 | + "id": "example-4", |
| 197 | + "title": "Failed field validation for id value" |
| 198 | + } |
| 199 | + ] |
4 | 200 | }
|
5 | 201 | }
|
0 commit comments