Class: CfnVpn::Actions::Revoke
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- CfnVpn::Actions::Revoke
- Includes:
- Thor::Actions
- Defined in:
- lib/cfnvpn/actions/revoke.rb
Class Method Summary collapse
Instance Method Summary collapse
- #apply_rekocation_list ⇒ Object
- #revoke_certificate ⇒ Object
- #set_directory ⇒ Object
- #set_loglevel ⇒ Object
Class Method Details
.source_root ⇒ Object
21 22 23 |
# File 'lib/cfnvpn/actions/revoke.rb', line 21 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#apply_rekocation_list ⇒ Object
43 44 45 46 47 |
# File 'lib/cfnvpn/actions/revoke.rb', line 43 def apply_rekocation_list vpn = CfnVpn::ClientVpn.new(@name,@options['region']) vpn.put_revoke_list("#{@cert_dir}/crl.pem") CfnVpn::Log.logger.info("revoked client #{@options['client_cn']} from #{vpn.endpoint_id}") end |
#revoke_certificate ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/cfnvpn/actions/revoke.rb', line 34 def revoke_certificate cert = CfnVpn::Certificates.new(@build_dir,@name,@options['easyrsa_local']) s3 = CfnVpn::S3.new(@options['region'],@options['bucket'],@name) s3.get_object("#{@cert_dir}/ca.tar.gz") s3.get_object("#{@cert_dir}/#{@options['client_cn']}.tar.gz") CfnVpn::Log.logger.info "Generating new client certificate #{@options['client_cn']} using openvpn easy-rsa" CfnVpn::Log.logger.debug cert.revoke_client(@options['client_cn']) end |
#set_directory ⇒ Object
29 30 31 32 |
# File 'lib/cfnvpn/actions/revoke.rb', line 29 def set_directory @build_dir = "#{CfnVpn.cfnvpn_path}/#{@name}" @cert_dir = "#{@build_dir}/certificates" end |