Commit d0b91f2
committed
CLDSRV-616: Fix bucket policy check for anonymous req
When checking bucket policies and the following conditions
are true:
- The request is anonymous (`--no-sign-request`)
- There is a bucket policy with AWS principal
Then `_getAccountId` is called in arn === undefined and
causes an exception to be thrown.
The reason is that vault return the following authInfo
with anonymous requests:
{
arn: undefined,
canonicalID: 'http://acs.amazonaws.com/groups/global/AllUsers',
shortid: undefined,
email: undefined,
accountDisplayName: undefined,
IAMdisplayName: undefined
}
The fix is to check is to check is arn === undefined and fail
the check if the policy principal is not '*'
(cherry picked from commit d57e3a9)1 parent 162bdd6 commit d0b91f2
2 files changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
272 | 276 | | |
273 | 277 | | |
274 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
292 | 296 | | |
293 | 297 | | |
294 | 298 | | |
295 | | - | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
300 | 314 | | |
301 | 315 | | |
302 | 316 | | |
| |||
376 | 390 | | |
377 | 391 | | |
378 | 392 | | |
379 | | - | |
| 393 | + | |
380 | 394 | | |
381 | 395 | | |
382 | 396 | | |
| |||
0 commit comments