cfn-vpn 1.8.0 → 1.10.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
- data/Dockerfile +1 -1
- data/docs/certificate-renewal.md +10 -2
- data/lib/cfnvpn/actions/renew_certificate.rb +2 -2
- data/lib/cfnvpn/certificates.rb +11 -2
- data/lib/cfnvpn/templates/vpn.rb +5 -0
- data/lib/cfnvpn/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: 6de2cee8e97ac8192d0b8e6016b7dafc792b9390a7e92ceb7424e196b84ad93d
|
|
4
|
+
data.tar.gz: 246b593793480b838261ccd08578755b558b2c9e6f504d8752eaad2a7f35a71c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 263267e258bf0bf399b36ac62582fe6750ec9f08054dd4e91d06dc2812d5d9f7fcd421bd21c5feb6c412a1ff07aad9e8919da87395231538faf876273b731ac3
|
|
7
|
+
data.tar.gz: cb323bf1459d72ce0e2110b822a0d79c0855e2b9932b02cc6fe84efae0c59b333427954367b57507107e86ce0e2b7e6a6375c8b5ae5e20cda23130cc92c67760
|
data/Dockerfile
CHANGED
data/docs/certificate-renewal.md
CHANGED
|
@@ -56,10 +56,18 @@ remote kdipkcte.cvpn-endpoint-<replace-id>.prod.clientvpn.<aws-region>.amazonaws
|
|
|
56
56
|
|
|
57
57
|
## VPNs Using Federated Access
|
|
58
58
|
|
|
59
|
-
run the renew command
|
|
59
|
+
run the renew command using your local easyrsa
|
|
60
60
|
|
|
61
61
|
```sh
|
|
62
|
-
cfn-vpn renew [name] --bucket [s3-bucket]
|
|
62
|
+
cfn-vpn renew [name] --bucket [s3-bucket] --easyrsa-local
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The `--easyrsa-local` flag is required, the docker image scripts expect a client certificate common name which federated VPNs don't have.
|
|
66
|
+
|
|
67
|
+
easyrsa will prompt for confirmation while creating the new CA, set `EASYRSA_BATCH=1` for unattended runs
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
EASYRSA_BATCH=1 cfn-vpn renew [name] --bucket [s3-bucket] --easyrsa-local
|
|
63
71
|
```
|
|
64
72
|
|
|
65
73
|
This will recreate the vpn with the updated server certificate.
|
|
@@ -75,9 +75,9 @@ module CfnVpn::Actions
|
|
|
75
75
|
cert.renew(@config[:server_cn],@client_cn,@options['certificate_expiry'])
|
|
76
76
|
end
|
|
77
77
|
else
|
|
78
|
-
CfnVpn::Log.logger.info "recreating server
|
|
78
|
+
CfnVpn::Log.logger.info "recreating server certificate with a new CA"
|
|
79
79
|
cert = CfnVpn::Certificates.new(@build_dir,@name,@options['easyrsa_local'])
|
|
80
|
-
cert.generate_ca(@
|
|
80
|
+
cert.generate_ca(@config[:server_cn],nil,@options['certificate_expiry'])
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
data/lib/cfnvpn/certificates.rb
CHANGED
|
@@ -39,9 +39,16 @@ module CfnVpn
|
|
|
39
39
|
ENV["EASYRSA_PKI"] = @pki_dir
|
|
40
40
|
system("easyrsa init-pki")
|
|
41
41
|
system("easyrsa build-ca nopass")
|
|
42
|
+
# easyrsa 3.1+ rejects build-*-full while an external commonName is set
|
|
43
|
+
ENV.delete("EASYRSA_REQ_CN")
|
|
42
44
|
system("easyrsa #{opts} build-server-full server nopass")
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
certs = ["#{@pki_dir}/ca.crt", "#{@pki_dir}/issued/server.crt", "#{@pki_dir}/private/server.key"]
|
|
46
|
+
# federated vpns only need the server certificate
|
|
47
|
+
unless client_cn.nil?
|
|
48
|
+
system("easyrsa #{opts} build-client-full #{client_cn} nopass")
|
|
49
|
+
certs.push("#{@pki_dir}/issued/#{client_cn}.crt", "#{@pki_dir}/private/#{client_cn}.key")
|
|
50
|
+
end
|
|
51
|
+
FileUtils.cp(certs, @cert_dir)
|
|
45
52
|
system("tar czfv #{@cert_dir}/ca.tar.gz -C #{@build_dir} pki/")
|
|
46
53
|
else
|
|
47
54
|
@docker_cmd << "-e EASYRSA_REQ_CN=#{server_cn}"
|
|
@@ -119,6 +126,8 @@ module CfnVpn
|
|
|
119
126
|
FileUtils.mv("#{@pki_dir}/issued/#{client_cn}.crt", "#{@pki_dir}/issued/#{client_cn}.req.bak-#{timestamp}")
|
|
120
127
|
FileUtils.mv("#{@pki_dir}/private/#{client_cn}.key", "#{@pki_dir}/private/#{client_cn}.req.bak-#{timestamp}")
|
|
121
128
|
|
|
129
|
+
# easyrsa 3.1+ rejects build-*-full while an external commonName is set
|
|
130
|
+
ENV.delete("EASYRSA_REQ_CN")
|
|
122
131
|
system("easyrsa #{opts} build-server-full server nopass")
|
|
123
132
|
system("easyrsa #{opts} build-client-full #{client_cn} nopass")
|
|
124
133
|
FileUtils.cp(["#{@pki_dir}/ca.crt", "#{@pki_dir}/issued/server.crt", "#{@pki_dir}/private/server.key", "#{@pki_dir}/issued/#{client_cn}.crt", "#{@pki_dir}/private/#{client_cn}.key"], @cert_dir)
|
data/lib/cfnvpn/templates/vpn.rb
CHANGED
|
@@ -203,7 +203,12 @@ module CfnVpn
|
|
|
203
203
|
|
|
204
204
|
elsif route.has_key?(:cidr)
|
|
205
205
|
target_subnets.each do |subnet|
|
|
206
|
+
# routes are tied to the subnet association: aws deletes them when the
|
|
207
|
+
# target network is disassociated, so they must be conditioned on the
|
|
208
|
+
# association to stay in sync with it.
|
|
206
209
|
EC2_ClientVpnRoute(:"#{route[:cidr].resource_safe}VpnRouteTo#{subnet.resource_safe}"[0..255]) {
|
|
210
|
+
Condition(:EnableSubnetAssociation)
|
|
211
|
+
DependsOn network_assoc_dependson if network_assoc_dependson.any?
|
|
207
212
|
Description "cfnvpn static route for #{route[:cidr]}. #{route[:desc]}".strip
|
|
208
213
|
ClientVpnEndpointId Ref(:ClientVpnEndpoint)
|
|
209
214
|
DestinationCidrBlock route[:cidr]
|
data/lib/cfnvpn/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cfn-vpn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guslington
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|