forked from nsacyber/Windows-Secure-Host-Baseline
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNew-PolicyDefinitions.ps1
152 lines (113 loc) · 5.25 KB
/
New-PolicyDefinitions.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#requires -Version 3
Set-StrictMode -Version 3
#todo: turn into functions
#todo: removed hardcoded path
$basePath = "$env:USERPROFILE\Documents\GitHub\Secure-Host-Baseline"
$policy = [pscustomobject]@{
'PolicyName' = 'Adobe Reader'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\';
}
$policyPath = "$basePath\Adobe Reader\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'AppLocker'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit');
'PolicyTemplatePath' = '.\..\..\..\..\Windows\';
}
$policyPath = "$basePath\AppLocker\Group Policy Objects\Computer\Audit"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'AppLocker'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Enforced');
'PolicyTemplatePath' = '.\..\..\..\..\Windows\';
}
$policyPath = "$basePath\AppLocker\Group Policy Objects\Computer\Enforced"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'BitLocker'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\..\Windows\';
}
$policyPath = "$basePath\BitLocker\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Chrome'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\'
}
$policyPath = "$basePath\Chrome\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'EMET'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\'
}
$policyPath = "$basePath\EMET\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Internet Explorer'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\..\Windows';
}
$policyPath = "$basePath\Internet Explorer\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Internet Explorer'
'PolicyScopes' = [string[]]@('User');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\..\Windows';
}
$policyPath = "$basePath\Internet Explorer\Group Policy Objects\User"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Office'
'PolicyScopes' = [string[]]@('Computer','User');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\';
}
$policyPath = "$basePath\Office\Group Policy Objects"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Windows'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\';
}
$policyPath = "$basePath\Windows\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Windows'
'PolicyScopes' = [string[]]@('User');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\';
}
$policyPath = "$basePath\Windows\Group Policy Objects\User"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force
$policy = [pscustomobject]@{
'PolicyName' = 'Windows Firewall'
'PolicyScopes' = [string[]]@('Computer');
'PolicyTypes' = [string[]]@('Domain','Local');
'PolicyModes' = [string[]]@('Audit','Enforced');
'PolicyTemplatePath' = '.\..\..\..\Windows';
}
$policyPath = "$basePath\Windows Firewall\Group Policy Objects\Computer"
$policy | ConvertTo-Json | Out-File -FilePath "$policyPath\policy.json" -Encoding ASCII -Force