From e232e9f405cd1560fe03262538f1752e1e529bdc Mon Sep 17 00:00:00 2001 From: aeris Date: Tue, 11 Apr 2017 13:30:55 +0200 Subject: [PATCH] Better with YAML --- app/controllers/check_controller.rb | 8 +- config/host.dump | Bin 10772 -> 0 bytes config/host.yml | 637 ++++++++++++++++++++++++++++ 3 files changed, 641 insertions(+), 4 deletions(-) delete mode 100644 config/host.dump create mode 100644 config/host.yml diff --git a/app/controllers/check_controller.rb b/app/controllers/check_controller.rb index 9a4fdfa..0f3c337 100644 --- a/app/controllers/check_controller.rb +++ b/app/controllers/check_controller.rb @@ -60,9 +60,9 @@ class CheckController < ApplicationController end @port = @port.to_i if @port - # @result = Datastore.host self.type, @host, @port - file = File.join Rails.root, 'config/host.dump' - # open(file, 'wb') { |f| f.write Marshal.dump @result } - @result = Marshal.load File.read file + #@result = Datastore.host self.type, @host, @port + file = File.join Rails.root, 'config/host.yml' + #File.write file, YAML.dump(@result) + @result = YAML.load File.read file end end diff --git a/config/host.dump b/config/host.dump deleted file mode 100644 index 87df074cfc7bd3a9e740e31e3cf66e4a5c8ffbc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10772 zcmeHNOK;mo5Vnm#mTcLMorj%g108yE!uLZ&4zA)h0-B_V?Vx}U>T8y?SBOZl2(<;uCu?VWb-3-fz|!>UzU{`QZ*#9xGee*O2yoqDx2A0oO( z!km%Yt{79tv(?f<-3vk&H3@60mKGZxMh(^$(*@t7(NAaQ=jm!`j`akrYd6Ojz~TcK z%sPI;nHSWD9Q^ZLIWN_bYXx<*Pa^h=`68@`2~DrJP%RaMRb@(YJM_hIx;f98xr zdgN8xarX%IspBRvY$_6O3YLfw$JqoaM71^BRtT0&EQqFph=N5;L`c&GY^#V^P0@fJyRK8NebaoMh7_~y<-ooBYYp>P7NzsD%6_2Kc!?~@~@L}m*BTp>L2BP%H9 zX@GzZoHr5e%uHRWmb&a$Hx*4%36V6w3z@des}?p*UKS)xQcTH~iKX$XfH)h88jMzL zTa`s!;YptCN;G`sEA_ zVIoa00?nrzKH`>Vtvb_C>`wV%uosXfBXDP15CzrLZH?D;9%&NKA%)jDT~ZZU<&gL0&TL*ki z7)pAWJr@Lx1A$Ft8(@UkCOQqd7&Zc6%_aSv#tf#OjEDjuup8O7i`en&gvR?@W(E(Y zoY|iN4p=xjN$)>-y1D*xYh!(5bBh*{t#{r=W^Z(BIST`7m@3^M@_HQZYa2| zMii5vbDq3z=M+HYtvG z?bGn~cH}W3Y+M}?USlZ@?Wf?nW5G5Zr~%Y=pcb{{E8$e29v8mweKUH12C*_Izr765 z$5SH)Xom8c2k6n=cR3C0Wn_j=j3IDMN9F|A%gB8GN!3^)^R3Ow>2tS7T2(F({Ned? zCbhcs+$0U}nKF+B-Mih;?c=-G#*#OW4(^4_ssO>WMK|la15VuYg7zYwxMz-R)^8JJ z`((@K1@1~Zotn8IdGeW~``}bm9(ZwOj0xdUzlSd7_ijIg$8uGbMVR?-g7De<@W=>% zay~p5;c96mzKX5|Ehl;YiJu=jFWlLM^m2MEOY3&w%o}V0{bPKevpvhY+r4*|H5-w> z70%m5nHSDg zZ`IO`==`qvl-PvA!+Z3Eyt`uDGj1CXjL(c!F{uZbf-5s{?%X?B2Vz-~YbZ PQ3qH!sl)79m&yGHj=t5Y diff --git a/config/host.yml b/config/host.yml new file mode 100644 index 0000000..afe5745 --- /dev/null +++ b/config/host.yml @@ -0,0 +1,637 @@ +--- !ruby/hash:BSON::Document +_id: !ruby/object:BSON::ObjectId + raw_data: !binary |- + WOvwM8My+sn9rVVo +target: !ruby/hash:BSON::Document + hostname: localhost + port: 443 +hosts: +- !ruby/hash:BSON::Document + hostname: localhost + ip: 127.0.0.1 + port: 443 + handshakes: !ruby/hash:BSON::Document + certs: + - !ruby/hash:BSON::Document + subject: "/O=imirhil.fr/CN=aeris.imirhil.fr" + serial: '4' + issuer: "/O=imirhil.fr/CN=CA" + lifetime: !ruby/hash:BSON::Document + not_before: 2011-07-03 00:00:00.000000000 Z + not_after: 2021-06-11 23:59:59.000000000 Z + fingerprint: 641b2d3ca00fea6e7f8ff6ec5bc23b6ae6c383aa892cf7a064004ffc7d681de1 + chain: + - !ruby/hash:BSON::Document + subject: "/O=imirhil.fr/CN=aeris.imirhil.fr" + serial: '4' + issuer: "/O=imirhil.fr/CN=CA" + fingerprint: 641b2d3ca00fea6e7f8ff6ec5bc23b6ae6c383aa892cf7a064004ffc7d681de1 + lifetime: !ruby/hash:BSON::Document + not_before: 2011-07-03 00:00:00.000000000 Z + not_after: 2021-06-11 23:59:59.000000000 Z + key: !ruby/hash:BSON::Document + type: :rsa + size: 1024 + fingerprint: 9b6847ee48892abf517dcbb1524846b4f5ed8172a0fa389b67ff7539319f0c8f + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + rsa: false + error: !ruby/hash:BSON::Document + rsa: true + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + mdc2_sign: false + md2_sign: false + md4_sign: false + md5_sign: false + sha_sign: false + sha1_sign: false + rsa: false + error: !ruby/hash:BSON::Document + rsa: true + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + dh: + - !ruby/hash:BSON::Document + size: 1024 + fingerprint: 2a85a641f2327b9f81991a8410a61909476571abde10c6d41031b76397a955f9 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dh: false + error: !ruby/hash:BSON::Document + dh: true + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + protocols: + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + sslv2: false + sslv3: false + error: !ruby/hash:BSON::Document + tlsv1_0: false + warning: !ruby/hash:BSON::Document + tlsv1_1: false + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + ciphers: + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: DHE-RSA-AES128-GCM-SHA256 + key_exchange: :dh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :gcm + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha256 + size: 256 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: true + good: !ruby/hash:BSON::Document + aead: true + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: DHE-RSA-AES128-SHA + key_exchange: :dh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha1 + size: 160 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: true + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: DHE-RSA-AES128-SHA256 + key_exchange: :dh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha256 + size: 256 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: true + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: DHE-RSA-AES256-GCM-SHA384 + key_exchange: :dh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :gcm + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha384 + size: 384 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: true + good: !ruby/hash:BSON::Document + aead: true + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: DHE-RSA-AES256-SHA + key_exchange: :dh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha1 + size: 160 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: true + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: DHE-RSA-AES256-SHA256 + key_exchange: :dh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha256 + size: 256 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: true + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: ECDHE-RSA-AES128-SHA + key_exchange: :ecdh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha1 + size: 160 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: false + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: ECDHE-RSA-AES128-SHA256 + key_exchange: :ecdh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha256 + size: 256 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: false + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: ECDHE-RSA-AES256-SHA + key_exchange: :ecdh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha1 + size: 160 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: false + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: ECDHE-RSA-AES256-SHA384 + key_exchange: :ecdh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :cbc + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha384 + size: 384 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: false + good: !ruby/hash:BSON::Document + aead: false + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: ECDHE-RSA-AES128-GCM-SHA256 + key_exchange: :ecdh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :gcm + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha256 + size: 256 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: false + good: !ruby/hash:BSON::Document + aead: true + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + name: ECDHE-RSA-AES256-GCM-SHA384 + key_exchange: :ecdh + authentication: :rsa + encryption: !ruby/hash:BSON::Document + name: :aes + mode: :gcm + block_size: 128 + hmac: !ruby/hash:BSON::Document + name: :sha384 + size: 384 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + pfs: false + warning: !ruby/hash:BSON::Document + dhe: false + good: !ruby/hash:BSON::Document + aead: true + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + cipher_suites: + - !ruby/hash:BSON::Document + protocol: :TLSv1_2 + cipher_suite: + - ECDHE-RSA-AES256-GCM-SHA384 + - ECDHE-RSA-AES256-SHA384 + - ECDHE-RSA-AES256-SHA + - ECDHE-RSA-AES128-GCM-SHA256 + - ECDHE-RSA-AES128-SHA256 + - ECDHE-RSA-AES128-SHA + - DHE-RSA-AES256-GCM-SHA384 + - DHE-RSA-AES256-SHA256 + - DHE-RSA-AES256-SHA + - DHE-RSA-AES128-GCM-SHA256 + - DHE-RSA-AES128-SHA256 + - DHE-RSA-AES128-SHA + curves: + - !ruby/hash:BSON::Document + name: :secp256k1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :sect283k1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :sect283r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :secp384r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :sect409k1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :sect409r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :secp521r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :sect571k1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :sect571r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :prime256v1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :brainpoolP256r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :brainpoolP384r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + - !ruby/hash:BSON::Document + name: :brainpoolP512r1 + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document {} + error: !ruby/hash:BSON::Document {} + warning: !ruby/hash:BSON::Document {} + good: !ruby/hash:BSON::Document {} + great: !ruby/hash:BSON::Document {} + best: !ruby/hash:BSON::Document {} + curve_preference: + - :prime256v1 + - :secp521r1 + - :brainpoolP512r1 + - :brainpoolP384r1 + - :secp384r1 + - :brainpoolP256r1 + - :secp256k1 + - :sect571r1 + - :sect571k1 + - :sect409k1 + - :sect409r1 + - :sect283k1 + - :sect283r1 + fallback_scsv: + hsts: + states: !ruby/hash:BSON::Document + critical: !ruby/hash:BSON::Document + mdc2_sign: false + md2_sign: false + md4_sign: false + md5_sign: false + sha_sign: false + sha1_sign: false + rsa: false + dh: false + sslv2: false + sslv3: false + dss: false + anonymous: false + 'null': false + export: false + des: false + md5: false + rc4: false + sweet32: false + error: !ruby/hash:BSON::Document + rsa: true + dh: true + tlsv1_0: false + pfs: false + warning: !ruby/hash:BSON::Document + hsts: true + tlsv1_1: false + dhe: true + good: !ruby/hash:BSON::Document + fallback_scsv: + hsts: false + aead: true + great: !ruby/hash:BSON::Document + hsts: false + best: !ruby/hash:BSON::Document {} + grade: :V +date: 2017-04-11 11:29:21.505000000 Z +host: localhost +port: