-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAzSK.ps1
34 lines (22 loc) · 1.24 KB
/
AzSK.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
#Secure DevOps Kit for Azure (AzSDK)
#https://github.com/azsdk/azsdk-docs#references
Install-Module AzSK -Scope CurrentUser -AllowClobber
Import-Module -Name AzSK
$email = '[email protected], [email protected]'
$phone = '00000000'
#Subid needs to be changed to your subscription ID
$subid = '00000000-0000-0000-0000-000000000000'
#Gets Azure Subscription Security Status and outputs to CSV
Get-AzSKSubscriptionSecurityStatus -SubscriptionId $subid
#Sets Azure Subscription Security, creates mandatory service accounts,
Set-AzSKSubscriptionSecurity -SubscriptionId $subid -SecurityContactEmails $email -SecurityPhoneNumber $phone
#The subscription access control provisioning script ensures that certain central accounts and roles are setup in your subscription.
Set-AzSKSubscriptionRBAC -SubscriptionId $subid
#Creates Azure Alerts
Set-AzSKAlerts -SubscriptionId $subid -SecurityContactEmails $email -SecurityPhoneNumber $phone
#Sets up Azure Security Center
Set-AzSKAzureSecurityCenterPolicies -SubscriptionId $subid -SecurityContactEmails $email -SecurityPhoneNumber $phone
#Sets up ARM Azure POlicy to prevent some creation
Set-AzSKARMPolicies -SubscriptionId $subid
#Updates Azure Security Pacl
Update-AzSKSubscriptionSecurity -SubscriptionId $subid