-
Notifications
You must be signed in to change notification settings - Fork 2
/
script.ps1
50 lines (34 loc) · 1.11 KB
/
script.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
# SECPOL
Import-Module .\src\secpol\Get-Secpol
Import-Module .\src\secpol\Set-Secpol
$SystemAccessSecPolConfig = Get-Content -Path '.\lib\secpol\System Access.json' | ConvertFrom-Json
$EventAuditSecPolConfig = Get-Content -Path '.\lib\secpol\Event Audit.json' | ConvertFrom-Json
# basic modules
Import-Module .\src\modules\log
# firewall modules
Import-Module '.\src\Firewalls\Firewall Rules.psm1'
Import-Module '.\src\Firewalls\firewall.psm1'
#Tasks
Import-Module .\src\tasks\tasks.psm1
# unsecure services
Import-Module .\src\services\services.psm1
# SSH
Import-Module .\src\SSH\sshconf.psm1
# SECPOL (System Access)
$SecPool = Get-Secpol "C:\Windows\Temp\SecPool.cfg"
$SystemAccessSecPolConfig.PSObject.Properties | ForEach-Object {
$name = $_.Name
$value = $_.Value
$SecPool.'System Access'.$name = $value
}
$EventAuditSecPolConfig.PSObject.Properties | ForEach-Object {
$name = $_.Name
$value = $_.Value
$SecPool.'Event Audit'.$name = $value
}
Set-SecPol -Object $SecPool -CfgFile "C:\Windows\Temp\SecPool.cfg"
set-FirewallRule;
set-Firewall;
disableTasks;
disableUnsecureServices;
setSSHconfig;