Skip to content

Commit 59a3bca

Browse files
authored
Merge pull request #156 from darkbitio/build
Build
2 parents 0f102df + b1651e1 commit 59a3bca

File tree

4 files changed

+101
-1
lines changed

4 files changed

+101
-1
lines changed

lib/aws_recon/collectors/glue.rb

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# frozen_string_literal: true
2+
3+
#
4+
# Collect Glue resources
5+
#
6+
class Glue < Mapper
7+
#
8+
# Returns an array of resources.
9+
#
10+
def collect
11+
resources = []
12+
#
13+
# get_data_catalog_encryption_settings
14+
#
15+
@client.get_data_catalog_encryption_settings.each_with_index do | response, page|
16+
log(response.context.operation_name, page)
17+
18+
struct = OpenStruct.new(response.to_h)
19+
struct.type = 'catalog_encryption_settings'
20+
struct.arn = "arn:aws:glue:#{@region}:#{@account}:data-catalog-encryption-settings" # no true ARN
21+
resources.push(struct.to_h)
22+
end
23+
24+
#
25+
# get_security_configurations
26+
#
27+
@client.get_security_configurations.each_with_index do | response, page |
28+
log(response.context.operation_name, page)
29+
30+
response.security_configurations.each do | security_configuration |
31+
struct = OpenStruct.new(security_configuration.to_h)
32+
struct.type = 'security_configuration'
33+
struct.arn = "arn:aws:glue:#{@region}:#{@account}:security-configuration/#{security_configuration.name}" # no true ARN
34+
resources.push(struct.to_h)
35+
end
36+
end
37+
38+
#
39+
# get_jobs
40+
#
41+
@client.get_jobs.each_with_index do | response, page |
42+
log(response.context.operation_name, page)
43+
44+
response.jobs.each do | job |
45+
struct = OpenStruct.new(job.to_h)
46+
struct.type = 'job'
47+
struct.arn = "arn:aws:glue:#{@region}:#{@account}:job/#{job.name}"
48+
resources.push(struct.to_h)
49+
end
50+
end
51+
52+
#
53+
# get_dev_endpoints
54+
#
55+
@client.get_dev_endpoints.each_with_index do | response, page |
56+
log(response.context.operation_name, page)
57+
58+
response.dev_endpoints.each do | dev_endpoint |
59+
struct = OpenStruct.new(dev_endpoint.to_h)
60+
struct.type = 'dev_endpoint'
61+
struct.arn = "arn:aws:glue:#{@region}:#{@account}:devEndpoint/#{dev_endpoint.endpoint_name}"
62+
resources.push(struct.to_h)
63+
end
64+
end
65+
66+
#
67+
# get_crawlers
68+
#
69+
@client.get_crawlers.each_with_index do | response, page |
70+
log(response.context.operation_name, page)
71+
72+
response.crawlers.each do | crawler |
73+
struct = OpenStruct.new(crawler.to_h)
74+
struct.type = 'crawler'
75+
struct.arn = "arn:aws:glue:#{@region}:#{@account}:crawler/#{crawler.name}"
76+
resources.push(struct.to_h)
77+
end
78+
end
79+
80+
#
81+
# get_connections
82+
#
83+
@client.get_connections.each_with_index do | response, page |
84+
log(response.context.operation_name, page)
85+
86+
response.connection_list.each do | connection |
87+
struct = OpenStruct.new(connection.to_h)
88+
struct.type = 'connection'
89+
struct.arn = "arn:aws:glue:#{@region}:#{@account}:connection/#{connection.name}"
90+
resources.push(struct.to_h)
91+
end
92+
end
93+
resources
94+
end
95+
96+
end
97+

lib/aws_recon/services.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
alias: elasticache
4242
- name: EMR
4343
alias: emr
44+
- name: Glue
45+
alias: glue
4446
- name: IAM
4547
global: true
4648
alias: iam

lib/aws_recon/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module AwsRecon
2-
VERSION = "0.5.26"
2+
VERSION = "0.5.27"
33
end

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ AWS Recon aims to collect all resources and metadata that are relevant in determ
368368
- [x] Firehose
369369
- [ ] FMS
370370
- [ ] Glacier
371+
- [x] Glue
371372
- [x] IAM
372373
- [x] KMS
373374
- [x] Kafka

0 commit comments

Comments
 (0)