vagrant-ca-certificates 1.0.2 → 1.1.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -0
- data/LICENSE +1 -3
- data/README.md +20 -25
- data/certs/jbellone.pem +15 -15
- data/lib/vagrant-ca-certificates/cap/coreos/certificate_file_bundle.rb +13 -0
- data/lib/vagrant-ca-certificates/cap/coreos/certificate_upload_path.rb +13 -0
- data/lib/vagrant-ca-certificates/cap/coreos/update_certificate_bundle.rb +20 -0
- data/lib/vagrant-ca-certificates/cap/redhat/helpers.rb +1 -1
- data/lib/vagrant-ca-certificates/cap/redhat/update_certificate_bundle.rb +7 -1
- data/lib/vagrant-ca-certificates/plugin.rb +15 -0
- data/lib/vagrant-ca-certificates/version.rb +1 -1
- data/spec/unit/vagrant-ca-certificates/cap/coreos/certificate_upload_path_spec.rb +5 -0
- data/spec/unit/vagrant-ca-certificates/cap/coreos/update_certificate_bundle_spec.rb +5 -0
- data/vagrant-ca-certificates.gemspec +0 -1
- metadata +25 -31
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b6271d128268faabaeded4ede2afd02b0d2bdb4
|
4
|
+
data.tar.gz: 699aa70efd0dc0722e6e544f02f8dbf7f52b0143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3d9f2fb13cecfe45fa40e30baa2c9580a23bd790ef61818348138cf0107715d213422689e262a7d2f7df5d5bf8362173040585ae158eb771696735820312131
|
7
|
+
data.tar.gz: 7a7716c95dd4623f05fa0c6bc290f2b0777d89059271904d202d7ceee68c584e78182455cf32551617facb246d360b29a426abab866aa28755724e65884873c0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.gitignore
CHANGED
data/LICENSE
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright
|
4
|
-
Copyright (c) 2014, 2015 John Bellone (<jbellone@bloomberg.net>)
|
5
|
-
Copyright (c) 2014, 2015 Bloomberg Finance L.P.
|
3
|
+
Copyright 2014-2016, Bloomberg Finance L.P.
|
6
4
|
|
7
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
# CA Certificate Plugin for Vagrant
|
2
|
-
<span class="badges">
|
3
2
|

|
4
3
|

|
5
4
|

|
6
|
-
</span>
|
7
5
|
|
8
|
-
A [Vagrant][4] plugin which configures the virtual machine to inject
|
9
|
-
specified certificates into the guest's root bundle. This is
|
10
|
-
if your enterprise network has a firewall (or
|
11
|
-
[SSL interception][5].
|
6
|
+
A [Vagrant][4] plugin which configures the virtual machine to inject
|
7
|
+
the specified certificates into the guest's root bundle. This is
|
8
|
+
useful, for example, if your enterprise network has a firewall (or
|
9
|
+
appliance) which utilizes [SSL interception][5].
|
12
10
|
|
13
11
|
_Warning:_ This plugin adds certificates to the guest operating
|
14
|
-
system's [root certificate bundle][6]. You should only use this if you
|
15
|
-
*exactly* what you are doing. This should *never* be used on a
|
12
|
+
system's [root certificate bundle][6]. You should only use this if you
|
13
|
+
know *exactly* what you are doing. This should *never* be used on a
|
16
14
|
production machine.
|
17
15
|
|
18
16
|
## Installation
|
@@ -42,23 +40,20 @@ both the proxies and inject in our new certificate bundles.
|
|
42
40
|
|
43
41
|
If you're following the complete tutorial here we're going to save
|
44
42
|
this file in a newly created directory
|
45
|
-
`~/.
|
43
|
+
`~/.vagrant.d/Vagrantfile`. This will be merged into the final
|
46
44
|
Vagrantfile configuration that the test-kitchen run will use to
|
47
45
|
provision a new instance.
|
48
46
|
```ruby
|
49
|
-
# These are requirements for this base Vagrantfile. If they are not
|
50
|
-
# installed there will be a warning message with Vagrant/test-kitchen.
|
51
|
-
%w(vagrant-ca-certificates vagrant-proxyconf).each do |name|
|
52
|
-
fail "Please install the '#{name}' plugin!" unless Vagrant.has_plugin?(name)
|
53
|
-
end
|
54
|
-
|
55
47
|
Vagrant.configure('2') do |config|
|
56
|
-
config.proxy.enabled = true
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
48
|
+
config.proxy.enabled = true if Vagrant.has_plugin?('vagrant-proxyconf')
|
49
|
+
|
50
|
+
if Vagrant.has_plugin?('vagrant-ca-certificates')
|
51
|
+
config.ca_certificates.enabled = true
|
52
|
+
config.ca_certificates.certs = [
|
53
|
+
'/etc/pki/ca-trust/source/anchors/root.crt',
|
54
|
+
'/etc/pki/ca-trust/source/anchors/sub.crt'
|
55
|
+
]
|
56
|
+
end
|
62
57
|
end
|
63
58
|
```
|
64
59
|
### Writing a .kitchen.local.yml
|
@@ -77,8 +72,6 @@ test-kitchen runs for this user (on this host machine).
|
|
77
72
|
---
|
78
73
|
driver:
|
79
74
|
provision: true
|
80
|
-
vagrantfiles:
|
81
|
-
- "/home/jbellone/.kitchen/Vagrantfile"
|
82
75
|
http_proxy: "http://proxy.corporate.com:80"
|
83
76
|
https_proxy: "http://proxy.corporate.com:80"
|
84
77
|
ftp_proxy: "http://proxy.corporate.com:80"
|
@@ -93,8 +86,10 @@ the specified certificates.
|
|
93
86
|
|
94
87
|
```ruby
|
95
88
|
Vagrant.configure('2') do |config|
|
96
|
-
|
97
|
-
|
89
|
+
if Vagrant.has_plugin?('vagrant-ca-certificates')
|
90
|
+
config.ca_certificates.enabled = true
|
91
|
+
config.ca_certificates.certs = Dir.glob('/etc/pki/ca-trust/source/anchors/*.crt')
|
92
|
+
end
|
98
93
|
end
|
99
94
|
```
|
100
95
|
### System Wide
|
data/certs/jbellone.pem
CHANG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|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
MA0GCSqGSIb3DQEBBQUAA4IBAQBHzDpoIdfVZIavF0uJjG4dW47HvXBmOSC0n5Zf
|
16
|
+
FjXJ47as6U+ynNRlFvpFFytTRcO2jEPohGAmO65IXQYb2SEWlMaB6vaunqvi0BZN
|
17
|
+
qCfkC6g4qimHOo9JUsQ88skOXkpGx5dM+ycTr53OhLLlludTXj7CUrXEEs0Ds1H/
|
18
|
+
afxF46lNt1TGfyd1NVgDbjQ1QnBno0thcnCCiWPGy9/qk9ZLqa8UlsbKyVjLJTKX
|
19
|
+
+0r315TUT0v4D2npGY965XWSB39BXVqK3AOzHACU/bSVSN/6vnUOgaigSMz1x9tl
|
20
|
+
tH/pmY+pJ/jAXtK2qBNffivjLiKv4y3nYcLrxdmENe3gBt6A
|
21
21
|
-----END CERTIFICATE-----
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module CaCertificates
|
3
|
+
module Cap
|
4
|
+
module CoreOS
|
5
|
+
# Capability for configuring the certificate bundle on CoreOS.
|
6
|
+
module UpdateCertificateBundle
|
7
|
+
def self.update_certificate_bundle(m)
|
8
|
+
m.communicate.sudo("ls /etc/ssl/certs | awk '{print \"private/\"$1;}' >> /etc/ca-certificates.conf") # enable our custom certs
|
9
|
+
m.communicate.sudo('update-ca-certificates') do |type, data|
|
10
|
+
if [:stderr, :stdout].include?(type)
|
11
|
+
next if data =~ /stdin: is not a tty/
|
12
|
+
m.env.ui.info data
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -7,7 +7,7 @@ module VagrantPlugins
|
|
7
7
|
# bundles must be managed manually.
|
8
8
|
def self.legacy_certificate_bundle?(sh)
|
9
9
|
command = %q(R=$(sed -E "s/.* ([0-9])\.([0-9]+) .*/\\1.\\2/" /etc/redhat-release))
|
10
|
-
sh.test(%Q(#{command} && [[ $R =~ ^5 || $R =~ ^6\.[0-4]+ ]]), shell: '/bin/bash') || !sh.test("rpm -q
|
10
|
+
sh.test(%Q(#{command} && [[ $R =~ ^5 || $R =~ ^6\.[0-4]+ ]]), shell: '/bin/bash') || !sh.test("rpm -q ca-certificates", shell:'/bin/bash')
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -9,7 +9,13 @@ module VagrantPlugins
|
|
9
9
|
def self.update_certificate_bundle(m)
|
10
10
|
m.communicate.tap do |sh|
|
11
11
|
if Redhat.legacy_certificate_bundle?(sh)
|
12
|
-
sh.sudo(
|
12
|
+
sh.sudo(<<-SCRIPT)
|
13
|
+
BUNDLE=/etc/pki/tls/certs/ca-bundle.crt;
|
14
|
+
PRIVATE=/etc/pki/tls/ca.private.crt;
|
15
|
+
if ! [ "$(readlink $BUNDLE)" == "$PRIVATE" ]; then
|
16
|
+
find /etc/pki/tls/private -type f -exec cat {} \\; | cat $BUNDLE - > $PRIVATE ;
|
17
|
+
fi
|
18
|
+
SCRIPT
|
13
19
|
sh.sudo('/bin/ln -fsn /etc/pki/tls/ca.private.crt /etc/pki/tls/cert.pem')
|
14
20
|
sh.sudo('/bin/ln -fsn /etc/pki/tls/ca.private.crt /etc/pki/tls/certs/ca-bundle.crt')
|
15
21
|
sh.execute(<<-SCRIPT, shell: '/bin/bash', sudo: true)
|
@@ -34,6 +34,11 @@ module VagrantPlugins
|
|
34
34
|
Cap::Redhat::UpdateCertificateBundle
|
35
35
|
end
|
36
36
|
|
37
|
+
guest_capability('coreos', 'update_certificate_bundle') do
|
38
|
+
require_relative 'cap/coreos/update_certificate_bundle'
|
39
|
+
Cap::CoreOS::UpdateCertificateBundle
|
40
|
+
end
|
41
|
+
|
37
42
|
guest_capability('debian', 'certificate_upload_path') do
|
38
43
|
require_relative 'cap/debian/certificate_upload_path'
|
39
44
|
Cap::Debian::CertificateUploadPath
|
@@ -44,6 +49,11 @@ module VagrantPlugins
|
|
44
49
|
Cap::Redhat::CertificateUploadPath
|
45
50
|
end
|
46
51
|
|
52
|
+
guest_capability('coreos', 'certificate_upload_path') do
|
53
|
+
require_relative 'cap/coreos/certificate_upload_path'
|
54
|
+
Cap::CoreOS::CertificateUploadPath
|
55
|
+
end
|
56
|
+
|
47
57
|
guest_capability('debian', 'certificate_file_bundle') do
|
48
58
|
require_relative 'cap/debian/certificate_file_bundle'
|
49
59
|
Cap::Debian::CertificateFileBundle
|
@@ -53,6 +63,11 @@ module VagrantPlugins
|
|
53
63
|
require_relative 'cap/redhat/certificate_file_bundle'
|
54
64
|
Cap::Redhat::CertificateFileBundle
|
55
65
|
end
|
66
|
+
|
67
|
+
guest_capability('coreos', 'certificate_file_bundle') do
|
68
|
+
require_relative 'cap/coreos/certificate_file_bundle'
|
69
|
+
Cap::CoreOS::CertificateFileBundle
|
70
|
+
end
|
56
71
|
end
|
57
72
|
end
|
58
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-ca-certificates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Bailey
|
@@ -13,25 +13,25 @@ cert_chain:
|
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
14
|
MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMREwDwYDVQQDDAhqYmVs
|
15
15
|
bG9uZTEZMBcGCgmSJomT8ixkARkWCWJsb29tYmVyZzETMBEGCgmSJomT8ixkARkW
|
16
|
-
|
16
|
+
A25ldDAeFw0xNjAzMjUxNTE3MDBaFw0xNzAzMjUxNTE3MDBaMEMxETAPBgNVBAMM
|
17
17
|
CGpiZWxsb25lMRkwFwYKCZImiZPyLGQBGRYJYmxvb21iZXJnMRMwEQYKCZImiZPy
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|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N/6vnUOgaigSMz1x9tl
|
32
|
+
tH/pmY+pJ/jAXtK2qBNffivjLiKv4y3nYcLrxdmENe3gBt6A
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
@@ -47,20 +47,6 @@ dependencies:
|
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '1.7'
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: rake
|
52
|
-
requirement: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '0'
|
57
|
-
type: :development
|
58
|
-
prerelease: false
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - ">="
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0'
|
64
50
|
description: |2
|
65
51
|
A Vagrant plugin that installs CA certificates onto the virtual machine.
|
66
52
|
This is useful, for example, in the case where you are behind a corporate proxy
|
@@ -83,6 +69,9 @@ files:
|
|
83
69
|
- certs/jbellone.pem
|
84
70
|
- lib/vagrant-ca-certificates.rb
|
85
71
|
- lib/vagrant-ca-certificates/action/install_certificates.rb
|
72
|
+
- lib/vagrant-ca-certificates/cap/coreos/certificate_file_bundle.rb
|
73
|
+
- lib/vagrant-ca-certificates/cap/coreos/certificate_upload_path.rb
|
74
|
+
- lib/vagrant-ca-certificates/cap/coreos/update_certificate_bundle.rb
|
86
75
|
- lib/vagrant-ca-certificates/cap/debian/certificate_file_bundle.rb
|
87
76
|
- lib/vagrant-ca-certificates/cap/debian/certificate_upload_path.rb
|
88
77
|
- lib/vagrant-ca-certificates/cap/debian/update_certificate_bundle.rb
|
@@ -96,6 +85,8 @@ files:
|
|
96
85
|
- locales/en.yml
|
97
86
|
- spec/spec_helper.rb
|
98
87
|
- spec/unit/vagrant-ca-certificates/action/install_certificates_spec.rb
|
88
|
+
- spec/unit/vagrant-ca-certificates/cap/coreos/certificate_upload_path_spec.rb
|
89
|
+
- spec/unit/vagrant-ca-certificates/cap/coreos/update_certificate_bundle_spec.rb
|
99
90
|
- spec/unit/vagrant-ca-certificates/cap/debian/certificate_upload_path_spec.rb
|
100
91
|
- spec/unit/vagrant-ca-certificates/cap/debian/update_certificate_bundle_spec.rb
|
101
92
|
- spec/unit/vagrant-ca-certificates/cap/redhat/certificate_upload_path_spec.rb
|
@@ -129,8 +120,11 @@ summary: A Vagrant plugin that installs CA certificates onto the virtual machine
|
|
129
120
|
test_files:
|
130
121
|
- spec/spec_helper.rb
|
131
122
|
- spec/unit/vagrant-ca-certificates/action/install_certificates_spec.rb
|
123
|
+
- spec/unit/vagrant-ca-certificates/cap/coreos/certificate_upload_path_spec.rb
|
124
|
+
- spec/unit/vagrant-ca-certificates/cap/coreos/update_certificate_bundle_spec.rb
|
132
125
|
- spec/unit/vagrant-ca-certificates/cap/debian/certificate_upload_path_spec.rb
|
133
126
|
- spec/unit/vagrant-ca-certificates/cap/debian/update_certificate_bundle_spec.rb
|
134
127
|
- spec/unit/vagrant-ca-certificates/cap/redhat/certificate_upload_path_spec.rb
|
135
128
|
- spec/unit/vagrant-ca-certificates/cap/redhat/update_certificate_bundle_spec.rb
|
136
129
|
- spec/unit/vagrant-ca-certificates/config_spec.rb
|
130
|
+
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|