aws_recon 0.2.23 → 0.2.24

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: 54fad8cccce80029ddf2ae72d7dc8bccb12677d1605f113c16416f2b9e897536
4
- data.tar.gz: '02280cf3c096fa03d3b893a19ef444c14f891ab6f1694997ca76905a11290b29'
3
+ metadata.gz: '091d2a7a27fb6c37494ec2bbddfc029c73e915925ea93e4011dbaaf6fbf637e5'
4
+ data.tar.gz: a6f2cfb73e6a667f3d3faff70956d26e065d3f83a6dedcdbdf0cd8eb82102385
5
5
  SHA512:
6
- metadata.gz: cf30189b0f288c076d026104a1ce43775b9ae4704f842aa2d77d7166773a232716e85822392321fe958a74896a2ced3b0f0e36ffbfb82e2b4f5a98f33f17f660
7
- data.tar.gz: e0990bc486ffaf659d84de6a23e8d214bb9327c81d8518810682107e1c9144b7d40f35d5a3addf61ce1b5b5b57f3a398898c83b81b6187aa9911b7650e5be5d2
6
+ metadata.gz: b488755dd29b5d262e2b6775a9de1830f024975874a4f617f0cd01f80a621e2a18e1955b4a590418aa0d1efc203b2427221129ae069c01a038d1ed35bdc0b500
7
+ data.tar.gz: 8997f3f3350fc9c8a6ded6fbd437816005d5a17a7b6db76c2e3e646b9076af210c4b803a68e2b568bff8ea277950bfb99031c6baa767b23138db5da9869c41c0
@@ -14,7 +14,7 @@ class DatabaseMigrationService < Mapper
14
14
  response.replication_instances.each do |instance|
15
15
  struct = OpenStruct.new(instance.to_h)
16
16
  struct.type = 'replication_instance'
17
- struct.arb = "arn:aws:#{@service}:#{@region}::replication_instance/#{instance.replication_instance_identifier}"
17
+ struct.arn = "arn:aws:#{@service}:#{@region}::replication_instance/#{instance.replication_instance_identifier}"
18
18
 
19
19
  resources.push(struct.to_h)
20
20
  end
@@ -89,14 +89,19 @@ class IAM < Mapper
89
89
  #
90
90
  # get_account_password_policy
91
91
  #
92
- @client.get_account_password_policy.each do |response|
93
- log(response.context.operation_name)
92
+ begin
93
+ @client.get_account_password_policy.each do |response|
94
+ log(response.context.operation_name)
94
95
 
95
- struct = OpenStruct.new(response.password_policy.to_h)
96
- struct.type = 'password_policy'
97
- struct.arn = "arn:aws:iam::#{@account}:account_password_policy/global"
96
+ struct = OpenStruct.new(response.password_policy.to_h)
97
+ struct.type = 'password_policy'
98
+ struct.arn = "arn:aws:iam::#{@account}:account_password_policy/global"
98
99
 
99
- resources.push(struct.to_h)
100
+ resources.push(struct.to_h)
101
+ end
102
+ rescue Aws::IAM::Errors::ServiceError => e
103
+ log_error(e.code)
104
+ raise e unless suppressed_errors.include?(e.code)
100
105
  end
101
106
 
102
107
  #
@@ -190,6 +195,7 @@ class IAM < Mapper
190
195
  def suppressed_errors
191
196
  %w[
192
197
  ReportNotPresent
198
+ NoSuchEntity
193
199
  ]
194
200
  end
195
201
  end
@@ -34,18 +34,32 @@ class Organizations < Mapper
34
34
  #
35
35
  # list_policies
36
36
  #
37
- @client.list_policies({ filter: 'SERVICE_CONTROL_POLICY' }).each_with_index do |response, page|
38
- log(response.context.operation_name, page)
37
+ begin
38
+ @client.list_policies({ filter: 'SERVICE_CONTROL_POLICY' }).each_with_index do |response, page|
39
+ log(response.context.operation_name, page)
39
40
 
40
- response.policies.each do |policy|
41
- struct = OpenStruct.new(policy.to_h)
42
- struct.type = 'service_control_policy'
43
- struct.content = @client.describe_policy({ policy_id: policy.id }).policy.content.parse_policy
41
+ response.policies.each do |policy|
42
+ struct = OpenStruct.new(policy.to_h)
43
+ struct.type = 'service_control_policy'
44
+ struct.content = @client.describe_policy({ policy_id: policy.id }).policy.content.parse_policy
44
45
 
45
- resources.push(struct.to_h)
46
+ resources.push(struct.to_h)
47
+ end
46
48
  end
49
+ rescue Aws::Organizations::Errors::ServiceError => e
50
+ log_error(e.code)
51
+ raise e unless suppressed_errors.include?(e.code)
47
52
  end
48
53
 
49
54
  resources
50
55
  end
56
+
57
+ private
58
+
59
+ # not an error
60
+ def suppressed_errors
61
+ %w[
62
+ AccessDeniedException
63
+ ]
64
+ end
51
65
  end
@@ -8,16 +8,30 @@ class SecurityHub < Mapper
8
8
  #
9
9
  # describe_hub
10
10
  #
11
- @client.describe_hub.each do |response|
12
- log(response.context.operation_name)
11
+ begin
12
+ @client.describe_hub.each do |response|
13
+ log(response.context.operation_name)
13
14
 
14
- struct = OpenStruct.new(response.to_h)
15
- struct.type = 'hub'
16
- struct.arn = response.hub_arn
15
+ struct = OpenStruct.new(response.to_h)
16
+ struct.type = 'hub'
17
+ struct.arn = response.hub_arn
17
18
 
18
- resources.push(struct.to_h)
19
+ resources.push(struct.to_h)
20
+ end
21
+ rescue Aws::SecurityHub::Errors::ServiceError => e
22
+ log_error(e.code)
23
+ raise e unless suppressed_errors.include?(e.code)
19
24
  end
20
25
 
21
26
  resources
22
27
  end
28
+
29
+ private
30
+
31
+ # not an error
32
+ def suppressed_errors
33
+ %w[
34
+ InvalidAccessException
35
+ ]
36
+ end
23
37
  end
@@ -37,6 +37,7 @@ class Support < Mapper
37
37
  # not an error
38
38
  def suppressed_errors
39
39
  %w[
40
+ AccessDeniedException
40
41
  SubscriptionRequiredException
41
42
  ]
42
43
  end
@@ -41,6 +41,11 @@
41
41
  alias: elasticache
42
42
  - name: EMR
43
43
  alias: emr
44
+ excluded_regions:
45
+ - ap-east-1
46
+ - af-south-1
47
+ - eu-south-1
48
+ - me-south-1
44
49
  - name: IAM
45
50
  global: true
46
51
  alias: iam
@@ -1,3 +1,3 @@
1
1
  module AwsRecon
2
- VERSION = "0.2.23"
2
+ VERSION = "0.2.24"
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.2.23
4
+ version: 0.2.24
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: 2020-11-28 00:00:00.000000000 Z
12
+ date: 2020-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk