From ab70e6f11d1ee57c10ddb8fd58c4a28f375fe87c Mon Sep 17 00:00:00 2001 From: pemontto Date: Fri, 18 Oct 2019 17:56:55 +0100 Subject: [PATCH] Add tests for SSL and and trial versions --- .kitchen.yml | 8 + files/certs/keystore-password.p12 | Bin 0 -> 3451 bytes files/certs/shared-store-no-password.p12 | Bin 0 -> 3451 bytes files/certs/truststore-password.p12 | Bin 0 -> 3451 bytes .../helpers/serverspec/spec_helper.rb | 1 + .../helpers/serverspec/xpack_upgrade_spec.rb | 14 +- test/integration/issue-test-trial | 1 + test/integration/issue-test-trial.yml | 46 +++++ test/integration/xpack-upgrade-trial | 1 + test/integration/xpack-upgrade-trial.yml | 177 ++++++++++++++++++ test/integration/xpack-upgrade.yml | 18 +- 11 files changed, 257 insertions(+), 9 deletions(-) create mode 100644 files/certs/keystore-password.p12 create mode 100644 files/certs/shared-store-no-password.p12 create mode 100644 files/certs/truststore-password.p12 create mode 120000 test/integration/issue-test-trial create mode 100644 test/integration/issue-test-trial.yml create mode 120000 test/integration/xpack-upgrade-trial create mode 100644 test/integration/xpack-upgrade-trial.yml diff --git a/.kitchen.yml b/.kitchen.yml index 953523e..66eb2f0 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -132,3 +132,11 @@ suites: provisioner: playbook: test/integration/issue-test.yml idempotency_test: false + - name: xpack-upgrade-trial + provisioner: + playbook: test/integration/xpack-upgrade-trial.yml + idempotency_test: false + - name: issue-test-trial + provisioner: + playbook: test/integration/issue-test-trial.yml + idempotency_test: false \ No newline at end of file diff --git a/files/certs/keystore-password.p12 b/files/certs/keystore-password.p12 new file mode 100644 index 0000000000000000000000000000000000000000..6a58eaac87a8d63f92f9a7fc59343acd46712949 GIT binary patch literal 3451 zcmY+EcQhN08io^MM4MI>6)UI}>8yAL2Iw78da2ZPv@1Fa|cfNC;_x-*HnzHSpxTE>*xRdLl^mW09&pcP^yG0K$LHv*v9pNJ984wnQxu9>i*;BeDVy$h<-24IK@bBQ00nK! zCw@W@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Cdv$@s-Z|Ermfu`5nogBFRwGDooKB#|vQTb}sdj9iF`O zvFqg24oeMDf2#vFIZYxx4ph zZs8+h_>{QUaNMPPro;-x1Z9->sV}8{=oP%A{%>A^`?ESM6}#Wv`-CU%^5~Yu2&T=2 zeY6Ofj)QAK)HB9E({6d7O`QGsxXr3!cs2xgx$NXQ(z#oDO`*4=o5W0Pi0)@Hw)HU% zLA}El8xqb)XeGH`69S~XT`?EEe^@t9`jFzMCBp673a8y=P2I>3iTliubX|h}^$#=n zk$hCr1@_6SfKi3lsQ~4$(I)=DY0!Sv$6$ATZ3`)) zCtw-c)`22kx(lqjwVCN1M^%aEQlzjYW44Xv*@ppauVZhpCUKWq_uJA?p^r*<{)ThFQUqoEsH?H`F&a?Rb*u*(4 zXD7}$?CAxb8Sfs`wbHzi|##X#1yXNXc&-chPb8x$400&9;ie3PKmG*gz?}KW|9!IQUCr6q OpWi^W6(BH>K>8P*ZdvgF literal 0 HcmV?d00001 diff --git a/files/certs/truststore-password.p12 b/files/certs/truststore-password.p12 new file mode 100644 index 0000000000000000000000000000000000000000..25d9aa4c6796acba288307fe2748178817819722 GIT binary patch literal 3451 zcmY+EXEYlQ+r|@;*wn5)N{tkWy?0A%)7oPHODM65+OewC47K-)RkNts2DK>~MXg#j zN@}*|)Av2^`#k6QaG&d(Yuq1yFf^4v5s(;$rh-Apgk!X0&ZvMSz(OF#u->LW2gkcP0AnzSi^duOl1xx%Bv>Kw1!~=)#XApI=C*M+Q-n z{h;hKqm-USE56Lx(s_Z2P?IRGQsw0imJV8q7GSfcl`>oDCs5iP5-M<77oOJokw;s( z{Px;AIX%yYGDVw)T;|X3Pf~V-FNcVpfQ~S*P`8QeTW8<3CH|uZAFYEqyDZbLzb>qwY@J*MrVj5I zTMQ>y2<1nG-oZK{I?-jBc)Dwj3)FXa)oxT>XCR7|T??w;{c_@a@&syLa=LN?PEdIx z(`+W9Jg;VBlH~X{@%u1hMWNEQbZnkS%|gs^9PH}pb!v6bT#BRtkX04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8W`>+N)wsK4trYyxxEVNS=W zj}Wf!aA)0tw)L_Gsz$f-A zDrtep%o=A*nK>k{OybU=b*;F^Peil-I(`10qi?uzfff!bxb`R9(?`XdTCW~-n)P&7 zckgZu83psRlZ7xYHR^!F>HDzSi64aJ4ApVBJo2X^15#}Ew~!xoix2{p-N}6YM{WlS zj8h+T*}H+^CTW^{avz4Z_{5E>8W>_(x#ynwu+{^=*E!v4tc6IEumKLY7ELNw8f<9I z)cku|vTeq=^&MPpsM!pUvsCSH*_)RE79Ae$J1D!PKi9Zf`lasGH7&%G-omq^@(*4o zSj0w^m43gE@_MEJvGl=+#-_@wsd#}_;gzYVv<0fGEZPbZ+NDfi{>u|+qk|5R!p?nQ z#I2$(q_G7?PFg2Bac`Rp5)Hoie{s3sd2nbHyoXf-wm});76!vozEzcNtQtLb$`rQ# zfQVi-{j{Di6JO}}0Qz@WS2A$Bp7(#J_c(&XA)6nW?=MS%oE&S*&PuWGZ zzHdonPKzU4uIC-wrvUDGL8G&L&KI>_#pSYD<^%}1&QCNwyea&-`e$#wmd|g!H%v|{ zi{Fm*dsnIxT~=SroG3NEuv|`wOLbP@&{}cCEjaZfAOZKeT+@72jyIjBjBRBHC1A=h z9vB$}45cO}Vg&<046*l)dTnJV8K uri.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE ) {|http| http.request(req) diff --git a/test/integration/helpers/serverspec/xpack_upgrade_spec.rb b/test/integration/helpers/serverspec/xpack_upgrade_spec.rb index 00fb0fc..abd2ff4 100644 --- a/test/integration/helpers/serverspec/xpack_upgrade_spec.rb +++ b/test/integration/helpers/serverspec/xpack_upgrade_spec.rb @@ -5,7 +5,11 @@ vars = JSON.parse(File.read('/tmp/vars.json')) es_api_url = "#{vars['es_api_scheme']}://localhost:#{vars['es_api_port']}" username = vars['es_api_basic_auth_username'] password = vars['es_api_basic_auth_password'] -es_security_api = "#{vars['es_security_api']}" +if vars['es_major_version'] == '7.x' + es_security_api = "_security" +else + es_security_api = "_xpack/security" +end shared_examples 'xpack_upgrade::init' do |vars| #Test users file, users_roles and roles.yml @@ -52,9 +56,7 @@ shared_examples 'xpack_upgrade::init' do |vars| #check accounts are correct i.e. we can auth and they have the correct roles describe 'kibana4_server access check' do it 'should be reported as version '+vars['es_version'] do - command = command('curl -s localhost:9200/ -u kibana4_server:changeMe | grep number') - expect(command.stdout).to match(vars['es_version']) - expect(command.exit_status).to eq(0) + expect(curl_json(es_api_url, username='kibana4_server', password='changeMe')['version']['number']).to eq(vars['es_version']) end end @@ -84,9 +86,7 @@ shared_examples 'xpack_upgrade::init' do |vars| describe 'logstash_system access check' do it 'should be reported as version '+vars['es_version'] do - command = command('curl -s localhost:9200/ -u logstash_system:aNewLogstashPassword | grep number') - expect(command.stdout).to match(vars['es_version']) - expect(command.exit_status).to eq(0) + expect(curl_json(es_api_url, username='logstash_system', password='aNewLogstashPassword')['version']['number']).to eq(vars['es_version']) end end end diff --git a/test/integration/issue-test-trial b/test/integration/issue-test-trial new file mode 120000 index 0000000..0746a3c --- /dev/null +++ b/test/integration/issue-test-trial @@ -0,0 +1 @@ +issue-test \ No newline at end of file diff --git a/test/integration/issue-test-trial.yml b/test/integration/issue-test-trial.yml new file mode 100644 index 0000000..efd726c --- /dev/null +++ b/test/integration/issue-test-trial.yml @@ -0,0 +1,46 @@ +#This file is for users to test issues and reproduce them using the test framework. +#Modify the playbook below and test with kitchen i.e. `kitchen test issue-test` +#To add custom tests modify the serverspec file ./helpers/serverspec/issue_test_spec.rb +#Idempot test is enabled for this test + +- name: Simple Example + hosts: localhost + post_tasks: + - include: elasticsearch/test/integration/debug.yml + roles: + - elasticsearch + vars: + es_xpack_license: "" + es_xpack_trial: true + es_config: + xpack.security.authc.realms.file.file1.order: 1 + xpack.security.authc.realms.native.native1.type: "native" + es_heap_size: "1g" + es_plugins: + - plugin: ingest-attachment + es_xpack_features: + - security + - alerting + es_api_basic_auth_username: elastic + es_api_basic_auth_password: changeme + es_users: + file: + test_user: + password: changeme + roles: + - kibana_system + native: + kibana: + password: changeme + roles: + - kibana_system + elastic: + password: aNewPassWord + es_roles: + native: + logstash: + cluster: + - manage_index_templates + logstash_system: + cluster: + - manage_index_templates diff --git a/test/integration/xpack-upgrade-trial b/test/integration/xpack-upgrade-trial new file mode 120000 index 0000000..3021ce0 --- /dev/null +++ b/test/integration/xpack-upgrade-trial @@ -0,0 +1 @@ +xpack-upgrade \ No newline at end of file diff --git a/test/integration/xpack-upgrade-trial.yml b/test/integration/xpack-upgrade-trial.yml new file mode 100644 index 0000000..a7196c1 --- /dev/null +++ b/test/integration/xpack-upgrade-trial.yml @@ -0,0 +1,177 @@ +--- +- name: Elasticsearch Xpack HTTP different keystore and truststore with password + hosts: localhost + post_tasks: + - include: elasticsearch/test/integration/debug.yml + roles: + - elasticsearch + vars: + es_config_6x: + xpack.security.authc.realms.file1.order: 0 + xpack.security.authc.realms.file1.type: file + xpack.security.authc.realms.native1.order: 1 + xpack.security.authc.realms.native1.type: native + es_config_7x: + xpack.security.authc.realms.file.file1.order: 0 + xpack.security.authc.realms.native.native1.order: 1 + es_config: "{{ es_config_7x if es_major_version == '7.x' else es_config_6x }}" + es_heap_size: "1g" + es_templates: true + es_major_version: "7.x" + es_version: "{{ '7.0.0' if es_major_version == '7.x' else '6.7.1' }}" # This is set to an older version than the current default to force an upgrade + es_xpack_license: "" + es_xpack_trial: true + es_plugins: + - plugin: ingest-attachment + es_xpack_features: + - security + - alerting + es_api_basic_auth_username: elastic + es_api_basic_auth_password: changeme + es_enable_http_ssl: false + es_enable_transport_ssl: true + es_ssl_keystore: "files/certs/keystore-password.p12" + es_ssl_truststore: "files/certs/truststore-password.p12" + es_ssl_keystore_password: password1 + es_ssl_truststore_password: password2 + es_validate_certs: no + es_role_mapping: + power_user: + - "cn=admins,dc=example,dc=com" + user: + - "cn=users,dc=example,dc=com" + - "cn=admins,dc=example,dc=com" + es_users: + native: + kibana4_server: + password: changeMe + roles: + - kibana4_server + logstash_system: + #this should be successfully modified + password: aNewLogstashPassword + #this will be ignored + roles: + - kibana4_server + elastic: + password: elasticChanged + file: + es_admin: + password: changeMe + roles: + - admin + testUser: + password: changeMeAlso! + roles: + - power_user + - user + es_roles: + file: + admin: + cluster: + - all + indices: + - names: '*' + privileges: + - all + power_user: + cluster: + - monitor + indices: + - names: '*' + privileges: + - all + user: + indices: + - names: '*' + privileges: + - read + kibana4_server: + cluster: + - monitor + indices: + - names: '.kibana' + privileges: + - all + native: + logstash: + cluster: + - manage_index_templates + indices: + - names: 'logstash-*' + privileges: + - write + - delete + - create_index + #this will be ignored - its reserved + logstash_system: + cluster: + - manage_index_templates + indices: + - names: 'logstash-*' + privileges: + - write + - delete + - create_index + +#modifies the installation. Changes es_admin password and upgrades ES. Tests confirm the correct version is installed. +- name: Elasticsearch Xpack HTTP SSL and shared keystore without password + hosts: localhost + post_tasks: + - include: elasticsearch/test/integration/debug.yml + roles: + - elasticsearch + vars: + es_config_6x: + xpack.security.authc.realms.file1.order: 0 + xpack.security.authc.realms.file1.type: file + xpack.security.authc.realms.native1.order: 1 + xpack.security.authc.realms.native1.type: native + es_config_7x: + xpack.security.authc.realms.file.file1.order: 0 + xpack.security.authc.realms.native.native1.order: 1 + es_config: "{{ es_config_7x if es_major_version == '7.x' else es_config_6x }}" + es_heap_size: "1g" + es_templates: true + es_xpack_license: "" + es_xpack_trial: false + es_plugins: + - plugin: ingest-attachment + es_xpack_features: + - security + - alerting + es_api_basic_auth_username: elastic + es_api_basic_auth_password: elasticChanged + es_enable_http_ssl: true + es_enable_transport_ssl: true + es_ssl_keystore: "files/certs/shared-store-no-password.p12" + es_ssl_truststore: "files/certs/shared-store-no-password.p12" + es_ssl_keystore_password: "" + es_ssl_truststore_password: "" + es_validate_certs: no + es_role_mapping: + power_user: + - "cn=admins,dc=example,dc=com" + user: + - "cn=users,dc=example,dc=com" + - "cn=admins,dc=example,dc=com" + es_users: + native: + kibana4_server: + password: changeMe + roles: + - kibana4_server + logstash_system: + #this will be ignored + roles: + - kibana4_server + file: + es_admin: + password: changeMeAgain + roles: + - admin + testUser: + password: changeMeAlso! + roles: + - power_user + - user diff --git a/test/integration/xpack-upgrade.yml b/test/integration/xpack-upgrade.yml index 1270007..a493633 100644 --- a/test/integration/xpack-upgrade.yml +++ b/test/integration/xpack-upgrade.yml @@ -1,5 +1,5 @@ --- -- name: Elasticsearch Xpack tests initial +- name: Elasticsearch Xpack HTTP different keystore and truststore with password hosts: localhost post_tasks: - include: elasticsearch/test/integration/debug.yml @@ -27,6 +27,13 @@ - alerting es_api_basic_auth_username: elastic es_api_basic_auth_password: changeme + es_enable_http_ssl: false + es_enable_transport_ssl: true + es_ssl_keystore: "files/certs/keystore-password.p12" + es_ssl_truststore: "files/certs/truststore-password.p12" + es_ssl_keystore_password: password1 + es_ssl_truststore_password: password2 + es_validate_certs: no es_role_mapping: power_user: - "cn=admins,dc=example,dc=com" @@ -107,7 +114,7 @@ - create_index #modifies the installation. Changes es_admin password and upgrades ES. Tests confirm the correct version is installed. -- name: Elasticsearch Xpack modify +- name: Elasticsearch Xpack HTTP SSL and shared keystore without password hosts: localhost post_tasks: - include: elasticsearch/test/integration/debug.yml @@ -133,6 +140,13 @@ - alerting es_api_basic_auth_username: elastic es_api_basic_auth_password: elasticChanged + es_enable_http_ssl: true + es_enable_transport_ssl: true + es_ssl_keystore: "files/certs/shared-store-no-password.p12" + es_ssl_truststore: "files/certs/shared-store-no-password.p12" + es_ssl_keystore_password: "" + es_ssl_truststore_password: "" + es_validate_certs: no es_role_mapping: power_user: - "cn=admins,dc=example,dc=com"