5cccad8ed4
* added win_audit_rule with integration test * Updated integration testing to target files as well as directories and registry keys. Split testing files apart to be more organized. Updated powershell for better handling when targetting file objects and optimized a bit. Removed duplicated sections that got there from a previous merge I think. * Decided to make all the fact names the same in integration testing. Seemed like there would be less change of accidentally using the wrong variable when copy/pasting that way, and not much upside to having unique names. Did final cleanup and fixed a few errors in the integration testing. * Fixed a bug where results was displaying a wrong value Fixed a bug where removal was failing if multiple rules existed due to inheritance from higher level objects. * Resolved issue with unhandled error when used didn't have permissions for get-acl. Changed from setauditrule to addauditrule, see comment in script for reasoning. Fixed state absent to be able to remove multiple entries if they exist. * fixed docs issue * updated to fail if invalid inheritance_rule when defining a file rather than warn
33 lines
782 B
YAML
33 lines
782 B
YAML
- name: create temporary folder to test with
|
|
win_file:
|
|
path: "{{ test_audit_rule_folder }}"
|
|
state: directory
|
|
|
|
- name: create temporary file to test with
|
|
win_file:
|
|
path: "{{ test_audit_rule_file }}"
|
|
state: touch
|
|
|
|
- name: create temporary registry key to test with
|
|
win_regedit:
|
|
path: "{{ test_audit_rule_registry }}"
|
|
|
|
- block:
|
|
- include_tasks: add.yml
|
|
- include_tasks: modify.yml
|
|
- include_tasks: remove.yml
|
|
always:
|
|
- name: remove testing folder
|
|
win_file:
|
|
path: "{{ test_audit_rule_folder }}"
|
|
state: absent
|
|
|
|
- name: remove testing file
|
|
win_file:
|
|
path: "{{ test_audit_rule_file }}"
|
|
state: absent
|
|
|
|
- name: remove registry key
|
|
win_regedit:
|
|
path: "{{ test_audit_rule_registry }}"
|
|
state: absent
|