Skip to content

Commit 5f981a5

Browse files
kicsbotcx-artur-ribeirocx-miguel-dasilva
authored
docs(queries): update queries catalog (#7356)
Co-authored-by: ArturRibeiro-CX <153724638+ArturRibeiro-CX@users.noreply.github.com> Co-authored-by: Miguel Silva <100352574+cxMiguelSilva@users.noreply.github.com>
1 parent 05b8ce0 commit 5f981a5

File tree

3 files changed

+471
-7
lines changed

3 files changed

+471
-7
lines changed

docs/queries/common-queries/a88baa34-e2ad-44ea-ad6f-8cac87bc7c71.md

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ resource "google_container_cluster" "primary1" {
11491149
</details>
11501150
<details><summary>Positive test num. 41 - yaml file</summary>
11511151

1152-
```yaml hl_lines="20"
1152+
```yaml hl_lines="20 21"
11531153
version: '3.9'
11541154
services:
11551155
vulnerable_node:
@@ -1170,6 +1170,8 @@ services:
11701170
environment:
11711171
- POSTGRES_USER=postgres
11721172
- POSTGRES_PASSWORD=postgres
1173+
- POSTGRES_PASSWORD=string
1174+
11731175
```
11741176
</details>
11751177
<details><summary>Positive test num. 42 - tf file</summary>
@@ -2714,7 +2716,80 @@ jobs:
27142716
echo "RESTAPI_MGT_APPSEC=${restapi_mgt_appsec}" >> $GITHUB_ENV
27152717
```
27162718
</details>
2717-
<details><summary>Negative test num. 42 - dockerfile file</summary>
2719+
<details><summary>Negative test num. 42 - tf file</summary>
2720+
2721+
```tf
2722+
provider "azurerm" {
2723+
features {}
2724+
}
2725+
2726+
# Example of using an existing Key Vault and secret
2727+
data "azurerm_key_vault" "example" {
2728+
name = "your-key-vault-name"
2729+
resource_group_name = "your-resource-group"
2730+
}
2731+
2732+
data "azurerm_key_vault_secret" "LinuxVmPassword" {
2733+
name = "your-secret-name"
2734+
key_vault_id = data.azurerm_key_vault.example.id
2735+
}
2736+
2737+
resource "azurerm_linux_virtual_machine" "example_vm" {
2738+
name = "example-vm"
2739+
resource_group_name = "your-resource-group"
2740+
location = "your-location"
2741+
size = "Standard_DS1_v2"
2742+
admin_username = "adminuser"
2743+
admin_password = data.azurerm_key_vault_secret.LinuxVmPassword.value
2744+
2745+
network_interface_ids = [
2746+
# Your network interface ID
2747+
]
2748+
2749+
os_disk {
2750+
caching = "ReadWrite"
2751+
storage_account_type = "Standard_LRS"
2752+
}
2753+
2754+
source_image_reference {
2755+
publisher = "Canonical"
2756+
offer = "UbuntuServer"
2757+
sku = "18.04-LTS"
2758+
version = "latest"
2759+
}
2760+
}
2761+
2762+
output "vm_password" {
2763+
value = data.azurerm_key_vault_secret.LinuxVmPassword.value
2764+
sensitive = true
2765+
}
2766+
2767+
```
2768+
</details>
2769+
<details><summary>Negative test num. 43 - tf file</summary>
2770+
2771+
```tf
2772+
data "template_file" "sci_integration_app_properties_secret_template" {
2773+
template = file(join("", ["/secrets/sci-integration-app", var.resource_identifier_shorthand], ".json"))
2774+
2775+
vars = {
2776+
ayreshirerarran_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["ayreshirerarran_password"]
2777+
lanark_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["lanark_password"]
2778+
tayside_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["tayside_password"]
2779+
glasgow_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["glasgow_password"]
2780+
grampian_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["grampian_password"]
2781+
highland_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["highland_password"]
2782+
westernisles_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["westernisles_password"]
2783+
dumfriesandgalloway_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["dumfriesandgalloway_password"]
2784+
forthvalley_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["forthvalley_password"]
2785+
borders_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["borders_password"]
2786+
lothian_password = data.aws_kms_secrets.sci_app_kms_secrets.plaintext["lothian_password"]
2787+
}
2788+
}
2789+
2790+
```
2791+
</details>
2792+
<details><summary>Negative test num. 44 - dockerfile file</summary>
27182793

27192794
```dockerfile
27202795
FROM baseImage
@@ -2723,7 +2798,7 @@ RUN command
27232798

27242799
```
27252800
</details>
2726-
<details><summary>Negative test num. 43 - json file</summary>
2801+
<details><summary>Negative test num. 45 - json file</summary>
27272802

27282803
```json
27292804
{
@@ -2743,7 +2818,7 @@ RUN command
27432818

27442819
```
27452820
</details>
2746-
<details><summary>Negative test num. 44 - tf file</summary>
2821+
<details><summary>Negative test num. 46 - tf file</summary>
27472822

27482823
```tf
27492824
resource "google_container_cluster" "primary3" {
@@ -2768,7 +2843,7 @@ resource "google_container_cluster" "primary3" {
27682843
27692844
```
27702845
</details>
2771-
<details><summary>Negative test num. 45 - tf file</summary>
2846+
<details><summary>Negative test num. 47 - tf file</summary>
27722847

27732848
```tf
27742849
resource "google_container_cluster" "primary5" {
@@ -2793,7 +2868,7 @@ resource "google_container_cluster" "primary5" {
27932868
27942869
```
27952870
</details>
2796-
<details><summary>Negative test num. 46 - tf file</summary>
2871+
<details><summary>Negative test num. 48 - tf file</summary>
27972872

27982873
```tf
27992874
resource "google_secret_manager_secret" "secret-basic" {

0 commit comments

Comments
 (0)