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
<# | |
.SYNOPSIS | |
Function to loop over all Azure Network Security Groups in multiple | |
subscriptions and add an NSG rule to it if it does not already exist. | |
If the rule already exists, it will remove it and add it. The NSG will | |
then be replaced. | |
This function is not idempotent, it will replace the NSG regardless | |
of whether it needed to be or not. |
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
#Requires -Modules @{ ModuleName = 'Az.Accounts'; ModuleVersion = '2.5.1' } | |
#Requires -Modules @{ ModuleName = 'Az.Resources'; ModuleVersion = '4.2.0' } | |
#Requires -Modules @{ ModuleName = 'Az.Compute'; ModuleVersion = '4.15.0' } | |
#Requires -Modules @{ ModuleName = 'Az.OperationalInsights'; ModuleVersion = '2.3.0' } | |
#Requires -Modules @{ ModuleName = 'Az.Aks'; ModuleVersion = '2.2.0' } | |
<# | |
.SYNOPSIS | |
Returns an array Azure Log Analytics workspaces and the resources | |
that send data to them. |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"serverName": { | |
"type": "string", | |
"metadata": { | |
"description": "Server Name for Azure database for PostgreSQL" | |
} | |
}, |
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
az vmss create \ | |
--name dsragentspool \ | |
--resource-group dsr-azuredevops-rg \ | |
--image UbuntuLTS \ | |
--vm-sku Standard_DS2_v2 \ | |
--storage-sku Standard_LRS \ | |
--authentication-type SSH \ | |
--instance-count 2 \ | |
--disable-overprovision \ | |
--upgrade-policy-mode manual \ |
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
trigger: | |
branches: | |
include: | |
- 'main' | |
pr: none | |
stages: | |
- stage: Build | |
jobs: | |
- template: templates/build.yml |
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
trigger: | |
branches: | |
include: | |
- 'main' | |
- 'malicious-change' | |
pr: none | |
stages: | |
- stage: Build | |
jobs: |
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
trigger: | |
branches: | |
include: | |
- 'main' | |
pr: none | |
stages: | |
- stage: Build | |
jobs: | |
- template: templates/build.yml |
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
$SubscriptionId = '<subscription id>' | |
$ResourceGroupName = 'my-container-rg' | |
$AciName = 'my-container-aci' | |
$resourceId = "/subscriptions/$($SubscriptionId)/resourceGroups/$($ResourceGroupName)/providers/Microsoft.ContainerInstance/containerGroups/$($AciName)/containers/$($AciName)" | |
$command = "/zap/zap-baseline.py -t 'https://myapplication.net' -x OWASP-ZAP-Report.xml" | |
Invoke-AzResourceAction ` | |
-ResourceId $resourceId ` | |
-Action 'exec' ` | |
-ApiVersion '2019-12-01' ` |
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
New-AzResourceGroupDeployment ` | |
-ResourceGroupName '<NAME OF RESOURCE GROUP CONTAINING ARC MACHINES>' ` | |
-TemplateFile ~/AzureArcLinuxCustomScriptExtensions.json ` | |
-TemplateParameterObject @{ | |
MachineName = '<NAME OF AZURE ARC MACHINE>' | |
Location = '<LOCATION OF AZURE ARM MACHINE>' | |
WorkspaceId = '<WORKSPACE ID OF LOG ANALYTICS WORKSPACE>' | |
WorkspaceKey = '<WORKSPACE KEY OF LOG ANALYTICS WORKSPACE>' | |
} |
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
Invoke-WebRequest -Uri https://gist.githubusercontent.com/PlagueHO/c3f09056cace496dded18da8bc1ed589/raw/AzureArcLinuxCustomScriptExtensions.json -OutFile ~\AzureArcLinuxCustomScriptExtensions.json |
NewerOlder