Skip to content

Commit

Permalink
Fix Prelim
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Williams <stephenw@mindpointgroup.com>
  • Loading branch information
MrSteve81 committed Mar 13, 2024
1 parent e7fe50c commit e411cee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tasks/prelim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Current list is elastic and will be updated as we test more cloud based services.
# Current testing is working in Azure using Hyper-V. We are currently using this for reference:
# /~https://github.com/ansible/ansible/blob/905131fc76a07cf89dbc8d33e7a4910da3f10a16/lib/ansible/module_utils/facts/virtual/linux.py#L205
- name: Set Fact If Cloud Based System.
- name: PRELIM | Set Fact If Cloud Based System.
ansible.builtin.set_fact:
win10cis_cloud_based_system: true
when:
Expand All @@ -42,7 +42,7 @@
tags:
- always

- name: Check Hyper-V Installation
- name: PRELIM | Check Hyper-V Installation
ansible.windows.win_shell: Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All | Select-Object -Property State | ft -hide
changed_when: false
failed_when: false
Expand All @@ -56,21 +56,21 @@
tags:
- always

- name: Set Windows installation type
- name: PRELIM | Set Windows installation type
ansible.builtin.set_fact:
win10cis_windows_installation_type: "{{ get_windows_installation_type.value | default('') }}"
tags:
- always

- name: Load Default User Hive (Account That All New Users Get Created From Profile)
- name: PRELIM | Load Default User Hive (Account That All New Users Get Created From Profile)
ansible.windows.win_shell: REG LOAD HKU\DEFAULT C:\Users\Default\NTUSER.DAT
changed_when: false
failed_when: false
when: win10cis_section19
tags:
- always

- name: Pull All Username and SIDs
- name: PRELIM | Pull All Username and SIDs
ansible.windows.win_shell: Get-CimInstance -Class Win32_UserAccount -Filter "SID LIKE 'S-1-5-%'" | ForEach-Object { $_.Name + " " + $_.SID }
changed_when: false
failed_when: false
Expand All @@ -79,14 +79,14 @@
tags:
- always

- name: Create Results List Fact For Username And SIDs
- name: PRELIM | Create Results List Fact For Username And SIDs
ansible.builtin.set_fact:
username_and_sid_results_list: "{{ all_users.stdout_lines | map('split', ' ') | list }}"
when: win10cis_section19
tags:
- always

- name: Load All User Hives From Username And SIDs List
- name: PRELIM | Load All User Hives From Username And SIDs List
ansible.windows.win_shell: REG LOAD HKU\{{ item.1 }} C:\Users\{{ item.0 }}\NTUSER.DAT
changed_when: false
failed_when: false
Expand All @@ -95,7 +95,7 @@
tags:
- always

- name: Retrieve Current Users SIDs from HKEY_USERS
- name: PRELIM | Retrieve Current Users SIDs from HKEY_USERS
ansible.windows.win_shell: (Get-ChildItem "REGISTRY::HKEY_USERS").name | Where-Object {$_ -notlike "*_classes"}
changed_when: false
failed_when: false
Expand All @@ -104,7 +104,7 @@
tags:
- always

- name: Create List Fact For Current Users SIDs from HKEY_USERS
- name: PRELIM | Create List Fact For Current Users SIDs from HKEY_USERS
ansible.builtin.set_fact:
hku_loaded_list: "{{ current_users_loaded_hku.stdout | regex_replace('HKEY_USERS\\\\','') | split }}"
when: win10cis_section19
Expand Down

0 comments on commit e411cee

Please sign in to comment.