Skip to content

feat: add rule AZ-CMP-005 Trusted Launch (Secure Boot + vTPM) check - #273

Merged
Vishnu2707 merged 2 commits into
OWASP:devfrom
shariqueahmad108-ship-it:rule/az-cmp-005-trusted-launch
Sep 18, 2026
Merged

Vishnu2707 merged 2 commits into
OWASP:devfrom
shariqueahmad108-ship-it:rule/az-cmp-005-trusted-launch

Conversation

@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor

What

Implements Rule 1 of #269AZ-CMP-005, flagging Generation 2 VMs that don't have Trusted Launch (Secure Boot and vTPM) fully enabled. (Per the issue's Coordination note, the Managed Identity rule was descoped, so this PR is the sole remaining scope.)

Follows the scanner/rules/ one-file-per-rule template, with the matching remediation playbook and compliance-framework mappings.

Detection logic

  • Compliantsecurity_type == "TrustedLaunch" and both uefi_settings.secure_boot_enabled and v_tpm_enabled are True.
  • Gen1 = NOT_APPLICABLE. A VM's list_all() representation doesn't carry its Hyper-V generation, so the rule resolves the OS disk's hyper_v_generation (via azure_client.get_disk(), the same pattern AZ-CMP-002 uses) to confirm a VM is Gen2 before flagging. A readable Gen1 disk reports V1 and is skipped — no false finding against hardware that can't run Trusted Launch.
  • security_type == "TrustedLaunch" but Secure Boot / vTPM off is Gen2-only by definition, so it's flagged without needing a disk lookup.
  • Confidential VMs (Secure Boot + vTPM by construction) are out of scope and skipped.
  • Unknown generation (OS disk unreadable / missing) is deliberately left unflagged — an unreadable disk could be Gen1, and the issue explicitly asks that Gen1 not produce a false finding. This mirrors the repo's existing "never treat an indeterminate result as a violation" stance (AZ-CMP-002). Trade-off: a Gen2 VM whose disk generation can't be read is a possible false negative; I erred toward zero Gen1 false positives, but happy to switch to surfacing it as a distinct low-severity/unknown result if you'd prefer the AZ-CMP-002 treatment.

Compliance mappings (all four framework JSONs)

Framework Control Rationale
NIST CSF PR.DS-6 Firmware/software integrity verification (Secure Boot + vTPM measured boot)
ISO 27001 A.12.5.1 Installation of software on operational systems — only signed boot code runs
SOC 2 CC6.8 Prevents/detects unauthorized software at boot
CIS N/A-CMP-005 CIS Azure Foundations 2.0.0 has no dedicated Trusted Launch recommendation, so this uses the repo's existing N/A convention (as in AZ-KV-001) rather than a fabricated control id — glad to renumber if there's a preferred mapping.

Tests

Six unit tests added to tests/test_rules_compute.py (mock-based, no network):

  • compliant TrustedLaunch → no findings
  • Gen2 (disk V2) without a security profile → one MEDIUM finding
  • TrustedLaunch declared but vTPM off → flagged without a disk lookup
  • Gen1 (disk V1) → NOT_APPLICABLE, no finding
  • unknown generation (disk unreadable) → not flagged
  • Confidential VM → not flagged
231 passed   # full rule-test suite (tests/test_rules_*.py + test_pqc_rules.py)
ruff check .            → clean
ruff format --check .   → clean

Honest testing note

I don't have an Azure subscription, so I could not run the issue's "tested against a real Azure free-trial subscription" step — the live checkboxes below are left unchecked for a maintainer/reviewer to confirm. The rule is fully covered by the unit tests above (compliant / non-compliant / Gen1 / unknown / confidential) and the fixtures mirror the real SDK attribute shapes (SecurityProfile.security_type, UefiSettings.secure_boot_enabled / v_tpm_enabled, Disk.hyper_v_generation).

Test plan (from the issue)

  • Compliant case returns no findings (unit)
  • Non-compliant case returns correct finding (unit)
  • Gen1 VMs return NOT_APPLICABLE, not a false finding (unit)
  • CLI playbook written (fix_az_cmp_005.sh)
  • All four compliance framework JSONs updated
  • Tested against a real Azure free-trial subscription (needs maintainer — no Azure access on my side)

Closes #269

dipeshrayg added a commit to dipeshrayg/openshield that referenced this pull request Aug 14, 2026
AZ-CMP-005 collided with OWASP#273 (Trusted Launch check), opened a day
before this PR and already claiming that rule ID. Renumbered the rule
file, playbook, tests, and all four compliance framework entries to
AZ-CMP-006.

Also fixes a false-positive gap flagged in review: the rule only
checked for an NSG on the VMSS network interface configuration itself,
missing the case where the NSG is attached at the subnet level
instead. A VMSS whose NIC has no NSG but deploys into a
subnet that does have one was being incorrectly flagged. Now resolves
each network interface configuration's subnet (via the existing
get_virtual_networks() collector, no new collector needed) and treats
either a NIC-level or subnet-level NSG as compliant, matching how
AZ-NET-010 already reads subnet.network_security_group.

Added SOC2 to the rule's own FRAMEWORKS dict (was previously only in
soc2.json, inconsistent with how several other rules, e.g. AZ-KV-006,
already include it directly).

Addresses review feedback from TFT444 and m-khan-97 on OWASP#275.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>
parthrohit22
parthrohit22 previously approved these changes Aug 16, 2026

@parthrohit22 parthrohit22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work @shariqueahmad108-ship-it ,
Solid rule. I like that you didn't just flag every VM without Trusted Launch - you actually resolve Gen1 vs Gen2 via the OS disk and treat "can't determine" as NOT_APPLICABLE instead of guessing, which keeps this from throwing false positives on VMs that physically can't support it. Confidential VM carve-out is a nice touch too. Verified the SDK fields (security_type, uefi_settings, secure_boot_enabled, v_tpm_enabled, hyper_v_generation) against the real azure-mgmt-compute models, all match. 562 passed, clean lint. No conflict with #275's AZ-CMP-006. LGTM, approving.

@Vishnu2707
Vishnu2707 requested review from Vishnu2707 and removed request for SHAURYAKSHARMA24, TFT444 and ritiksah141 August 17, 2026 23:17

@Vishnu2707 Vishnu2707 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing before merge though, the playbook uses RG=$1 and VM=$2 directly, with set -u that'll just crash instead of showing the usage message if someone runs it with no args. Same issue @TFT444 flagged on KV-006 before, just needs ${1:-} and ${2:-} like fix_az_net_016.sh already does. That should be a quick fix though.

# Note: only supported on Gen2 VM sizes/images; the update requires a restart to take effect.

set -euo pipefail

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use ${1:-} and ${2:-} like how it is present in fix_az_net_016.sh to avoid further bugs

shariqueahmad108-ship-it added a commit to shariqueahmad108-ship-it/openshield that referenced this pull request Aug 20, 2026
Use ${1:-}/${2:-} so running the playbook with missing arguments prints the
usage message and exits 1, instead of crashing on an unbound variable under
`set -euo pipefail`. Matches the convention in fix_az_net_016.sh.

Addresses review feedback from @Vishnu2707 on OWASP#273.

Signed-off-by: shariqueahmad108-ship-it <shariqueahmad108@gmail.com>
@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor Author

Good catch @Vishnu2707 — fixed in 3415de1. Switched to ${1:-}/${2:-} (matching fix_az_net_016.sh) so a no-arg or partial-arg run prints the usage message and exits 1 instead of tripping set -u on an unbound variable. Verified both the zero-arg and one-arg cases now print usage cleanly. Thanks for the review!

@TFT444 TFT444 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single blocking issue: fix_az_cmp_005.sh uses RG=\ and VM=\ with set -u at the top. Running the script without arguments crashes before the usage message is printed. Change both to \ and , matching the pattern in fix_az_net_016.sh. Everything else looks good.

@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor Author

Thanks @TFT444 — that one's already handled: fix_az_cmp_005.sh was updated in 3415de1 to use RG="${1:-}" / VM="${2:-}" (lines 9-10, matching fix_az_net_016.sh), so a no-arg run prints the usage message and exits 1 instead of tripping set -u. Vishnu2707 raised the same point earlier and it's fixed on the current head. Could you re-check 3415de1? Happy to adjust if you're seeing something different.

@TFT444

TFT444 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

@shariqueahmad108-ship-it branch have conflict solve it please
thank u

Adds a Compute scan rule that flags Generation 2 VMs which do not have
Trusted Launch fully enabled (security type TrustedLaunch with both Secure
Boot and vTPM on). Without them, unsigned or malicious code can run during
boot and persist beneath the OS, evading OS-level antimalware and EDR.

Generation 1 VMs cannot use Trusted Launch and are treated as NOT_APPLICABLE:
a VM's list_all() representation does not carry its Hyper-V generation, so the
rule resolves the OS disk's hyper_v_generation to confirm a VM is Gen2 before
flagging, and never raises a false finding against Gen1 hardware. A security
type already declared as TrustedLaunch is itself Gen2-only, so a
Secure-Boot/vTPM-off VM there is flagged without a disk lookup. Confidential
VMs (which provide Secure Boot and vTPM by construction) are out of scope, and
a VM whose generation cannot be confirmed is left unflagged rather than
risking a Gen1 false positive.

Includes the remediation playbook (playbooks/cli/fix_az_cmp_005.sh) and maps
the rule across the four compliance frameworks: NIST CSF PR.DS-6, ISO 27001
A.12.5.1, and SOC 2 CC6.8. CIS uses the repository's existing N/A convention
(as in AZ-KV-001) because CIS Azure Foundations 2.0.0 has no dedicated Trusted
Launch recommendation. Adds six unit tests covering the compliant,
non-compliant Gen2, TrustedLaunch-declared-but-vTPM-off, Gen1 NOT_APPLICABLE,
unknown-generation, and Confidential-VM cases.

Closes OWASP#269

Signed-off-by: shariqueahmad108-ship-it <shariqueahmad108@gmail.com>
@shariqueahmad108-ship-it
shariqueahmad108-ship-it force-pushed the rule/az-cmp-005-trusted-launch branch from 3415de1 to 67d21d7 Compare August 31, 2026 08:55
shariqueahmad108-ship-it added a commit to shariqueahmad108-ship-it/openshield that referenced this pull request Aug 31, 2026
Use ${1:-}/${2:-} so running the playbook with missing arguments prints the
usage message and exits 1, instead of crashing on an unbound variable under
`set -euo pipefail`. Matches the convention in fix_az_net_016.sh.

Addresses review feedback from @Vishnu2707 on OWASP#273.

Signed-off-by: shariqueahmad108-ship-it <shariqueahmad108@gmail.com>
dipeshrayg added a commit to dipeshrayg/openshield that referenced this pull request Aug 31, 2026
AZ-CMP-005 collided with OWASP#273 (Trusted Launch check), opened a day
before this PR and already claiming that rule ID. Renumbered the rule
file, playbook, tests, and all four compliance framework entries to
AZ-CMP-006.

Also fixes a false-positive gap flagged in review: the rule only
checked for an NSG on the VMSS network interface configuration itself,
missing the case where the NSG is attached at the subnet level
instead. A VMSS whose NIC has no NSG but deploys into a
subnet that does have one was being incorrectly flagged. Now resolves
each network interface configuration's subnet (via the existing
get_virtual_networks() collector, no new collector needed) and treats
either a NIC-level or subnet-level NSG as compliant, matching how
AZ-NET-010 already reads subnet.network_security_group.

Added SOC2 to the rule's own FRAMEWORKS dict (was previously only in
soc2.json, inconsistent with how several other rules, e.g. AZ-KV-006,
already include it directly).

Addresses review feedback from TFT444 and m-khan-97 on OWASP#275.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>
@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor Author

Done — rebased onto the latest dev and resolved the conflicts, @TFT444. The overlaps were purely additive: the compliance-framework JSONs and tests/test_rules_compute.py had gained the AZ-CMP-006/007 entries and tests since this branch was opened, so I kept both those and the AZ-CMP-005 additions. The branch now merges cleanly (no conflicts), all four framework JSONs are valid, and the compute rule tests pass (AZ-CMP-005 and AZ-CMP-007 side by side). Thanks!

Use ${1:-}/${2:-} so running the playbook with missing arguments prints the
usage message and exits 1, instead of crashing on an unbound variable under
`set -euo pipefail`. Matches the convention in fix_az_net_016.sh.

Addresses review feedback from @Vishnu2707 on OWASP#273.

Signed-off-by: shariqueahmad108-ship-it <shariqueahmad108@gmail.com>
@shariqueahmad108-ship-it
shariqueahmad108-ship-it force-pushed the rule/az-cmp-005-trusted-launch branch from 67d21d7 to 50f5930 Compare September 1, 2026 07:30
@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor Author

Friendly ping on this one — it's green across all 20 checks and mergeable now that the rebase conflict and the ruff-format issue are both sorted. @TFT444 your original blocker (the set -u arg handling) was fixed back in the earlier commit, so happy for you to re-check or dismiss whenever you have a moment; @parthrohit22 good to merge if you're happy. Thanks both!

@TFT444 TFT444 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My prior blocking issue (fix_az_cmp_005.sh crashing on missing args under set -u) is resolved in commit 50f5930. The playbook now uses RG="${1:-}" / VM="${2:-}" with the subsequent null-guard, matching the fix_az_net_016.sh pattern exactly as requested.

Blocker resolved

playbooks/cli/fix_az_cmp_005.sh lines 9-10: RG="${1:-}" / VM="${2:-}" are present, followed by the if [ -z "$RG" ] || [ -z "$VM" ] usage guard on lines 12-15. Running the script with no arguments now prints the usage message and exits 1 instead of crashing on unbound variables.

Rule correctness — no new issues found

  • SDK fields verified: security_profile.security_type, security_profile.uefi_settings.secure_boot_enabled, uefi_settings.v_tpm_enabled, storage_profile.os_disk.managed_disk.hyper_v_generation all match the real azure-mgmt-compute models.
  • azure_client.get_virtual_machines(), azure_client.get_disk(), and azure_client.parse_resource_id() all exist in scanner/azure_client.py.
  • Indeterminate handling is correct: security_profile is None causes _trusted_launch_fully_enabled to return False and _os_disk_generation to return None, and the rule skips with no false finding. The uefi variable re-reads from security_profile before building finding metadata so None propagates cleanly.
  • The Gen2-without-security-profile case is sound: security_type == "TrustedLaunch" is itself a Gen2 attestation, so no disk lookup is needed for TrustedLaunch-declared-but-vTPM-off.

RULE_ID collision with PR #275 — resolved

PR #275 originally claimed AZ-CMP-005. That was blocked in the #275 review and #275 was subsequently renamed to AZ-CMP-006. No collision exists.

Compliance mappings: All 4 framework JSONs include AZ-CMP-005. NIST CSF PR.DS-6, ISO 27001 A.12.5.1, SOC 2 CC6.8 are legitimate mappings. CIS uses N/A-CMP-005 with a clear rationale (no dedicated CIS Azure Foundations 2.0.0 recommendation), consistent with the existing AZ-KV-001 convention.

Test coverage: 6 tests cover compliant TrustedLaunch, non-compliant Gen2 with no security profile, TrustedLaunch-declared-but-vTPM-off, Gen1 NOT_APPLICABLE, unknown-generation skip, and Confidential VM skip. The intentional false-negative trade-off for unreadable-disk Gen2 VMs is documented and mirrors AZ-CMP-002's stance.

Playbook: bash -n passes. The az vm update invocation uses the correct flags (--security-type TrustedLaunch --enable-secure-boot true --enable-vtpm true).

Note for maintainers: Vishnu2707's CHANGES_REQUESTED review remains active in the GitHub UI (same fix, same commit). The fix commit directly addresses that feedback; a maintainer should ask Vishnu2707 to re-review before merging.

@TFT444
TFT444 requested a review from ritiksah141 September 5, 2026 13:31
@m-khan-97

Copy link
Copy Markdown
Collaborator

Thanks for the follow-up. I checked the current head (50f5930): the playbook now uses the safe argument defaults and a usage guard before any Azure command. Tanvir has already approved this revision; the remaining changes-requested review is from @Vishnu2707 on that same argument-handling issue. Vishnu, could you re-check the fix and update your review when you have a moment? @parthrohit22, your earlier approval was dismissed, so please refresh it against this head if you are still happy with the changes. Let us clear these through re-review before merging; I have not dismissed anyone’s review.

@parthrohit22 parthrohit22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed 50f5930.

The rule is in good shape and matches the fail-safe design I liked on the first pass:

  • Gen1 VMs and VMs whose generation can't be confirmed as V2 are skipped, never flagged.
  • security_type == "TrustedLaunch" with Secure Boot / vTPM off is flagged directly (TrustedLaunch is Gen2-only, so no disk lookup needed); everything else resolves the Hyper-V generation from the managed OS disk and only flags a confirmed V2.
  • ConfidentialVM is correctly out of scope.
  • _trusted_launch_fully_enabled() requires is True for both secure_boot_enabled and v_tpm_enabled, so a missing/None value is not treated as compliant.

fix_az_cmp_005.sh now runs under set -euo pipefail with ${1:-} / ${2:-} and a usage guard before any az call — the arg-handling issue from the earlier reviews is resolved (TFT444 has since approved). Framework mappings follow the existing convention (N/A-CMP-005 for CIS, real control ids for NIST/ISO/SOC2). 6 AZ-CMP-005 tests pass locally, bash -n on the playbook is clean, and all PR checks are green.

Approving. The only outstanding change request is @Vishnu2707's from Aug 17, which predates the set -u fix.

dipeshrayg added a commit to dipeshrayg/openshield that referenced this pull request Sep 10, 2026
AZ-CMP-005 collided with OWASP#273 (Trusted Launch check), opened a day
before this PR and already claiming that rule ID. Renumbered the rule
file, playbook, tests, and all four compliance framework entries to
AZ-CMP-006.

Also fixes a false-positive gap flagged in review: the rule only
checked for an NSG on the VMSS network interface configuration itself,
missing the case where the NSG is attached at the subnet level
instead. A VMSS whose NIC has no NSG but deploys into a
subnet that does have one was being incorrectly flagged. Now resolves
each network interface configuration's subnet (via the existing
get_virtual_networks() collector, no new collector needed) and treats
either a NIC-level or subnet-level NSG as compliant, matching how
AZ-NET-010 already reads subnet.network_security_group.

Added SOC2 to the rule's own FRAMEWORKS dict (was previously only in
soc2.json, inconsistent with how several other rules, e.g. AZ-KV-006,
already include it directly).

Addresses review feedback from TFT444 and m-khan-97 on OWASP#275.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

@Vishnu2707 Vishnu2707 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary changes have been made, hence approving!

@Vishnu2707
Vishnu2707 merged commit 2c4eba7 into OWASP:dev Sep 18, 2026
20 checks passed
m-khan-97 pushed a commit that referenced this pull request Sep 19, 2026
* feat: add VM Scale Set inventory collector and rule AZ-CMP-005

Adds AzureClient.get_virtual_machine_scale_sets() (list_all across the
subscription, following the get_virtual_machines() pattern) and its
MockAzureClient test double.

Ships AZ-CMP-005 as the first rule to use it: flags VMSS network
interface configurations that provision a public IP with no NSG
attached, the VMSS-template equivalent of AZ-CMP-001's per-VM NIC
check. Detection reads the network interface configuration template
directly (network_interface_configurations[].ip_configurations[] /
.network_security_group) rather than resolving separate NIC resources,
since a VMSS profile embeds these settings inline.

Includes a remediation playbook (az vmss update --set on the network
profile, with an explicit warning about the required instance
upgrade), collector and rule tests, and compliance framework mappings.
CIS is mapped to N/A-CMP-005 following the repository's established
convention for the same real control (7.1, owned by AZ-CMP-001)
applied to a second resource type, since the one-CIS-ID-per-rule
convention doesn't allow reusing 7.1 directly.

Closes #271

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

* fix: renumber AZ-CMP-005 to AZ-CMP-006, fix subnet-NSG false positive

AZ-CMP-005 collided with #273 (Trusted Launch check), opened a day
before this PR and already claiming that rule ID. Renumbered the rule
file, playbook, tests, and all four compliance framework entries to
AZ-CMP-006.

Also fixes a false-positive gap flagged in review: the rule only
checked for an NSG on the VMSS network interface configuration itself,
missing the case where the NSG is attached at the subnet level
instead. A VMSS whose NIC has no NSG but deploys into a
subnet that does have one was being incorrectly flagged. Now resolves
each network interface configuration's subnet (via the existing
get_virtual_networks() collector, no new collector needed) and treats
either a NIC-level or subnet-level NSG as compliant, matching how
AZ-NET-010 already reads subnet.network_security_group.

Added SOC2 to the rule's own FRAMEWORKS dict (was previously only in
soc2.json, inconsistent with how several other rules, e.g. AZ-KV-006,
already include it directly).

Addresses review feedback from TFT444 and m-khan-97 on #275.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

* fix: distinguish unresolved subnet from confirmed no-NSG in AZ-CMP-006

subnet_nsgs.get(subnet_id, False) treated an unresolved subnet
reference (VNet collection failure, missing permissions, or a subnet
ID this scan never saw) identically to a resolved subnet confirmed to
have no NSG, reintroducing the false-positive the previous commit was
meant to fix.

Now distinguishes three states per ip_configuration: resolved+has NSG
(compliant), resolved+no NSG (confirmed non-compliant, HIGH), and
unresolved (indeterminate, LOW), mirroring the confirmed/indeterminate
pattern already established in az_cmp_002.py. Also normalizes subnet
IDs to lowercase before comparison, since Azure resource IDs are
case-insensitive and the two APIs involved (VMSS network profile vs.
VNet subnets) aren't guaranteed to return matching casing.

Adds regression tests for an unresolved subnet (VNet collection
returns empty) and for a differently-cased subnet ID match.

Addresses review feedback from ritiksah141 on #275.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

* fix: resolve _subnet_id name collision from rebasing onto AZ-CMP-007

AZ-CMP-007 (merged into dev while this branch was in review) and this
branch's subnet-NSG fix for AZ-CMP-006 each defined their own
_subnet_id() helper with different signatures. Landing them in the
same file after the rebase left two same-named functions, and the
second definition silently shadowed the first, breaking the AZ-CMP-007
subnet-exposure test. Renamed this branch's helper to
_vnet_subnet_id() to remove the collision.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

* fix: three real gaps in AZ-CMP-006 flagged by review

- Only ip_configurations that actually carry a public IP are checked
  against subnet NSG state. A non-primary ip_config with no public IP
  is not internet-reachable, so its subnet must not be able to force
  a finding on an otherwise-compliant net_config.
- Removed the break after the first non-compliant net_config. A VMSS
  with several exposed configs now gets one finding per config instead
  of silently hiding every attack surface after the first.
- Indeterminate findings now carry vnets_collected in metadata, so a
  persistent zero across many findings is visible as a VNet-collection
  problem instead of reading as an ordinary per-subnet indeterminate
  result.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

* fix: require all public ip_configs protected, not any, in AZ-CMP-006

A net_config can carry several public ip_configs on different
subnets. 'any(status is True for status in subnet_statuses)' treated
the whole net_config as compliant if any one of them was subnet
-protected, even when another public ip_config on the same net_config
was still exposed on an unprotected subnet.

Compliance now requires every public ip_config to be protected. A
confirmed-unprotected ip_config makes the net_config non-compliant
regardless of whether another ip_config on it is merely unresolved,
matching the existing confirmed-beats-indeterminate severity model.

Added a regression test: two public ip_configs on different subnets,
one protected and one not, expecting one confirmed HIGH finding.

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>

---------

Signed-off-by: Dipesh Ray <dipesh.ray.g@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scanner): add AZ-XXX-000/AZ-XXX-000 Trusted Launch and Managed Identity rules

5 participants