Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sept 2023 fixes #2

Merged
merged 9 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Prelim
Signed-off-by: Stephen Williams <stephenw@mindpointgroup.com>
  • Loading branch information
MrSteve81 committed Mar 13, 2024
commit e411cee71e5e7cea1e84578b8b18dff2714a11de
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
Loading