diff options
Diffstat (limited to 'collections-debian-merged/ansible_collections/ibm/qradar/tests')
14 files changed, 143 insertions, 0 deletions
diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/.keep b/collections-debian-merged/ansible_collections/ibm/qradar/tests/.keep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/.keep diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/target-prefixes.network b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/target-prefixes.network new file mode 100644 index 00000000..f26802f6 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/target-prefixes.network @@ -0,0 +1 @@ +qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/deploy/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/deploy/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/deploy/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/deploy/tasks/main.yml b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/deploy/tasks/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/deploy/tasks/main.yml diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/log_source_management/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/log_source_management/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/log_source_management/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/log_source_management/tasks/main.yml b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/log_source_management/tasks/main.yml new file mode 100644 index 00000000..87bb1137 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/log_source_management/tasks/main.yml @@ -0,0 +1,60 @@ +--- +- name: Create Testing Snort Open Source IDS log source + log_source_management: + name: "Testing Collections PB - 192.168.1.112" + type_name: "Snort Open Source IDS" + state: present + description: "Testing Collection PB Description" + identifier: "192.168.1.112" + register: snort_log_source_create + +- name: Assert Create Test Snort Open Source IDS log source changed + assert: + that: + - snort_log_source_create is changed + - snort_log_source_create is not failed + +- name: Create Testing Snort Open Source IDS log source RERUN + log_source_management: + name: "Testing Collections PB - 192.168.1.112" + type_name: "Snort Open Source IDS" + state: present + description: "Testing Collection PB Description" + identifier: "192.168.1.112" + register: snort_log_source_create_rerun + +- name: Assert Create Test Snort Open Source IDS log source is not changed on RERUN + assert: + that: + - snort_log_source_create_rerun is not changed + - snort_log_source_create_rerun is not failed + +- name: Delete Testing Snort Open Source IDS log source + log_source_management: + name: "Testing Collections PB - 192.168.1.112" + type_name: "Snort Open Source IDS" + state: absent + description: "Testing Collection PB Description" + identifier: "192.168.1.112" + register: snort_log_source_delete + +- name: Assert Delete Test Snort Open Source IDS log source changed + assert: + that: + - snort_log_source_delete is changed + - snort_log_source_delete is not failed + +- name: Delete Testing Snort Open Source IDS log source RERUN + log_source_management: + name: "Testing Collections PB - 192.168.1.112" + type_name: "Snort Open Source IDS" + state: absent + description: "Testing Collection PB Description" + identifier: "192.168.1.112" + register: snort_log_source_delete_rerun + +- name: Assert Delete Test Snort Open Source IDS log source is not changed on RERUN + assert: + that: + - snort_log_source_delete_rerun is not changed + - snort_log_source_delete_rerun is not failed diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/offense/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/offense/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/offense/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/offense/tasks/main.yml b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/offense/tasks/main.yml new file mode 100644 index 00000000..7495ec9b --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/offense/tasks/main.yml @@ -0,0 +1,19 @@ +--- + +#- qradar_offense_action: +# id: 1 +# status: "hidden" +# assigned_to: "admin" +# protected: false +# +#- qradar_offense_note: +# offense_id: 2 +# note_text: "testing note text from playbook - modified" +# +#- name: get info about qradar offense +# qradar_offense_info: +# protected: true +# status: "HIDDEN" +# register: offense_info +# +#- debug: var=offense_info diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_deploy/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_deploy/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_deploy/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_log_source_management/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_log_source_management/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_log_source_management/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_offense/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_offense/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_offense/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_rule/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_rule/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/qradar_rule/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/rule/aliases b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/rule/aliases new file mode 100644 index 00000000..d7e4f1e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/rule/aliases @@ -0,0 +1 @@ +network/qradar diff --git a/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/rule/tasks/main.yml b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/rule/tasks/main.yml new file mode 100644 index 00000000..142fd613 --- /dev/null +++ b/collections-debian-merged/ansible_collections/ibm/qradar/tests/integration/targets/rule/tasks/main.yml @@ -0,0 +1,55 @@ +--- +- name: get info about qradar offense + rule_info: + name: "Service DoS Attack Detected" + register: rule_info + +- debug: var=rule_info + +- name: enable rule by id + rule: + state: enabled + id: "{{ rule_info['rules'][0]['id']|int }}" + register: enable_rule_by_id + +- name: ensure enable rule by id + assert: + that: + - enable_rule_by_id is changed + - enable_rule_by_id is not failed + +- name: enable rule by id again + rule: + state: enabled + id: "{{ rule_info['rules'][0]['id']|int }}" + register: enable_rule_by_id_again + +- name: ensure enable rule by id again + assert: + that: + - enable_rule_by_id_again is not changed + - enable_rule_by_id_again is not failed + +- name: disable rule by id + rule: + state: disabled + id: "{{ rule_info['rules'][0]['id']|int }}" + register: disable_rule_by_id + +- name: ensure disable rule by id + assert: + that: + - disable_rule_by_id is changed + - disable_rule_by_id is not failed + +- name: disable rule by id again + rule: + state: disabled + id: "{{ rule_info['rules'][0]['id']|int }}" + register: disable_rule_by_id_again + +- name: ensure disable rule by id again + assert: + that: + - disable_rule_by_id_again is not changed + - disable_rule_by_id_again is not failed |