Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/queries/all-queries.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,112 @@ resource App 'Microsoft.Web/sites@2020-12-01' = {
}
```
</details>
<details><summary>Positive test num. 9 - bicep file</summary>

```bicep hl_lines="11"
resource meuAppService 'Microsoft.Web/sites@2022-09-01' = {
name: 'meuAppService'
location: 'West Europe'
properties: {}
}

resource meuAppService_web 'Microsoft.Web/sites/config@2022-09-01' = {
parent: meuAppService
name: 'web'
properties: {
minTlsVersion: '1.1'
}
}

```
</details>
<details><summary>Positive test num. 10 - json file</summary>

```json hl_lines="17"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.39.26.7824",
"templateHash": "11739403591702951112"
}
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2022-09-01",
"name": "meuAppService",
"location": "West Europe",
"properties": {}
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2022-09-01",
"name": "[format('{0}/{1}', 'meuAppService', 'web')]",
"properties": {
"minTlsVersion": "1.1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', 'meuAppService')]"
]
}
]
}
```
</details>
<details><summary>Positive test num. 11 - bicep file</summary>

```bicep hl_lines="10"
resource meuAppService 'Microsoft.Web/sites@2022-09-01' = {
name: 'meuAppService'
location: 'West Europe'
properties: {}
}

resource meuAppService_web 'Microsoft.Web/sites/config@2022-09-01' = {
parent: meuAppService
name: 'web'
properties: {}
}

```
</details>
<details><summary>Positive test num. 12 - json file</summary>

```json hl_lines="17"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.39.26.7824",
"templateHash": "750350632139492718"
}
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2022-09-01",
"name": "meuAppService",
"location": "West Europe",
"properties": {}
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2022-09-01",
"name": "[format('{0}/{1}', 'meuAppService', 'web')]",
"properties": {},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', 'meuAppService')]"
]
}
]
}
```
</details>


#### Code samples without security vulnerabilities
Expand Down Expand Up @@ -275,4 +381,53 @@ resource App 'Microsoft.Web/sites@2020-12-01' = {

```
</details>
<details><summary>Negative test num. 5 - bicep file</summary>

```bicep
resource meuAppService 'Microsoft.Web/sites@2022-09-01' = {
name: 'meuAppService'
location: 'West Europe'
properties: {}
}

resource meuAppService_web 'Microsoft.Web/sites/config@2022-09-01' = {
parent: meuAppService
name: 'web'
properties: {
minTlsVersion: '1.2'
}
}

```
</details>
<details><summary>Negative test num. 6 - json file</summary>

```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2022-09-01",
"name": "meuAppService",
"location": "West Europe",
"properties": {}
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2022-09-01",
"name": "meuAppService/web",
"dependsOn": [
"Microsoft.Web/sites/meuAppService"
],
"properties": {
"minTlsVersion": "1.2"
}
}
]
}

```
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -44,50 +44,7 @@ resource sqlServer1_sqlDatabase1 'Microsoft.Sql/servers/databases@2021-02-01-pre
}

```
```json title="Positive test num. 2 - json file" hl_lines="8"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2021-02-01-preview",
"name": "sqlServer1",
"location": "[resourceGroup().location]",
"properties": {},
"resources": [
{
"type": "auditingSettings",
"apiVersion": "2021-02-01-preview",
"name": "default_1",
"properties": {
"state": "Disabled"
}
},
{
"type": "databases",
"apiVersion": "2021-02-01-preview",
"name": "sqlDatabase1",
"location": "[resourceGroup().location]",
"properties": {},
"resources": [
{
"type": "auditingSettings",
"apiVersion": "2021-02-01-preview",
"name": "default_2",
"properties": {
"state": "Enabled"
}
}
]
}
]
}
]
}

```
```bicep title="Positive test num. 3 - bicep file" hl_lines="16 2"
```bicep title="Positive test num. 2 - bicep file" hl_lines="16 2"
resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = {
name: 'sqlServer1'
location: resourceGroup().location
Expand Down Expand Up @@ -117,9 +74,7 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi
}

```
<details><summary>Positive test num. 4 - bicep file</summary>

```bicep hl_lines="2"
```bicep title="Positive test num. 3 - bicep file" hl_lines="2"
resource sqlServer1 'Microsoft.Sql/servers@2021-02-01-preview' = {
name: 'sqlServer1'
location: resourceGroup().location
Expand Down Expand Up @@ -149,8 +104,7 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi
}

```
</details>
<details><summary>Positive test num. 5 - json file</summary>
<details><summary>Positive test num. 4 - json file</summary>

```json hl_lines="8 15"
{
Expand Down Expand Up @@ -179,7 +133,7 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi

```
</details>
<details><summary>Positive test num. 6 - json file</summary>
<details><summary>Positive test num. 5 - json file</summary>

```json hl_lines="8 15"
{
Expand Down Expand Up @@ -207,7 +161,7 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi

```
</details>
<details><summary>Positive test num. 7 - json file</summary>
<details><summary>Positive test num. 6 - json file</summary>

```json hl_lines="8 23"
{
Expand Down Expand Up @@ -249,7 +203,7 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi

```
</details>
<details><summary>Positive test num. 8 - json file</summary>
<details><summary>Positive test num. 7 - json file</summary>

```json hl_lines="8 23"
{
Expand Down Expand Up @@ -295,7 +249,7 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi

```
</details>
<details><summary>Positive test num. 9 - json file</summary>
<details><summary>Positive test num. 8 - json file</summary>

```json hl_lines="8"
{
Expand Down Expand Up @@ -335,6 +289,52 @@ resource sqlServer1_sqlDatabase1_default 'Microsoft.Sql/servers/databases/auditi
]
}

```
</details>
<details><summary>Positive test num. 9 - json file</summary>

```json hl_lines="8"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2021-02-01-preview",
"name": "sqlServer1",
"location": "[resourceGroup().location]",
"properties": {},
"resources": [
{
"type": "auditingSettings",
"apiVersion": "2021-02-01-preview",
"name": "default_1",
"properties": {
"state": "Disabled"
}
},
{
"type": "databases",
"apiVersion": "2021-02-01-preview",
"name": "sqlDatabase1",
"location": "[resourceGroup().location]",
"properties": {},
"resources": [
{
"type": "auditingSettings",
"apiVersion": "2021-02-01-preview",
"name": "default_2",
"properties": {
"state": "Enabled"
}
}
]
}
]
}
]
}

```
</details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,56 @@ resource webSitePositive3 'Microsoft.Web/sites@2020-12-01' = {

```
</details>
<details><summary>Positive test num. 13 - bicep file</summary>

```bicep hl_lines="5"
resource webSitePositive7 'Microsoft.Web/sites@2020-12-01' = {
name: 'webSitePositive7'
location: 'location1'
tags: {}
identity: {
type: 'UserAssigned'
}
properties: {
enabled: true
httpsOnly: true
}
}

```
</details>
<details><summary>Positive test num. 14 - json file</summary>

```json hl_lines="18"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.39.26.7824",
"templateHash": "623030832249271008"
}
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"name": "webSitePositive7",
"location": "location1",
"tags": {},
"identity": {
"type": "UserAssigned"
},
"properties": {
"enabled": true,
"httpsOnly": true
}
}
]
}
```
</details>


#### Code samples without security vulnerabilities
Expand Down
Loading
Loading