aws_recon 0.5.4 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d64ead4511b072694c681eb0e13fab491d01398319ba19ea1c70e533040e0454
4
- data.tar.gz: 37c12b9b8dda2ac030fd62f4da97912800a2725070b56cc3fac70fdea118e281
3
+ metadata.gz: f63df658eeddb1e81970f6dc99a1f05a2fa2d1d62b037e35665c46d4016ead29
4
+ data.tar.gz: c8328a76621f50123f5552681ce3d54e17567c194ad2c12e0eab8a2e6c8cd2c9
5
5
  SHA512:
6
- metadata.gz: 6ef8c579c750d232000e2d1e0d53b0cb5054da766a8e62c9e0f49f6000d860b2cecb36c403126bad7cc9e1aa593fe459da953412c73829957786a4837cb0f9da
7
- data.tar.gz: b70c879f9f092a5f74076f97109374b3ddcf948f6d4d9163cce99b313499b6bb63e2d73165d1a32b5e254000ef0a354ca6666ee6f301f50a7d30180e7870fc64
6
+ metadata.gz: fa3f60bce87b3d2c1124baf02cc05274596234e5510a54cdf0d880027aac8b6fe604729ceab7c5e01af955ef9b3e43407c37edd7a7854235190b1d1f28fd61d3
7
+ data.tar.gz: 56cd4b818b3e62f9d7ffaa7ae1c9badb9ba99583e1cea27d58160add1606b3e0b4145e712ef9340946423ca13470a5df7bc9955d7c63e45e1aa87496b2e7c5e2
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- ARG RUBY_VERSION=2.6.6
1
+ ARG RUBY_VERSION=2.7.3
2
2
  FROM ruby:${RUBY_VERSION}-alpine
3
3
 
4
4
  LABEL maintainer="Darkbit <info@darkbit.io>"
@@ -34,7 +34,7 @@ module AwsRecon
34
34
  # formatter
35
35
  @formatter = Formatter.new
36
36
 
37
- return unless @options.stream_output
37
+ return if @options.stream_output
38
38
 
39
39
  puts "\nStarting collection with #{@options.threads} threads...\n"
40
40
  end
@@ -66,7 +66,7 @@ module AwsRecon
66
66
  end
67
67
 
68
68
  #
69
- # Format @resources as either
69
+ # Format @resources as either JSON or JSONL
70
70
  #
71
71
  def formatted_json
72
72
  if @options.jsonl
@@ -117,7 +117,7 @@ module AwsRecon
117
117
  ensure
118
118
  elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - @starting
119
119
 
120
- puts "\nFinished in #{elapsed.to_i} seconds.\n\n"
120
+ puts "\nFinished in #{elapsed.to_i} seconds.\n\n" unless @options.stream_output
121
121
 
122
122
  # write output file
123
123
  if @options.output_file && !@options.s3
@@ -17,6 +17,9 @@ class Lambda < Mapper
17
17
  struct = OpenStruct.new(function)
18
18
  struct.type = 'function'
19
19
  struct.arn = function.function_arn
20
+ struct.vpc_config = function.vpc_config.to_h
21
+ struct.tracing_config = function.tracing_config.to_h
22
+ struct.layers = function.layers ? function.layers.map(&:to_h) : []
20
23
  struct.policy = @client.get_policy({ function_name: function.function_name }).policy.parse_policy
21
24
 
22
25
  rescue Aws::Lambda::Errors::ResourceNotFoundException => e
@@ -36,6 +39,7 @@ class Lambda < Mapper
36
39
  struct = OpenStruct.new(layer)
37
40
  struct.type = 'layer'
38
41
  struct.arn = layer.layer_arn
42
+ struct.latest_matching_version = layer.latest_matching_version.to_h
39
43
 
40
44
  # list_layer_versions
41
45
  struct.versions = @client.list_layer_versions({ layer_name: layer.layer_name }).layer_versions.map(&:to_h)
@@ -7,9 +7,7 @@ class WAFV2 < Mapper
7
7
  #
8
8
  # Returns an array of resources.
9
9
  #
10
- # TODO: test live
11
10
  # TODO: resolve scope (e.g. CLOUDFRONT supported?)
12
- # TODO: confirm paging behavior
13
11
  #
14
12
  def collect
15
13
  resources = []
@@ -25,7 +23,6 @@ class WAFV2 < Mapper
25
23
  response.web_acls.each do |acl|
26
24
  struct = OpenStruct.new(acl.to_h)
27
25
  struct.type = 'web_acl'
28
- # struct.arn = "arn:aws:#{@service}:#{@region}::web_acl/#{acl.id}"
29
26
 
30
27
  params = {
31
28
  name: acl.name,
@@ -40,7 +37,7 @@ class WAFV2 < Mapper
40
37
  end
41
38
 
42
39
  # list_resources_for_web_acl
43
- @client.list_resources_for_web_acl({ web_acl_arn: 'ResourceArn' }).each do |r|
40
+ @client.list_resources_for_web_acl({ web_acl_arn: acl.arn }).each do |r|
44
41
  struct.resources = r.resource_arns.map(&:to_h)
45
42
  end
46
43
 
@@ -100,6 +100,7 @@ class Parser
100
100
 
101
101
  # write output file to S3 bucket
102
102
  opts.on('-b', '--s3-bucket [BUCKET:REGION]', 'Write output file to S3 bucket (default: \'\')') do |bucket_with_region|
103
+ args.stream_output = false
103
104
  args.s3 = bucket_with_region
104
105
  end
105
106
 
@@ -109,8 +110,8 @@ class Parser
109
110
  end
110
111
 
111
112
  # output format
112
- opts.on('-f', '--format [FORMAT]', 'Specify output format (default: aws)') do |file|
113
- args.output_format = file.downcase if %w[aws custom].include?(file.downcase)
113
+ opts.on('-f', '--format [FORMAT]', 'Specify output format (default: aws)') do |f|
114
+ args.output_format = f.downcase if %w[aws custom].include?(f.downcase)
114
115
  end
115
116
 
116
117
  # threads
@@ -56,7 +56,7 @@
56
56
  - name: ECR
57
57
  alias: ecr
58
58
  - name: DynamoDB
59
- alias: ddb
59
+ alias: dynamodb
60
60
  - name: KMS
61
61
  alias: kms
62
62
  - name: Kinesis
@@ -102,7 +102,7 @@
102
102
  - af-south-1
103
103
  - ap-northeast-3
104
104
  - name: SecretsManager
105
- alias: sm
105
+ alias: secretsmanager
106
106
  - name: SecurityHub
107
107
  alias: securityhub
108
108
  - name: Support
@@ -153,9 +153,8 @@
153
153
  alias: transfer
154
154
  excluded_regions:
155
155
  - ap-northeast-3
156
- - eu-south-1
157
156
  - name: DirectConnect
158
- alias: dc
157
+ alias: directconnect
159
158
  - name: DirectoryService
160
159
  alias: ds
161
160
  excluded_regions:
@@ -1,3 +1,3 @@
1
1
  module AwsRecon
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.9"
3
3
  end
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.5.4
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Larsen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-16 00:00:00.000000000 Z
12
+ date: 2021-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk