traceroute53 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/traceroute53 +26 -9
- data/lib/traceroute53/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2366ea9ef30a2d88826cc6601ffae1c4f87cc14a275473375e19ded8c9771ea9
|
4
|
+
data.tar.gz: 8b95a5fd70d36a1a8fa26d846304f83a52ac61107a0a323b5aff5b82b1565845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3661175cef71d2b88432e4e15f4667257a13f2f3586b822e505cc838a3f9ee1f095fb27fd895171289a4bb82498a41bda19ef3e0a20e7a433364dbd48cd3f9c
|
7
|
+
data.tar.gz: 96aa5bbe750855f4bd0c4222c0fa13a5573cfb2f00cb749afdb60badef01172c6f369a7ff943aae56a8890ac9a4e810d6cfc22433ed960e962bcfcecc95d56ad
|
data/exe/traceroute53
CHANGED
@@ -59,12 +59,11 @@ def describe_load_balancers(client, name)
|
|
59
59
|
load_balancers
|
60
60
|
end
|
61
61
|
|
62
|
-
def describe_load_balancersv2(client
|
62
|
+
def describe_load_balancersv2(client)
|
63
63
|
marker = nil
|
64
64
|
load_balancers = []
|
65
65
|
loop do
|
66
66
|
resp = client.describe_load_balancers({
|
67
|
-
names: [name],
|
68
67
|
marker: marker,
|
69
68
|
})
|
70
69
|
load_balancers.concat resp.load_balancers
|
@@ -190,7 +189,7 @@ def main
|
|
190
189
|
|
191
190
|
record_sets = list_resource_record_sets(client, hosted_zone)
|
192
191
|
while true
|
193
|
-
records = record_sets.select{|
|
192
|
+
records = record_sets.select{|r| r.name == domain_dot}
|
194
193
|
if records.empty?
|
195
194
|
STDERR.puts "resource record set not found in #{hosted_zone} for #{domain}"
|
196
195
|
exit 1
|
@@ -200,12 +199,30 @@ def main
|
|
200
199
|
STDERR.puts "more than one resource record set in #{hosted_zone} for #{domain}"
|
201
200
|
exit 1
|
202
201
|
end
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
202
|
+
record = records[0]
|
203
|
+
if record.alias_target
|
204
|
+
# The record is an AWS resource
|
205
|
+
dns_name = record.alias_target.dns_name
|
206
|
+
puts "dns name: #{dns_name}"
|
207
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Route53/Types/AliasTarget.html
|
208
|
+
if /\.elb\.(?:[a-z0-9\-]+\.)?amazonaws.com\.\z/ =~ dns_name
|
209
|
+
break
|
210
|
+
elsif /\.amazonaws.com\.\z/ =~ dns_name
|
211
|
+
STDERR.puts record.inspect
|
212
|
+
STDERR.puts "unsupported AWS resource '#{dns_name}'; pull request is welcome https://github.com/nurse/traceroute53"
|
213
|
+
exit 1
|
214
|
+
else
|
215
|
+
# assune Another Route 53 resource record set
|
216
|
+
domain_dot = dns_name
|
217
|
+
end
|
218
|
+
elsif record.type == 'CNAME'
|
219
|
+
puts "resource_records: #{record.resource_records.map(&:value)}"
|
220
|
+
domain_dot = record.resource_records[0].value
|
221
|
+
else
|
222
|
+
STDERR.puts record.inspect
|
223
|
+
STDERR.puts "unsupported record; pull request is welcome https://github.com/nurse/traceroute53"
|
224
|
+
exit 1
|
207
225
|
end
|
208
|
-
domain_dot = dns_name
|
209
226
|
end
|
210
227
|
dns_name.sub!(/\Adualstack\./, '')
|
211
228
|
dns_name.chomp!('.')
|
@@ -226,7 +243,7 @@ def main
|
|
226
243
|
region: region,
|
227
244
|
profile: profile,
|
228
245
|
)
|
229
|
-
load_balancers = describe_load_balancersv2(client
|
246
|
+
load_balancers = describe_load_balancersv2(client)
|
230
247
|
# it raises LoadBalancerNotFound exception if not found
|
231
248
|
load_balancer = load_balancers.find{|lb| lb.dns_name == dns_name}
|
232
249
|
puts "load balancer: #{load_balancer.load_balancer_name} #{load_balancer.security_groups}"
|
data/lib/traceroute53/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traceroute53
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NARUSE, Yui
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-route53
|
@@ -135,7 +135,7 @@ licenses:
|
|
135
135
|
metadata:
|
136
136
|
homepage_uri: https://github.com/nurse/traceroute53
|
137
137
|
source_code_uri: https://github.com/nurse/traceroute53
|
138
|
-
post_install_message:
|
138
|
+
post_install_message:
|
139
139
|
rdoc_options: []
|
140
140
|
require_paths:
|
141
141
|
- lib
|
@@ -150,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
154
|
-
signing_key:
|
153
|
+
rubygems_version: 3.3.7
|
154
|
+
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: A tool to investigate Route53, ELB, EC2 and Security Groups
|
157
157
|
test_files: []
|