Many organizations standardize server configurations by applying their group policies and hardening rules to reduce risks caused by misconfiguration. Taking Windows Server as an example, it is very common to apply default firewall rules, disabled services, custom registry values, and user & role permission settings. You’ll learn how to use Automation Config to automate baseline configuration for Windows Server.
/POV/config-management/windows/base-config/enable_rds.sls
enable_rds.sls
and examine its SaltStack State File YAML
enable_service_rds:
service.enabled:
- name: TermService
start_service_rds:
service.running:
- name: TermService
reg_enable_rdp_connections:
reg.present:
- name: HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
- vname: fDenyTSConnections
- vdata: 0
- vtype: REG_DWORD
Remote Desktop Service (RDS)
on the target minions, but we are NOT going to run it now. We will apply this state collectively as a baseline configuration/POV/config-management/windows/base-config/disable_spooler.sls
disable_spooler.sls
and examine its SaltStack State File YAML
disable_print_spooler:
service.disabled:
- name: Spooler
stop_print_spooler:
service.dead:
- name: Spooler
Printer Spooler Service
on the target minions, but we are NOT going to run it now. We will apply this state collectively as a baseline configuration/POV/config-management/windows/base-config/install_iis.sls
install_iis.sls
and examine its SaltStack State File YAML
install_iis:
cmd.powershell:
- name: salt://POV/config-management/windows/base-config/install_iis.ps1
/POV/config-management/windows/base-config/install_iis.ps1
install_iis.ps1
and examine this regular PowerShell script
Install-WindowsFeature -name Web-Server -IncludeManagementTools
/POV/config-management/windows/base-config/setup_firewall.sls
setup_firewall.sls
and examine its SaltStack State File YAML
open_smb_port:
win_firewall.add_rule:
- name: SMB (445)
- localport: 445
- protocol: tcp
- action: allow
open_http_port:
win_firewall.add_rule:
- name: HTTP (80)
- localport: 80
- protocol: tcp
- action: allow
open_https_port:
win_firewall.add_rule:
- name: HTTPS (443)
- localport: 443
- protocol: tcp
- action: allow
/POV/config-management/windows/base-config/add_users.sls
add_users.sls
and examine its SaltStack State File YAML
add_user:
user.present:
- name: holuser
- fullname: holuser
- password: VMware1!
- groups:
- Administrators
- Users
holuser
user to Administrators
and Users
groups in the target minions, but we are NOT going to run it now. We will apply this state collectively as a baseline configuration/POV/config-management/windows/base-config/main.sls
main.sls
and examine its SaltStack State File YAML
include:
- pov.config-management.windows.base-config.enable_rds.sls
- pov.config-management.windows.base-config.disable_spooler_service.sls
- pov.config-management.windows.base-config.install_iis.sls
- pov.config-management.windows.base-config.setup_firewall.sls
- pov.config-management.windows.base-config.add_users.sls
Baseline Configuration for Windows
Baseline config: RDS, IIS, Firewall & Users, etc.
salt
Windows Servers
state.apply
base
POV.config-management.windows.base-config.main
Baseline Configuration for Windows
(the job you have created in the previous task)false
base
holuser
is createdAutomation Config provides various flexible ways to apply baseline configuration: