AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Defender Secure Score Monitor

skill-ricmmartins-azure-sre-agent-skills-06-defender-secure-score · by ricmmartins

Monitor and improve Microsoft Defender for Cloud Secure Score. Tracks score trends, identifies quick wins to improve the score, checks Defender plan coverage, and highlights critical security recommendations. Use when asked about secure score, security posture, Defender status, or security improvements.

No reviews yet
0 installs
18 views
0.0% view→install

Install

$ agentstack add skill-ricmmartins-azure-sre-agent-skills-06-defender-secure-score

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-ricmmartins-azure-sre-agent-skills-06-defender-secure-score)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
17d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Defender Secure Score Monitor? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Defender Secure Score Monitor

Purpose

Track and improve your Microsoft Defender for Cloud Secure Score through focused monitoring, trend analysis, and actionable remediation guidance. Answers "what's our security score and how do we improve it?"

When to use this skill

  • User asks "what's our secure score?"
  • User asks how to improve security posture
  • Weekly security posture check
  • Before a security audit or customer questionnaire
  • After deploying new resources (to check score impact)

Difference from Compliance/Governance Audit

The Compliance skill does a broad governance audit (policy, RBAC, tagging, locks, naming). This skill is laser-focused on Defender for Cloud Secure Score — the single most important security KPI — and provides targeted actions to improve it.

Assessment procedure

Step 1: Current Secure Score

Get the overall score and per-control breakdown.

az rest --method get --url "https://management.azure.com/subscriptions//providers/Microsoft.Security/secureScores/ascScore?api-version=2020-01-01"
az rest --method get --url "https://management.azure.com/subscriptions//providers/Microsoft.Security/secureScores/ascScore/secureScoreControls?api-version=2020-01-01"

Note: The az security secure-scores list CLI command may fail in some environments. The REST API approach above is more reliable. Replace `` with the target subscription ID.

Report:

  • Current Secure Score: X% (X/Y points)
  • Trend (if memory available): improved/declined vs. last check
  • Top 5 controls with the most room for improvement (highest max - current)

Step 2: Unhealthy assessments (recommendations)

Get the list of active security recommendations.

az rest --method get --url "https://management.azure.com/subscriptions//providers/Microsoft.Security/assessments?api-version=2021-06-01" --query "value[?properties.status.code=='Unhealthy'].{displayName:properties.displayName, severity:properties.metadata.severity, category:properties.metadata.categories[0], resourceId:properties.resourceDetails.id}"

Group by severity:

  • 🔴 High: Must fix — significant risk
  • 🟡 Medium: Should fix — moderate risk
  • 🟢 Low: Nice to have — minimal risk

Step 3: Quick wins (most points for least effort)

Identify recommendations that:

  1. Affect the most resources (batch fix possible)
  2. Have the highest point value per control
  3. Can be fixed with a single CLI command or policy

Examples of quick wins:

  • Enable HTTPS-only on App Services
  • Enable secure transfer on storage accounts
  • Enable Defender plans that are off
  • Restrict public network access

Step 4: Defender plan coverage

Check which Defender plans are enabled.

az security pricing list --query "[].{plan:name, tier:pricingTier, subPlan:subPlan}" -o table

Expected plans to be enabled for full coverage:

  • Servers (P2 recommended)
  • App Service
  • SQL (databases)
  • Storage
  • Containers (with vulnerability assessment)
  • Key Vault
  • Resource Manager (ARM)
  • DNS

Flag disabled plans and estimate score impact of enabling them.

Step 5: Attack surface indicators

Check the most exploitable security gaps.

  1. Public management ports (SSH/RDP open to internet):

``bash az graph query -q "resources | where type == 'microsoft.network/networksecuritygroups' | mvexpand rules = properties.securityRules | where rules.properties.access == 'Allow' and rules.properties.direction == 'Inbound' and (rules.properties.destinationPortRange == '22' or rules.properties.destinationPortRange == '3389' or rules.properties.destinationPortRange == '*') and rules.properties.sourceAddressPrefix in ('*', '0.0.0.0/0', 'Internet')" -o table ``

  1. Storage accounts with public blob access:

``bash az storage account list --query "[?allowBlobPublicAccess==true].{name:name, rg:resourceGroup}" -o table ``

  1. SQL servers with public endpoint:

``bash az sql server list --query "[?properties.publicNetworkAccess=='Enabled'].{name:name, rg:resourceGroup}" -o table ``

  1. Key Vaults accessible from public network:

``bash az keyvault list --query "[?properties.publicNetworkAccess=='Enabled'].{name:name, rg:resourceGroup}" -o table ``

Step 6: Credential and certificate hygiene

Check for expiring secrets that could cause outages or security drift.

  1. Key Vault secrets expiring within 30 days (per vault):

```bash az keyvault secret list --vault-name --query "[?attributes.expires!=null && attributes.expires --query "[?attributes.expires!=null && attributes.expires The subscription is earning only ZZ% of its maximum Secure Score. There is a N-point gap to close.

Score improvement plan

| Priority | Action | Points | Effort | Resources affected | |----------|--------|--------|--------|-------------------| | 1 | Enable HTTPS-only on 4 App Services | +4 | 5 min | app-web-, app-api- | | 2 | Enable Defender for Storage | +3 | 2 min | subscription-level | | 3 | Restrict SQL public access on 2 servers | +3 | 30 min | sql-prod-, sql-staging- | | 4 | Add NSG to 2 subnets without rules | +2 | 15 min | subnet-data-, subnet-mgmt- | | Total achievable | | +12 | ~1 hour | |

Critical findings (fix now)

Items that represent immediate exploitable risk.

Remediation commands

Pre-formatted az cli commands for each quick win, ready to approve and execute. Use GetAzCliHelp to validate the command syntax before suggesting.

# Enable HTTPS-only on App Service
az webapp update --name  --resource-group  --set httpsOnly=true

# Enable Defender for Storage
az security pricing create --name StorageAccounts --tier Standard

References

  • Defender for Cloud: https://learn.microsoft.com/en-us/azure/defender-for-cloud/secure-score-security-controls
  • Security Recommendations: https://learn.microsoft.com/en-us/azure/defender-for-cloud/recommendations-reference
  • Defender Plans: https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-cloud-introduction

Recommended cadence

Schedule this skill as a weekly task via SRE Agent scheduled tasks for continuous score improvement tracking.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.