-
Notifications
You must be signed in to change notification settings - Fork 74
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
Update Section 1 Logic, Section 19 Features Added, Handler Fixes, Prelim Fixes #98
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cd80e49
Update Section 1 Logic
MrSteve81 eedfd59
Update Section 1 Logic
MrSteve81 7bf469a
Added Reboot OPtion And Section 19 Enhancement For Hives
MrSteve81 f6ecc67
Added Prelim tags To Prelim
MrSteve81 f0a18dc
Updated Handlers
MrSteve81 5699d54
Updated Section 2 With Additional Variable Options
MrSteve81 98e2243
Fix Title In 9.3.8
MrSteve81 d791eb2
Fix 18.9.7.2
MrSteve81 e8a5010
Fix 18.10.89.2.2 and 18.10.89.1.3
MrSteve81 6d5c680
Fix 18.10.89.2.2 and 18.10.89.1.3
MrSteve81 4fae8dd
Fix 18.10.89.2.2 and 18.10.89.1.3
MrSteve81 2cfa8f8
Removed 18.10.82.1 and renamed .2 to .1 updated title
MrSteve81 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
--- | ||
|
||
- name: reboot_windows | ||
ansible.windows.win_reboot: | ||
reboot_timeout: 3600 | ||
- name: change_requires_reboot | ||
ansible.builtin.set_fact: | ||
reboot_host: true | ||
tags: | ||
- always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
|
||
- name: "POST | Flush Handlers" | ||
ansible.builtin.meta: flush_handlers | ||
tags: | ||
- always | ||
|
||
- name: "POST | Reboot System Options" | ||
block: | ||
- name: "POST | Rebooting System................. Skip Reboot Has Been Set To: False" | ||
ansible.windows.win_reboot: | ||
reboot_timeout: 3600 | ||
when: | ||
- reboot_host | ||
- not skip_reboot | ||
|
||
- name: "POST | Warning A Reboot Is Required, Skip Reboot Has Been Set" | ||
ansible.builtin.debug: | ||
msg: | ||
- "Warning!! Changes Have Been Made That Require A Reboot To Be Implemented Manually." | ||
- "Skip Reboot Was Set To: True - This Can Affect Compliance Check Results." | ||
changed_when: true | ||
when: | ||
- reboot_host | ||
- skip_reboot | ||
|
||
- name: "POST | Warning A Reboot Is Required, Skip Reboot Has Been Set | Warning Count" | ||
ansible.builtin.import_tasks: | ||
file: warning_facts.yml | ||
when: | ||
- reboot_host | ||
- skip_reboot | ||
vars: | ||
warn_control_id: Reboot_Required | ||
tags: | ||
- always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||||
--- | ||||||
|
||||||
- name: Set System Facts Based On Gather Facts Module | ||||||
- name: PRELIM | Set System Facts Based On Gather Facts Module | ||||||
block: | ||||||
- name: Set fact is system is standalone | ||||||
ansible.builtin.set_fact: | ||||||
|
@@ -26,7 +26,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: | ||||||
win19cis_cloud_based_system: true | ||||||
when: | ||||||
|
@@ -36,16 +36,52 @@ | |||||
tags: | ||||||
- always | ||||||
|
||||||
- name: Get Windows installation type | ||||||
- name: PRELIM | Get Windows installation type | ||||||
ansible.windows.win_reg_stat: | ||||||
path: HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion | ||||||
name: InstallationType | ||||||
register: get_windows_installation_type | ||||||
tags: | ||||||
- always | ||||||
|
||||||
- name: Set Windows installation type | ||||||
- name: PRELIM | Set Windows installation type | ||||||
ansible.builtin.set_fact: | ||||||
windows_installation_type: "{{ get_windows_installation_type.value | default('') }}" | ||||||
tags: | ||||||
- always | ||||||
|
||||||
- name: PRELIM | Obtatin And Load Default Hive As Well As User Hives | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @mfortin ! Nice catch! |
||||||
block: | ||||||
- 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 | ||||||
|
||||||
- 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 | ||||||
register: all_users | ||||||
|
||||||
- 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 }}" | ||||||
|
||||||
- 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 | ||||||
loop: "{{ username_and_sid_results_list }}" | ||||||
|
||||||
- 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 | ||||||
register: current_users_loaded_hku | ||||||
|
||||||
- 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: win19cis_section19 | ||||||
tags: | ||||||
- always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only be done on Azure VMs. Amazon EC2 instances should stick with the default Section 01 order.