vagrant-ec2-metadata 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da54b9d441a8844ab1c1332f465f182200410d2c
4
- data.tar.gz: 4d86c6d5b5d8d02e47da0363a3150e996065665e
3
+ metadata.gz: b39fa813ecb66b687b5bfdd5be62352fae5e4e0d
4
+ data.tar.gz: 2da7b1319f80aecdecf9c6922bde2530aefdfd26
5
5
  SHA512:
6
- metadata.gz: c8beeb24f899d3f43e274e9ab258ecea863fce7b8c76a4a75bee579695b22ba44541f42c00cf96054f50f4a5d0f027885caaeb0f92bc806a6e65d7eccec670f2
7
- data.tar.gz: d51d4d311424d5792bd5165d70f5fd5f095c4ac382d5c3183c0db1810713063a4624e493ebe7c4754734a7c03dac17f843ee03dcc89c8b88f3bcb97c65d6b0a6
6
+ metadata.gz: 3772d5c7560a0e4b0e8b27757b2d1faa83dda570626ed1bebe064733fe8fa6688a98113bd76ae5f196c56dff90325971f64dfaa08cb405ad86d7387068b87e0b
7
+ data.tar.gz: b0dc167dd1e73d3a0ee1df85dda666f806d3f7e18f4f65519eaa361cef2d26ff7c08324f3bccb5a474c253c21f62f66539c681138caa82d3eac59507b1ec751a
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -15,17 +15,18 @@ module VagrantEc2Metadata
15
15
 
16
16
  def start
17
17
  WEBrick::Daemon.start if @options[:daemonize]
18
-
19
- host_ip = Socket.ip_address_list.detect(&:ipv4_private?).ip_address
20
- server = WEBrick::HTTPServer.new(BindAddress: host_ip, Port: @port)
18
+ server = WEBrick::HTTPServer.new(Port: @port)
21
19
 
22
20
  trap "INT" do
23
21
  server.shutdown
24
22
  end
25
23
 
26
24
  server.mount_proc "/" do |req, res|
27
- # Only allow requests from our own IP, which the VMs will normally share
28
- if req.peeraddr[-1] != host_ip
25
+ # Only allow requests from IP addresses that we own, which the VM will normally share
26
+ addr = Addrinfo.new(req.peeraddr)
27
+ addr = addr.ipv6_to_ipv4 if addr.ipv6_v4mapped?
28
+ remote_ip = addr.ip_address
29
+ if !Socket.ip_address_list.select { |a| a.ipv4_private? || a.ipv4_loopback? }.map(&:ip_address).include?(remote_ip)
29
30
  res.status = 403 # Forbidden
30
31
  next
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantEc2Metadata
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-ec2-metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Sundin
@@ -31,7 +31,7 @@ cert_chain:
31
31
  E04BZKo2WzOTzSDymo97Yu4YFgyc98umMyeaCvPk4YmdNzqSanAXpY2bnsyu0CF5
32
32
  Td0=
33
33
  -----END CERTIFICATE-----
34
- date: 2017-10-29 00:00:00.000000000 Z
34
+ date: 2017-11-02 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: aws-sdk-core
metadata.gz.sig CHANGED
Binary file