ソフトウェアのセキュリティは、セキュリティ ソフトウェアではありません。ここでは、認証、アクセス制御、機密性、暗号化、権限管理などのトピックについて説明します。
- name: storage with network acl
azure_rm_storageaccount:
resource_group: testGroup
name: sa001
type: Standard_RAGRS
network_acls:
bypass: AzureServices,Metrics
default_action: Deny
ip_rules:
- value: 0.0.0.0/0
action: Allow
- name: Create MySQL Server
azure.azcollection.azure_rm_mysqlserver:
resource_group: testGroup
name: testMySQL
sku:
name: B_Gen5_1
tier: Basic
location: westeurope
storage_mb: 8096
version: 5.6
enforce_ssl: false
admin_username: test
admin_password: complicatedPass
- name: Create Postgres Server
azure.azcollection.azure_rm_postgresqlserver:
resource_group: testGroup
name: testPostgres
sku:
name: B_Gen5_1
tier: Basic
location: westeurope
storage_mb: 8096
version: 5.6
enforce_ssl: false
admin_username: test
admin_password: complicatedPass
https_only
設定は yes
に設定され、Azure ストレージ アカウントの安全な転送を強制します。ただし、この設定は明示的に無効にできます。
- name: create a storage account
azure_rm_storageaccount:
resource_group: testResGroup
name: sa0001
type: Standard_GRS
https_only: no
- name: AKS Instance
azure_rm_aks:
name:
resource_group: testResourceGroup
location: eastus
...
addon:
monitoring:
log_analytics_workspace_resource_id: logws001
enabled: no
securestring
または secureobject
タイプを使用します。
{
...
"parameters": {
"rootPassword": {
"defaultValue": "HardcodedPassword",
"type": "secureString"
},
"adminLogin": {
"type": "string"
},
"sqlServerName": {
"type": "string"
}
},
...
}
"supportsHttpsTrafficOnly": "false"
{
"name": "TestCluster",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
...
"servicePrincipalProfile": {
"clientId": "422313d8-123a-41ea-8f8e-90821ff61c05",
"secret": "xxxxxxxxxxxxxxxxx"
},
}
}
{
...
"type": "Microsoft.Web/sites/config",
"properties":
{
...
"remoteDebuggingEnabled": true,
}
}
publicAccess
プロパティを Container
に設定して、Azure BLOB ストレージ コンテナーを定義しています。これにより、コンテナーのすべての BLOB とデータに匿名でアクセスできます。
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2021-04-01",
"name": "[format('{0}/default/{1}', parameters('storageAccountName'), parameters('containerName'))]",
"properties":{
"publicAccess": "Container"
}
,
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
]
}
publicNetworkAccess
プロパティを有効にし、IP 制限を設けないことで、ネットワーク アクセスが制限されない Azure Container Registry を定義しています。例 2: 次のテンプレートの例では、
{
"name": "[variables('acrName')]",
"type": "Microsoft.ContainerRegistry/registries",
...
"properties": {
"publicNetworkAccess": "Enabled",
..
}
networkRuleSet
プロパティに幅広い許可リストを指定することで、ネットワーク アクセスが制限されない Azure Container Registry を定義しています。
{
"name": "[variables('acrName')]",
"type": "Microsoft.ContainerRegistry/registries",
...
"properties": {
"publicNetworkAccess": "Enabled",
"networkRuleSet":
{
"defaultAction": "Allow",
"ipRules":[{
"action": "Allow",
"value": "*"
}]
}
...
}
例 2: 次のテンプレートの例は、Azure Web アプリケーションに適用する、過度に許容的な CORS ポリシーを定義しています。
{
...
"type": "Microsoft.SignalRService/SignalR",
...
"properties": {
...
"cors": {
"allowedOrigins": ["*"]
},
...
}
例 3: 次のテンプレートの例は、Azure Maps アカウントに適用する、過度に許容的な CORS ポリシーを定義しています。
{
"apiVersion": "2020-12-01",
"type": "Microsoft.Web/sites",
...
"properties": {
...
"siteConfig": {
...
"cors": {
"allowedOrigins": [
"*"
]
},
...
}
例 4: 次のテンプレートの例は、Azure Cosmos DB アカウントに適用する、過度に許容的な CORS ポリシーを定義しています。
{
"apiVersion": "2021-12-01-preview",
"type": "Microsoft.Maps/accounts",
...
"properties":{
"cors":{
"allowedOrigins": ["*"]
}
},
...
}
例 5: 次のテンプレートの例は、Azure ストレージ BLOB サービスに適用する、過度に許容的な CORS ポリシーを定義しています。
{
"type": "Microsoft.DocumentDB/databaseAccounts",
...
"properties": {
"cors": [{
"allowedOrigins":"*"
}],
...
}
{
"type": "Microsoft.Storage/storageAccounts/blobServices",
...
"properties": {
"cors": {
"corsRules": [
{
"allowedOrigins":["*"],
...
}
]
}
}
...
}
publicNetworkAccess
プロパティが Enabled
に設定され、IP アドレス範囲にはすべての IP が含まれます。
{
"type": "Microsoft.DocumentDB/databaseAccounts",
"apiVersion": "2021-04-15",
...
"properties": {
...
"publicNetworkAccess": "Enabled",
"ipRules":[{
"ipAddressOrRange": "0.0.0.0"
}]
...
}
{
...
"name": "sample/securitygroup",
"type": "Microsoft.Network/networkSecurityGroups/securityRules",
"apiVersion": "2020-11-01",
"properties": {
"description": "Services Inbound Range",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRanges": [
"3333-3389"
],
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 100,
"direction": "Inbound"
...
}
{
"resources": [
{
"name": "[variables('sqlServerName')]",
"type": "Microsoft.Sql/servers",
...
"resources": [
{
"type": "databases",
...
},
{
"name": "AllowAllIPs",
"type": "firewallrules",
"apiVersion": "2020-02-02-preview",
"location": "[parameters('location')]",
"properties": {
"endIpAddress": "255.255.255.255",
"startIpAddress": "0.0.0.0"
},
}
]
}
]
}
apiVersion
2019-04-01 以降、Azure ストレージ アカウントにはリクエストに応答するための安全な接続が必要とされますが、この要件は supportsHttpsTrafficOnly
プロパティを使用して無効化できます。
{
"name": "Storage1",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-02-01",
...
"properties": {
"supportsHttpsTrafficOnly": false
}
}