aws_recon 0.4.6 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.solargraph.yml +15 -0
- data/lib/aws_recon/collectors/dynamodb.rb +1 -1
- data/lib/aws_recon/collectors/ec2.rb +17 -16
- data/lib/aws_recon/version.rb +1 -1
- data/utils/terraform/ecs.tf +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b98e94e11398d8f2aec76174c8d660be040521e44439ca70ca7b5b680e6a631
|
4
|
+
data.tar.gz: e8920ba7308df8491ae6ce6271188fedf3e57e499bc51f6d9d772728277ef6a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4c38506bd2a3f6a84d1bbe430f9812e5989bf80d6e8198bfee55ebb1b7f6b8010ee998b896e4202443224046a5fd33c1ed1913fa43d59a25d2cfdf4028d94cc
|
7
|
+
data.tar.gz: a91bd12229dead116b77d412043ecfcef306af8a2ac80772e2c6596574c488cd9e9c97e662334d76a97acb50b95bc578c51ccfcd5dbb3c7b53145e832eea9989
|
data/.solargraph.yml
ADDED
@@ -18,7 +18,7 @@ class DynamoDB < Mapper
|
|
18
18
|
|
19
19
|
struct = OpenStruct.new(response)
|
20
20
|
struct.type = 'limits'
|
21
|
-
struct.arn = "arn:aws:dynamodb:#{@region}:#{@account}
|
21
|
+
struct.arn = "arn:aws:dynamodb:#{@region}:#{@account}/limits"
|
22
22
|
|
23
23
|
resources.push(struct.to_h)
|
24
24
|
end
|
@@ -29,7 +29,7 @@ class EC2 < Mapper
|
|
29
29
|
struct = OpenStruct.new
|
30
30
|
struct.attributes = response.account_attributes.map(&:to_h)
|
31
31
|
struct.type = 'account'
|
32
|
-
struct.arn = "arn:aws::#{@account}"
|
32
|
+
struct.arn = "arn:aws:ec2::#{@account}/account_attributes"
|
33
33
|
|
34
34
|
resources.push(struct.to_h)
|
35
35
|
end
|
@@ -45,6 +45,7 @@ class EC2 < Mapper
|
|
45
45
|
|
46
46
|
struct = OpenStruct.new(response.to_h)
|
47
47
|
struct.type = 'ebs_encryption_settings'
|
48
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/ebs_encryption_settings"
|
48
49
|
|
49
50
|
resources.push(struct.to_h)
|
50
51
|
end
|
@@ -95,7 +96,7 @@ class EC2 < Mapper
|
|
95
96
|
response.vpcs.each do |vpc|
|
96
97
|
struct = OpenStruct.new(vpc.to_h)
|
97
98
|
struct.type = 'vpc'
|
98
|
-
struct.arn = vpc.vpc_id # no true ARN
|
99
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{vpc.vpc_id}" # no true ARN
|
99
100
|
struct.flow_logs = @client
|
100
101
|
.describe_flow_logs({ filter: [{ name: 'resource-id', values: [vpc.vpc_id] }] })
|
101
102
|
.flow_logs.first.to_h
|
@@ -113,7 +114,7 @@ class EC2 < Mapper
|
|
113
114
|
response.security_groups.each do |security_group|
|
114
115
|
struct = OpenStruct.new(security_group.to_h)
|
115
116
|
struct.type = 'security_group'
|
116
|
-
struct.arn = security_group.group_id # no true ARN
|
117
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{security_group.group_id}" # no true ARN
|
117
118
|
|
118
119
|
resources.push(struct.to_h)
|
119
120
|
end
|
@@ -128,7 +129,7 @@ class EC2 < Mapper
|
|
128
129
|
response.network_interfaces.each do |network_interface|
|
129
130
|
struct = OpenStruct.new(network_interface.to_h)
|
130
131
|
struct.type = 'network_interface'
|
131
|
-
struct.arn = network_interface.network_interface_id # no true ARN
|
132
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{network_interface.network_interface_id}" # no true ARN
|
132
133
|
|
133
134
|
resources.push(struct.to_h)
|
134
135
|
end
|
@@ -143,7 +144,7 @@ class EC2 < Mapper
|
|
143
144
|
response.network_acls.each do |network_acl|
|
144
145
|
struct = OpenStruct.new(network_acl.to_h)
|
145
146
|
struct.type = 'network_acl'
|
146
|
-
struct.arn = network_acl.network_acl_id # no true ARN
|
147
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{network_acl.network_acl_id}" # no true ARN
|
147
148
|
|
148
149
|
resources.push(struct.to_h)
|
149
150
|
end
|
@@ -158,7 +159,7 @@ class EC2 < Mapper
|
|
158
159
|
response.subnets.each do |subnet|
|
159
160
|
struct = OpenStruct.new(subnet.to_h)
|
160
161
|
struct.type = 'subnet'
|
161
|
-
struct.arn = subnet.subnet_arn
|
162
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{subnet.subnet_arn}" # no true ARN
|
162
163
|
|
163
164
|
resources.push(struct.to_h)
|
164
165
|
end
|
@@ -173,7 +174,7 @@ class EC2 < Mapper
|
|
173
174
|
response.addresses.each do |address|
|
174
175
|
struct = OpenStruct.new(address.to_h)
|
175
176
|
struct.type = 'eip_address'
|
176
|
-
struct.arn = address.allocation_id
|
177
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{address.allocation_id}" # no true ARN
|
177
178
|
|
178
179
|
resources.push(struct.to_h)
|
179
180
|
end
|
@@ -188,7 +189,7 @@ class EC2 < Mapper
|
|
188
189
|
response.nat_gateways.each do |gateway|
|
189
190
|
struct = OpenStruct.new(gateway.to_h)
|
190
191
|
struct.type = 'nat_gateway'
|
191
|
-
struct.arn = gateway.nat_gateway_id # no true ARN
|
192
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{gateway.nat_gateway_id}" # no true ARN
|
192
193
|
|
193
194
|
resources.push(struct.to_h)
|
194
195
|
end
|
@@ -203,7 +204,7 @@ class EC2 < Mapper
|
|
203
204
|
response.internet_gateways.each do |gateway|
|
204
205
|
struct = OpenStruct.new(gateway.to_h)
|
205
206
|
struct.type = 'internet_gateway'
|
206
|
-
struct.arn = gateway.internet_gateway_id # no true ARN
|
207
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{gateway.internet_gateway_id}" # no true ARN
|
207
208
|
|
208
209
|
resources.push(struct.to_h)
|
209
210
|
end
|
@@ -218,7 +219,7 @@ class EC2 < Mapper
|
|
218
219
|
response.route_tables.each do |table|
|
219
220
|
struct = OpenStruct.new(table.to_h)
|
220
221
|
struct.type = 'route_table'
|
221
|
-
struct.arn = table.route_table_id # no true ARN
|
222
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{table.route_table_id}" # no true ARN
|
222
223
|
|
223
224
|
resources.push(struct.to_h)
|
224
225
|
end
|
@@ -233,7 +234,7 @@ class EC2 < Mapper
|
|
233
234
|
response.images.each do |image|
|
234
235
|
struct = OpenStruct.new(image.to_h)
|
235
236
|
struct.type = 'image'
|
236
|
-
struct.arn = image.image_id # no true ARN
|
237
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{image.image_id}" # no true ARN
|
237
238
|
|
238
239
|
resources.push(struct.to_h)
|
239
240
|
end
|
@@ -248,7 +249,7 @@ class EC2 < Mapper
|
|
248
249
|
response.snapshots.each do |snapshot|
|
249
250
|
struct = OpenStruct.new(snapshot.to_h)
|
250
251
|
struct.type = 'snapshot'
|
251
|
-
struct.arn = snapshot.snapshot_id # no true ARN
|
252
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{snapshot.snapshot_id}" # no true ARN
|
252
253
|
struct.create_volume_permissions = @client.describe_snapshot_attribute({
|
253
254
|
attribute: 'createVolumePermission',
|
254
255
|
snapshot_id: snapshot.snapshot_id
|
@@ -267,7 +268,7 @@ class EC2 < Mapper
|
|
267
268
|
response.flow_logs.each do |flow_log|
|
268
269
|
struct = OpenStruct.new(flow_log.to_h)
|
269
270
|
struct.type = 'flow_log'
|
270
|
-
struct.arn = flow_log.flow_log_id # no true ARN
|
271
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{flow_log.flow_log_id}" # no true ARN
|
271
272
|
|
272
273
|
resources.push(struct.to_h)
|
273
274
|
end
|
@@ -282,7 +283,7 @@ class EC2 < Mapper
|
|
282
283
|
response.volumes.each do |volume|
|
283
284
|
struct = OpenStruct.new(volume.to_h)
|
284
285
|
struct.type = 'volume'
|
285
|
-
struct.arn = volume.volume_id # no true ARN
|
286
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{volume.volume_id}" # no true ARN
|
286
287
|
|
287
288
|
resources.push(struct.to_h)
|
288
289
|
end
|
@@ -297,7 +298,7 @@ class EC2 < Mapper
|
|
297
298
|
response.vpn_gateways.each do |gateway|
|
298
299
|
struct = OpenStruct.new(gateway.to_h)
|
299
300
|
struct.type = 'vpn_gateway'
|
300
|
-
struct.arn = gateway.vpn_gateway_id # no true ARN
|
301
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{gateway.vpn_gateway_id}" # no true ARN
|
301
302
|
|
302
303
|
resources.push(struct.to_h)
|
303
304
|
end
|
@@ -312,7 +313,7 @@ class EC2 < Mapper
|
|
312
313
|
response.vpc_peering_connections.each do |peer|
|
313
314
|
struct = OpenStruct.new(peer.to_h)
|
314
315
|
struct.type = 'peering_connection'
|
315
|
-
struct.arn = peer.vpc_peering_connection_id # no true ARN
|
316
|
+
struct.arn = "arn:aws:ec2:#{@region}:#{@account}/#{peer.vpc_peering_connection_id}" # no true ARN
|
316
317
|
|
317
318
|
resources.push(struct.to_h)
|
318
319
|
end
|
data/lib/aws_recon/version.rb
CHANGED
data/utils/terraform/ecs.tf
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_recon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Larsen
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- ".github/workflows/smoke-test.yml"
|
168
168
|
- ".gitignore"
|
169
169
|
- ".rubocop.yml"
|
170
|
+
- ".solargraph.yml"
|
170
171
|
- Dockerfile
|
171
172
|
- Gemfile
|
172
173
|
- LICENSE.txt
|