aws_recon 0.2.26 → 0.2.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -1
- data/lib/aws_recon/collectors/rds.rb +5 -0
- data/lib/aws_recon/collectors/s3.rb +6 -3
- data/lib/aws_recon/collectors/sagemaker.rb +25 -1
- data/lib/aws_recon/lib/mapper.rb +8 -6
- data/lib/aws_recon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2735a8f96df8c633e71fb31cd0a67248bd4f1cf1205ef6815e438d223810f5e9
|
4
|
+
data.tar.gz: a134383f05173c5e46005859b637b45d35f2ad33df518c5befb4f443122ea623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ceefcb774b6067837b4eec5e421be0992a93372fbdea73dcc397e6e5a45c5fab69fdec8e5a150e8ce20d88215f78d35609fb59699b9cb9f9ddb63074262f71
|
7
|
+
data.tar.gz: df340090ee783531f7686c85fe42b5474d1f8f8534d0b3de1e47711e864512752e06f91f525f770c37f87714667e17257dbdc25faa4bb65ea0e8b2e0f87c0a0d
|
data/.rubocop.yml
CHANGED
@@ -9,4 +9,20 @@
|
|
9
9
|
#
|
10
10
|
# See https://docs.rubocop.org/rubocop/configuration
|
11
11
|
Layout/LineLength:
|
12
|
-
Max:
|
12
|
+
Max: 100
|
13
|
+
Style/FrozenStringLiteralComment:
|
14
|
+
EnforcedStyle: always_true
|
15
|
+
Safe: true
|
16
|
+
SafeAutoCorrect: true
|
17
|
+
Style/ClassAndModuleChildren:
|
18
|
+
Enabled: false
|
19
|
+
Metrics/BlockLength:
|
20
|
+
Enabled: false
|
21
|
+
Metrics/MethodLength:
|
22
|
+
Enabled: false
|
23
|
+
Metrics/PerceivedComplexity:
|
24
|
+
Enabled: false
|
25
|
+
Metrics/CyclomaticComplexity:
|
26
|
+
Enabled: false
|
27
|
+
Metrics/AbcSize:
|
28
|
+
Enabled: false
|
@@ -1,3 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Collect S3 Resources
|
5
|
+
#
|
1
6
|
class S3 < Mapper
|
2
7
|
#
|
3
8
|
# Returns an array of resources.
|
@@ -63,9 +68,7 @@ class S3 < Mapper
|
|
63
68
|
rescue Aws::S3::Errors::ServiceError => e
|
64
69
|
log_error(e.code)
|
65
70
|
|
66
|
-
unless suppressed_errors.include?(e.code) && !@options.quit_on_exception
|
67
|
-
raise e
|
68
|
-
end
|
71
|
+
raise e unless suppressed_errors.include?(e.code) && !@options.quit_on_exception
|
69
72
|
end
|
70
73
|
|
71
74
|
resources.push(struct.to_h)
|
@@ -1,3 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Collect SageMaker Resources
|
5
|
+
#
|
1
6
|
class SageMaker < Mapper
|
2
7
|
#
|
3
8
|
# Returns an array of resources.
|
@@ -12,7 +17,9 @@ class SageMaker < Mapper
|
|
12
17
|
log(response.context.operation_name, page)
|
13
18
|
|
14
19
|
response.notebook_instances.each do |instance|
|
15
|
-
struct = OpenStruct.new(
|
20
|
+
struct = OpenStruct.new(@client.describe_notebook_instance({
|
21
|
+
notebook_instance_name: instance.notebook_instance_name
|
22
|
+
}).to_h)
|
16
23
|
struct.type = 'notebook_instance'
|
17
24
|
struct.arn = instance.notebook_instance_arn
|
18
25
|
|
@@ -20,6 +27,23 @@ class SageMaker < Mapper
|
|
20
27
|
end
|
21
28
|
end
|
22
29
|
|
30
|
+
#
|
31
|
+
# list_endpoints
|
32
|
+
#
|
33
|
+
@client.list_endpoints.each_with_index do |response, page|
|
34
|
+
log(response.context.operation_name, page)
|
35
|
+
|
36
|
+
response.endpoints.each do |instance|
|
37
|
+
struct = OpenStruct.new(@client.describe_endpoint({
|
38
|
+
endpoint_name: instance.endpoint_name
|
39
|
+
}).to_h)
|
40
|
+
struct.type = 'endpoint'
|
41
|
+
struct.arn = instance.endpoint_arn
|
42
|
+
|
43
|
+
resources.push(struct.to_h)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
23
47
|
resources
|
24
48
|
end
|
25
49
|
end
|
data/lib/aws_recon/lib/mapper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#
|
2
4
|
# Generic wrapper for service clients.
|
3
5
|
#
|
@@ -64,14 +66,14 @@ class Mapper
|
|
64
66
|
end
|
65
67
|
|
66
68
|
def log(*msg)
|
67
|
-
|
68
|
-
|
69
|
-
|
69
|
+
return unless @options.verbose
|
70
|
+
|
71
|
+
puts _msg(msg).map { |x| "\x1b[32m#{x}\x1b[0m" }.join("\x1b[35m.\x1b[0m")
|
70
72
|
end
|
71
73
|
|
72
74
|
def log_error(*msg)
|
73
|
-
|
74
|
-
|
75
|
-
|
75
|
+
return unless @options.verbose
|
76
|
+
|
77
|
+
puts _msg(msg).map { |x| "\x1b[35m#{x}\x1b[0m" }.join("\x1b[32m.\x1b[0m")
|
76
78
|
end
|
77
79
|
end
|
data/lib/aws_recon/version.rb
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.2.
|
4
|
+
version: 0.2.27
|
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-12-
|
12
|
+
date: 2020-12-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|