2 files changed +64
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
7
7
## 0.5.1
8
8
9
+ ### Added
10
+
11
+ * New command ` guess ` to extend existing policy by guessing matching actions #22
12
+
9
13
### Fixed
10
14
11
15
* Fixed parsing events that contain resources without an ARN (e.g. ` s3:ListObjects ` ) #51
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ $ pip install trailscraper
16
16
* [ Download some logs (including us-east-1 for global aws services)] ( #download-some-logs-including-us-east-1-for-global-aws-services )
17
17
* [ Find CloudTrail events matching a filter (> ; =0.5.0)] ( #find-cloudtrail-events-matching-a-filter-050 )
18
18
* [ 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 )
19
20
* [ Find CloudTrail events and generate an IAM Policy (> ; =0.5.0)] ( #find-cloudtrail-events-and-generate-an-iam-policy-050 )
20
21
* [ Find CloudTrail events and generate an IAM Policy (< ; 0.5.0)] ( #find-cloudtrail-events-and-generate-an-iam-policy-050-1 )
21
-
22
22
### Download some logs (including us-east-1 for global aws services)
23
23
```
24
24
$ trailscraper download --bucket some-bucket \
@@ -64,6 +64,65 @@ $ gzcat some-records.json.gz | trailscraper generate
64
64
}
65
65
```
66
66
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
+
67
126
### Find CloudTrail events and generate an IAM Policy (>=0.5.0)
68
127
```
69
128
$ trailscraper select | trailscraper generate
0 commit comments