Skip to content

Commit d0d066e

Browse files
committedJun 10, 2018
Add documentation and changelog entry for guess command flosell#22
1 parent ba5d292 commit d0d066e

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66

77
## 0.5.1
88

9+
### Added
10+
11+
* New command `guess` to extend existing policy by guessing matching actions #22
12+
913
### Fixed
1014

1115
* Fixed parsing events that contain resources without an ARN (e.g. `s3:ListObjects`) #51

‎README.md

+60-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ $ pip install trailscraper
1616
* [Download some logs (including us-east-1 for global aws services)](#download-some-logs-including-us-east-1-for-global-aws-services)
1717
* [Find CloudTrail events matching a filter (>=0.5.0)](#find-cloudtrail-events-matching-a-filter-050)
1818
* [Generate Policy from some CloudTrail records (>=0.5.0)](#generate-policy-from-some-cloudtrail-records-050)
19+
* [Extend existing policy by guessing matching actions](#extend-existing-policy-by-guessing-matching-actions)
1920
* [Find CloudTrail events and generate an IAM Policy (>=0.5.0)](#find-cloudtrail-events-and-generate-an-iam-policy-050)
2021
* [Find CloudTrail events and generate an IAM Policy (<0.5.0)](#find-cloudtrail-events-and-generate-an-iam-policy-050-1)
21-
2222
### Download some logs (including us-east-1 for global aws services)
2323
```
2424
$ trailscraper download --bucket some-bucket \
@@ -64,6 +64,65 @@ $ gzcat some-records.json.gz | trailscraper generate
6464
}
6565
```
6666

67+
### Extend existing policy by guessing matching actions
68+
69+
CloudTrail logs might not always contain all relevant actions.
70+
For example, your logs might only contain the `Create` actions after a terraform run when you really want the delete and
71+
update permissions as well. TrailScraper can try to guess additional statements that might be relevant:
72+
73+
```
74+
$ cat minimal-policy.json | trailscraper guess
75+
{
76+
"Statement": [
77+
{
78+
"Action": [
79+
"s3:PutObject"
80+
],
81+
"Effect": "Allow",
82+
"Resource": [
83+
"*"
84+
]
85+
},
86+
{
87+
"Action": [
88+
"s3:DeleteObject",
89+
"s3:GetObject",
90+
"s3:ListObjects"
91+
],
92+
"Effect": "Allow",
93+
"Resource": [
94+
"*"
95+
]
96+
}
97+
],
98+
"Version": "2012-10-17"
99+
}
100+
$ cat minimal-policy.json | ./go trailscraper guess --only Get
101+
{
102+
"Statement": [
103+
{
104+
"Action": [
105+
"s3:PutObject"
106+
],
107+
"Effect": "Allow",
108+
"Resource": [
109+
"*"
110+
]
111+
},
112+
{
113+
"Action": [
114+
"s3:GetObject"
115+
],
116+
"Effect": "Allow",
117+
"Resource": [
118+
"*"
119+
]
120+
}
121+
],
122+
"Version": "2012-10-17"
123+
}
124+
```
125+
67126
### Find CloudTrail events and generate an IAM Policy (>=0.5.0)
68127
```
69128
$ trailscraper select | trailscraper generate

0 commit comments

Comments
 (0)
Failed to load comments.