Skip to content

feat(scanner): add AZ-XXX-000 Just-In-Time VM access not configured #270

Description

@parthrohit22

Rule Details

  • Rule ID: AZ-XXX-000
  • Severity: MEDIUM
  • Category: Compute
  • Frameworks: CIS / NIST

What does it detect?

VMs with management ports (22, 3389, etc.) reachable without Microsoft Defender for Cloud
Just-In-Time (JIT) VM access enabled — those ports are open on a standing basis instead of only
during an approved, time-boxed request.

Detection logic

Cross-reference each VM against Defender for Cloud's JIT policies
(Microsoft.Security/locations/jitNetworkAccessPolicies) for the VM's subscription/region. Flag
VMs with management ports open per their NSG rules that have no matching JIT policy covering them.

Why is this a security risk?

Standing-open management ports are continuously scanned and brute-forced — see the real-world
precedent already documented for AZ-NET-001/002 in docs/adding-a-rule.md (SSH/RDP exposed to the
internet). JIT reduces the exposure window to only when access is actively needed and approved.

Remediation steps

Enable JIT VM access in Defender for Cloud for the affected VM and ports, or via
az security jit-policy create.

Test plan

  • Tested against real Azure free trial subscription
  • Compliant case returns no findings
  • Non-compliant case returns correct finding
  • VMs with no management ports open correctly return NOT_APPLICABLE
  • CLI playbook written and tested
  • All four compliance framework JSONs updated

Kept separate from issue 8 because it depends on the Defender for Cloud JIT policy API — a
different collector than the two plain VM-property checks bundled there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-ruleAdding a new misconfiguration scan rulepriority: mediumShould be fixed soon but not blocking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions