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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 150d5c310df91f38fb0136841949f85cacfb5e3cce61dde33b6a5d8e5835c6c5
4
- data.tar.gz: 491ec001fe6e315be750c19003eeb18d3b2fd63a03630477a89531f8454f8938
3
+ metadata.gz: 6de2cee8e97ac8192d0b8e6016b7dafc792b9390a7e92ceb7424e196b84ad93d
4
+ data.tar.gz: 246b593793480b838261ccd08578755b558b2c9e6f504d8752eaad2a7f35a71c
5
5
  SHA512:
6
- metadata.gz: 3bc9a43cd62eeb967b52589cfe7e816313cd4d260065e5a17317f1d19e9b9b8afc5d00279800854f0c4f8d319b8d7febf2b0a0ec3f7f79cea0bdbc2853cf16d6
7
- data.tar.gz: 0d10b220d8fbfb78f53ab0b0f3e0f586f0214b759a7ba6f605b8b8a05c4eeebb718b91618128e2414dd7c2b31792224287363836d5820717718ed5347e6b73fd
6
+ metadata.gz: 263267e258bf0bf399b36ac62582fe6750ec9f08054dd4e91d06dc2812d5d9f7fcd421bd21c5feb6c412a1ff07aad9e8919da87395231538faf876273b731ac3
7
+ data.tar.gz: cb323bf1459d72ce0e2110b822a0d79c0855e2b9932b02cc6fe84efae0c59b333427954367b57507107e86ce0e2b7e6a6375c8b5ae5e20cda23130cc92c67760
data/Dockerfile CHANGED
@@ -9,7 +9,7 @@ RUN apt-get update -qq \
9
9
  ENV EASYRSA=/usr/share/easy-rsa
10
10
  ENV EASYRSA_BATCH=yes
11
11
 
12
- ARG CFNVPN_VERSION="1.8.0"
12
+ ARG CFNVPN_VERSION="1.10.0"
13
13
 
14
14
  COPY . /src
15
15
 
@@ -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 with the default options
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 and #{@client_cn} certificates with a new CA"
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(@options['server_cn'],@options['certificate_expiry'])
80
+ cert.generate_ca(@config[:server_cn],nil,@options['certificate_expiry'])
81
81
  end
82
82
  end
83
83
 
@@ -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
- system("easyrsa #{opts} build-client-full #{client_cn} nopass")
44
- 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)
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)
@@ -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]
@@ -1,4 +1,4 @@
1
1
  module CfnVpn
2
- VERSION = "1.8.0".freeze
2
+ VERSION = "1.10.0".freeze
3
3
  CHANGE_SET_VERSION = VERSION.gsub('.', '-').freeze
4
4
  end
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.8.0
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-08-21 00:00:00.000000000 Z
11
+ date: 2026-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor