2019-03-05 00:09:48 +01:00
|
|
|
---
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Generate privatekey
|
2019-03-05 00:09:48 +01:00
|
|
|
openssl_privatekey:
|
|
|
|
path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Generate privatekey with password
|
2019-03-08 17:21:18 +01:00
|
|
|
openssl_privatekey:
|
|
|
|
path: '{{ output_dir }}/privatekeypw.pem'
|
|
|
|
passphrase: hunter2
|
|
|
|
cipher: auto
|
|
|
|
select_crypto_backend: cryptography
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Generate CSR (no extensions)
|
2019-03-05 00:09:48 +01:00
|
|
|
openssl_csr:
|
|
|
|
path: '{{ output_dir }}/csr_noext.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
subject:
|
|
|
|
commonName: www.example.com
|
|
|
|
useCommonNameForSAN: no
|
|
|
|
|
2019-06-24 06:34:12 +02:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Generate CSR (with SANs)
|
|
|
|
openssl_csr:
|
|
|
|
path: '{{ output_dir }}/csr_sans.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
subject:
|
|
|
|
commonName: www.example.com
|
|
|
|
subject_alt_name:
|
|
|
|
- "DNS:ansible.com"
|
|
|
|
- "IP:127.0.0.1"
|
|
|
|
- "IP:::1"
|
|
|
|
useCommonNameForSAN: no
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Generate selfsigned certificate (no extensions)
|
2019-03-05 00:09:48 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
csr_path: '{{ output_dir }}/csr_noext.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
provider: selfsigned
|
|
|
|
selfsigned_digest: sha256
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-05 00:09:48 +01:00
|
|
|
|
2019-06-24 06:34:12 +02:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Generate selfsigned certificate (with SANs)
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_sans.pem'
|
|
|
|
csr_path: '{{ output_dir }}/csr_sans.csr'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
provider: selfsigned
|
|
|
|
selfsigned_digest: sha256
|
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Assert that subject_alt_name is there (should fail)
|
2019-03-05 00:09:48 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
provider: assertonly
|
|
|
|
subject_alt_name:
|
|
|
|
- "DNS:example.com"
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-05 00:09:48 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: extension_missing_san
|
|
|
|
|
2019-06-24 06:34:12 +02:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Assert that subject_alt_name is there
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_sans.pem'
|
|
|
|
provider: assertonly
|
|
|
|
subject_alt_name:
|
|
|
|
- "DNS:ansible.com"
|
|
|
|
- "IP:127.0.0.1"
|
|
|
|
- "IP:::1"
|
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
|
|
|
register: extension_san
|
|
|
|
|
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Assert that subject_alt_name is there (strict)
|
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_sans.pem'
|
|
|
|
provider: assertonly
|
|
|
|
subject_alt_name:
|
|
|
|
- "DNS:ansible.com"
|
|
|
|
- "IP:127.0.0.1"
|
|
|
|
- "IP:::1"
|
|
|
|
subject_alt_name_strict: yes
|
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
|
|
|
register: extension_san_strict
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Assert that key_usage is there (should fail)
|
2019-03-05 00:09:48 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
provider: assertonly
|
|
|
|
key_usage:
|
|
|
|
- digitalSignature
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-05 00:09:48 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: extension_missing_ku
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Assert that extended_key_usage is there (should fail)
|
2019-03-05 00:09:48 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
provider: assertonly
|
|
|
|
extended_key_usage:
|
|
|
|
- biometricInfo
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-05 00:09:48 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: extension_missing_eku
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- extension_missing_san is failed
|
|
|
|
- "'Found no subjectAltName extension' in extension_missing_san.msg"
|
2019-06-24 06:34:12 +02:00
|
|
|
- extension_san is succeeded
|
|
|
|
- extension_san_strict is succeeded
|
2019-03-05 00:09:48 +01:00
|
|
|
- extension_missing_ku is failed
|
|
|
|
- "'Found no keyUsage extension' in extension_missing_ku.msg"
|
|
|
|
- extension_missing_eku is failed
|
|
|
|
- "'Found no extendedKeyUsage extension' in extension_missing_eku.msg"
|
2019-03-08 17:21:18 +01:00
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Check private key passphrase fail 1
|
2019-03-08 17:21:18 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekey.pem'
|
|
|
|
privatekey_passphrase: hunter2
|
|
|
|
provider: assertonly
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-08 17:21:18 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: passphrase_error_1
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Check private key passphrase fail 2
|
2019-03-08 17:21:18 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekeypw.pem'
|
|
|
|
privatekey_passphrase: wrong_password
|
|
|
|
provider: assertonly
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-08 17:21:18 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: passphrase_error_2
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) - Check private key passphrase fail 3
|
2019-03-08 17:21:18 +01:00
|
|
|
openssl_certificate:
|
|
|
|
path: '{{ output_dir }}/cert_noext.pem'
|
|
|
|
privatekey_path: '{{ output_dir }}/privatekeypw.pem'
|
|
|
|
provider: assertonly
|
2019-03-22 14:21:23 +01:00
|
|
|
select_crypto_backend: '{{ select_crypto_backend }}'
|
2019-03-08 17:21:18 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: passphrase_error_3
|
|
|
|
|
2019-03-22 14:21:23 +01:00
|
|
|
- name: (Assertonly, {{select_crypto_backend}}) -
|
2019-03-08 17:21:18 +01:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- passphrase_error_1 is failed
|
|
|
|
- "'assphrase' in passphrase_error_1.msg or 'assword' in passphrase_error_1.msg"
|
|
|
|
- passphrase_error_2 is failed
|
2019-03-30 14:28:10 +01:00
|
|
|
- "'assphrase' in passphrase_error_2.msg or 'assword' in passphrase_error_2.msg or 'serializ' in passphrase_error_2.msg"
|
2019-03-08 17:21:18 +01:00
|
|
|
- passphrase_error_3 is failed
|
2019-03-30 14:28:10 +01:00
|
|
|
- "'assphrase' in passphrase_error_3.msg or 'assword' in passphrase_error_3.msg or 'serializ' in passphrase_error_3.msg"
|