Skip to content
Report library
Purpose / Development

Azure Diagnostics Skill Security Audit

What the author says it does (original text)

Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, troubleshoot functions, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl canno

Independent security check

Do not install or run it yet

This check is incomplete. Only available results are shown below.

Files checked
51
Risks found
3
Could it run dangerous commands?Looks for programs run straight after downloading, remote control of your computer, and hidden commands.Risks found: 1
High risk

May let someone control your computer remotely

Source references: 3
What we found

This code can set up a connection for remote commands. It may be a testing feature; check whether it would actually run.

Why this matters

Running this code could let someone send commands to your computer over the internet, read files, or change settings.

Legitimate use of this code

This is not a reverse shell. When nc is unavailable, the code uses Bash `/dev/tcp` only to test a connection to the user-supplied messaging host and port, terminating an unfinished probe after five seconds. It does not connect the socket to a command shell or accept remote commands. It does make an expected outbound connection, so users can restrict targets to approved Azure namespaces.

This assessment concerns the code and conditions shown, not proof that harm has occurred.
scripts/test-messaging-connectivity.sh:108In the codeOpen original file
    # Fallback: bash /dev/tcp with a background timeout.    ( exec 3<>"/dev/tcp/$host/$port" ) >/dev/null 2>&1 &    local pid=$!
Show 2 other places
scripts/test-messaging-connectivity.sh:107In the codeOpen original file
    fi    # Fallback: bash /dev/tcp with a background timeout.    ( exec 3<>"/dev/tcp/$host/$port" ) >/dev/null 2>&1 &    local pid=$!
scripts/test-messaging-connectivity.sh:111In the codeOpen original file
    local waited=0    while kill -0 "$pid" 2>/dev/null; do        sleep 1        waited=$((waited + 1))        if [ "$waited" -ge 5 ]; then            kill "$pid" 2>/dev/null            wait "$pid" 2>/dev/null            return 1        fi
Could it expose your files or keys?Looks for uploads of files containing passwords or keys, and keys written directly in the code.Risks found: 2
Medium risk

“All failing pods” mode prints application logs across every namespace

Source references: 4
What we found

Without a namespace, the script lists every non-Running/non-Succeeded pod in the cluster and prints current and previous-instance logs for each. Production logs can contain tokens, personal data, request content, or internal addresses, which then enter the agent session, terminal history, or copied diagnostic report.

Why this matters

An identity with cluster read access can collect unrelated workloads’ information and sensitive logs beyond the incident’s intended scope.

The risk is supported, though this is an explicit diagnostic feature rather than evidence of malicious exfiltration. With `--all-failing` and no namespace, the script scans all namespaces and prints current and previous-instance logs for every matching pod. Those logs may contain tokens, personal data, or internal addresses and may remain in terminal or agent-session records. Users can require a specific namespace/pod and redact output before sharing; the author could add log filtering or a separate confirmation.

scripts/pod-evidence.sh:124In the codeOpen original file
    # Avoids `mapfile`, which is unavailable in Bash 3.2 / macOS.    if [ -n "$NAMESPACE" ]; then        SCAN_ARGS=(-n "$NAMESPACE")    else        SCAN_ARGS=(-A)    fi    set +e    SCAN_OUT=$(kubectl get pods "${SCAN_ARGS[@]}" --field-selector=status.phase!=Running,status.phase!=Succeeded --no-headers -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name 2>/dev/null)    SCAN_RC=$?
Show 3 other places
scripts/pod-evidence.sh:97In the codeOpen original file
    echo "--- LOGS (current, last $TAIL lines) ---"    kubectl logs "$pod" -n "$ns" --tail="$TAIL" 2>&1 || echo "(no current logs)"    echo ""    echo "--- PREV LOGS (previous instance, last $TAIL lines) ---"    if kubectl logs "$pod" -n "$ns" --previous --tail="$TAIL" 2>/dev/null; then        :    else        echo "(no previous-instance logs - pod has not restarted or they were rotated)"    fi
scripts/pod-evidence.sh:147In the codeOpen original file
    echo "Found ${#ROWS[@]} unhealthy pod(s). Collecting evidence for each below."    echo ""    for row in "${ROWS[@]}"; do        [ -z "$row" ] && continue        ns="${row%% *}"        name="${row##* }"        digest_pod "$ns" "$name"    done    echo "pod-evidence: done. Reviewed ${#ROWS[@]} failing pod(s) - use the STATE/EVENTS/LOGS above to pick a fix."
scripts/pod-evidence.sh:149In the codeOpen original file
    echo ""    for row in "${ROWS[@]}"; do        [ -z "$row" ] && continue        ns="${row%% *}"        name="${row##* }"        digest_pod "$ns" "$name"    done
Medium risk

Function App lookup outputs telemetry connection strings and can match the wrong resources

Source references: 3
What we found

The preferred ARG query joins the Function App to every App Insights component solely by resource group and projects each component’s instrumentation key and connection string. The guide itself acknowledges that the match is by resource group rather than a verified link.

Why this matters

Results can disclose telemetry credentials and workspace identifiers for components unrelated to the target Function App, while also steering diagnosis toward the wrong telemetry data.

The risk is supported. The preferred query joins the Function App to every App Insights component in the same resource group using only `rg`, then outputs instrumentation keys and full connection strings; the guide explicitly acknowledges this matching method. Results may therefore expose telemetry credentials and misidentify unrelated components as linked. Users can require key/connection-string fields to be omitted, return resource identifiers only, and verify the relationship through the Function App's actual settings.

references/functions/README.md:7In the instructionsOpen original file
A single ARG query returns the App Insights name, instrumentation key, connection string, and Log Analytics workspace for a given function app:```bashaz graph query -q "resources | where type =~ 'microsoft.web/sites' and name == '<func-app-name>'| project funcName=name, rg=resourceGroup| join kind=inner (resources | where type =~ 'microsoft.insights/components' | project appiName=name, rg=resourceGroup, instrumentationKey=properties.InstrumentationKey, connectionString=properties.ConnectionString, workspaceId=properties.WorkspaceResourceId) on rg| project funcName, appiName, instrumentationKey, connectionString, workspaceId" -o json```
Show 2 other places
references/functions/README.md:18In the instructionsOpen original file
> 💡 **Tip:** This join matches by resource group. If App Insights is in a different resource group, use the CLI fallback below.
references/functions/README.md:10In the instructionsOpen original file
```bashaz graph query -q "resources | where type =~ 'microsoft.web/sites' and name == '<func-app-name>'| project funcName=name, rg=resourceGroup| join kind=inner (resources | where type =~ 'microsoft.insights/components' | project appiName=name, rg=resourceGroup, instrumentationKey=properties.InstrumentationKey, connectionString=properties.ConnectionString, workspaceId=properties.WorkspaceResourceId) on rg| project funcName, appiName, instrumentationKey, connectionString, workspaceId" -o json```
Could it delete files or keep running?Looks for broad file deletion, disk overwrites, and programs set to start automatically.No risks found
Could it bypass safety checks?Looks for skipped website security checks, excessive file access, or actions that skip your approval.No risks found
Could it mislead the AI or hide text?Checks the skill instructions for requests to ignore you, influence the report, or hide text in invisible characters.No risks found
Could it change links or payment recipients without asking?Looks for forced referral or payment changes combined with instructions to hide the change.No risks found

Inside this skill

8 instruction sections

The Skill troubleshoots Azure production incidents by checking resource health before logs, metrics, and recent changes, and its main rules require documenting findings and attempted remediation.

View source
SKILL.md:35In the instructionsOpen original file
1. Start with systematic diagnosis flow2. Use AppLens (MCP) for AI-powered diagnostics when available3. Check resource health before deep-diving into logs4. Select appropriate troubleshooting guide based on service type5. Document findings and attempted remediation steps6. Route AKS incidents to the dedicated AKS troubleshooting document

The normal AKS baseline scripts read Azure cluster, node-pool, and activity data plus Kubernetes nodes, pods, and warning events; an optional namespace causes an additional pod listing.

View source
scripts/aks-baseline.sh:83In the codeOpen original file
section "1. Cluster provisioning state"run "cluster provisioning state" \    az aks show -g "$RESOURCE_GROUP" -n "$CLUSTER" ${AZ_SUB_ARGS[@]+"${AZ_SUB_ARGS[@]}"} \        --query "{name:name, provisioningState:provisioningState, powerState:powerState.code, k8sVersion:currentKubernetesVersion, fqdn:fqdn}" \        -o table# 2. Node pool summary ---------------------------------------------------------section "2. Node pool summary"run "node pool summary" \    az aks nodepool list -g "$RESOURCE_GROUP" --cluster-name "$CLUSTER" ${AZ_SUB_ARGS[@]+"${AZ_SUB_ARGS[@]}"} \        --query "[].{name:name, mode:mode, count:count, vmSize:vmSize, state:provisioningState, powerState:powerState.code, k8sVersion:orchestratorVersion}" \        -o table# 3. Recent Azure activity -----------------------------------------------------section "3. Recent Azure activity (last 20 events)"run "recent activity log" \    az monitor activity-log list -g "$RESOURCE_GROUP" ${AZ_SUB_ARGS[@]+"${AZ_SUB_ARGS[@]}"} \        --max-events 20 \        --query "[].{time:eventTimestamp, operation:operationName.value, status:status.value, resource:resourceId}" \        -o table
scripts/aks-baseline.sh:103In the codeOpen original file
# 4. Node readiness ------------------------------------------------------------section "4. Node readiness"run "node readiness" kubectl get nodes -o wide# 5. Unhealthy pods ------------------------------------------------------------# Filter on the READY and STATUS columns (not just pod phase) so container-level# failures such as CrashLoopBackOff / ImagePullBackOff — which stay in phase# "Running" — are caught. Terminal pods (Completed/Succeeded) are excluded so# finished jobs are not falsely flagged.section "5. Unhealthy pods (CrashLoopBackOff, not Ready, restarting, or bad status)"ALL_PODS="$(kubectl get pods -A -o wide 2>/dev/null)"if [ -z "$ALL_PODS" ]; then
scripts/aks-baseline.sh:135In the codeOpen original file
# 6. kube-system health --------------------------------------------------------section "6. kube-system health"run "kube-system pods" kubectl get pods -n kube-system -o wide# 7. Recent warning events -----------------------------------------------------section "7. Recent warning events (last 40, sorted by time)"run "warning events" bash -c \    "set -o pipefail; kubectl get events -A --field-selector=type=Warning --sort-by=.lastTimestamp 2>/dev/null | tail -n 40"# 8. Namespace pod overview (optional) ----------------------------------------if [ -n "$NAMESPACE" ]; then    section "8. Pods in namespace '$NAMESPACE'"    run "pods in namespace $NAMESPACE" kubectl get pods -n "$NAMESPACE" -o widefi

The combined App Service and Container Apps scripts use the current Azure CLI identity to read configuration, deployments, domains, or runtime logs and print them to standard output; no instruction to upload those results is shown.

View source
scripts/appservice-diagnostics.sh:69In the codeOpen original file
echo "--- Recent Deployments (last 3) ---"az webapp deployment list -n "$APP" -g "$RG" "${SUB_ARGS[@]}" \    --query "[:3].{id:id, status:status, time:end_time}" -o table || echo "(failed to list deployments)"echo ""echo "--- App Settings (names only) ---"az webapp config appsettings list -n "$APP" -g "$RG" "${SUB_ARGS[@]}" \    --query "[].name" -o tsv || echo "(failed to list app settings)"echo ""echo "--- Custom Domains ---"az webapp config hostname list -g "$RG" --webapp-name "$APP" "${SUB_ARGS[@]}" -o table || echo "(failed to list custom domains)"echo ""
scripts/containerapp-diagnostics.sh:67In the codeOpen original file
echo "--- Registry Config ---"az containerapp show --name "$APP" -g "$RG" "${SUB_ARGS[@]}" \    --query "properties.configuration.registries" || echo "(failed to read registry config)"echo ""echo "--- Ingress Config ---"az containerapp show --name "$APP" -g "$RG" "${SUB_ARGS[@]}" \    --query "properties.configuration.ingress" || echo "(failed to read ingress config)"echo ""echo "--- Recent Logs (last 20 lines) ---"az containerapp logs show --name "$APP" -g "$RG" "${SUB_ARGS[@]}" --tail 20 || echo "(failed to read logs)"echo ""

The VM and AKS guides explicitly treat restarts, deletion, scaling, upgrades, credential resets, and extension-backed commands as operations requiring safety checks or user approval.

View source
troubleshooting/aks/aks-troubleshooting.md:112In the instructionsOpen original file
## Guardrails- default to read-only diagnostics- do not restart, delete, cordon, drain, scale, upgrade, or reconfigure resources unless the user explicitly asks for remediation- do not conclude root cause without quoting the evidence that supports it
troubleshooting/compute/vm-troubleshooting.md:29In the instructionsOpen original file
## Guardrails- Default to read-only diagnostics; quote evidence before concluding root cause.- Do not run extension-backed commands (`az vm user update`, `az vm user reset-ssh`, `az vm user reset-remote-desktop`, `az vm run-command invoke`) until [Pre-Flight Safety Checks](references/cannot-connect-to-vm.md#pre-flight-safety-checks) pass.- Do not restart, redeploy, deallocate, or delete unless the user explicitly approves remediation.- If multiple issues appear, fix network-layer blockers before agent-dependent fixes.
Start here · InstructionsSKILL.md
azure-diagnostics
Lines connect the instruction file to its sections, not an observed execution order. Select a section to read the source.

File reference map

References: 40
Files making referencesReferenced content
Lines show actual file references, not execution order. Select a node to highlight its connections and inspect the files and source locations. Dashed lines include files that still need locating.
Files and check records51 files

Coverage and gaps

  • Some results did not pass evidence validation or finish processing. This report does not represent a complete check.
Content covered in each file

These are the source ranges included in this check, not a guarantee that every issue has been resolved.

  • SKILL.mdFull text included
  • scripts/aks-baseline.ps1Full text included
  • scripts/aks-baseline.shFull text included
  • scripts/appservice-diagnostics.ps1Full text included
  • scripts/appservice-diagnostics.shFull text included
  • scripts/containerapp-diagnostics.ps1Full text included
  • scripts/containerapp-diagnostics.shFull text included
  • scripts/pod-evidence.ps1Full text included
  • scripts/pod-evidence.shFull text included
  • scripts/run-ig.ps1Full text included
  • scripts/run-ig.shFull text included
  • scripts/test-messaging-connectivity.ps1Full text included
  • scripts/test-messaging-connectivity.shFull text included
  • references/app-service/README.mdFull text included
  • references/azure-resource-graph.mdFull text included
  • references/container-apps/README.mdFull text included
  • references/functions/README.mdFull text included
  • references/kql-queries.mdFull text included
  • troubleshooting/aks/aks-troubleshooting.mdFull text included
  • troubleshooting/compute/vm-troubleshooting.mdFull text included
  • troubleshooting/messaging/README.mdFull text included
  • troubleshooting/aks/general-diagnostics.mdFull text included
  • troubleshooting/aks/load-balancer-and-ingress.mdFull text included
  • troubleshooting/aks/network-policy.mdFull text included
  • troubleshooting/aks/networking.mdFull text included
  • troubleshooting/aks/node-issues.mdFull text included
  • troubleshooting/aks/pod-failures.mdFull text included
  • troubleshooting/aks/references/aks-mcp.mdFull text included
  • troubleshooting/aks/references/command-flows.mdFull text included
  • troubleshooting/aks/references/inspektor-gadget.mdFull text included
  • troubleshooting/aks/references/structured-input-modes.mdFull text included
  • troubleshooting/aks/spot-and-zone-issues.mdFull text included
  • troubleshooting/aks/upgrade-operations.mdFull text included
  • troubleshooting/compute/references/cannot-connect-to-vm.mdFull text included
  • troubleshooting/compute/references/credential-auth-errors.mdFull text included
  • troubleshooting/compute/references/firewall-blocking.mdFull text included
  • troubleshooting/compute/references/network-connectivity.mdFull text included
  • troubleshooting/compute/references/rdp-connectivity.mdFull text included
  • troubleshooting/compute/references/rdp-service-config.mdFull text included
  • troubleshooting/compute/references/ssh-connectivity.mdFull text included
  • troubleshooting/compute/references/vm-agent-not-responding.mdFull text included
  • troubleshooting/messaging/auth-best-practices.mdFull text included
  • troubleshooting/messaging/azure-eventhubs-dotnet.mdFull text included
  • troubleshooting/messaging/azure-eventhubs-java.mdFull text included
  • troubleshooting/messaging/azure-eventhubs-js.mdFull text included
  • troubleshooting/messaging/azure-eventhubs-py.mdFull text included
  • troubleshooting/messaging/azure-servicebus-dotnet.mdFull text included
  • troubleshooting/messaging/azure-servicebus-java.mdFull text included
  • troubleshooting/messaging/azure-servicebus-js.mdFull text included
  • troubleshooting/messaging/azure-servicebus-py.mdFull text included
  • troubleshooting/messaging/service-troubleshooting.mdFull text included

This report is for the version above. We read the available code and instructions without running the skill or checking extra packages it installs. This is not a promise of safety: a different version or setup may behave differently.

  • SKILL.mdInstructions
  • references/app-service/README.mdSupporting file
  • references/azure-resource-graph.mdSupporting file
  • references/container-apps/README.mdSupporting file
  • references/functions/README.mdSupporting file
  • references/kql-queries.mdSupporting file
  • scripts/aks-baseline.ps1Script
  • scripts/aks-baseline.shScript
  • scripts/appservice-diagnostics.ps1Script
  • scripts/appservice-diagnostics.shScript
  • scripts/containerapp-diagnostics.ps1Script
  • scripts/containerapp-diagnostics.shScript
  • scripts/pod-evidence.ps1Script
  • scripts/pod-evidence.shScript
  • scripts/run-ig.ps1Script
  • scripts/run-ig.shScript
  • scripts/test-messaging-connectivity.ps1Script
  • scripts/test-messaging-connectivity.shScript
  • troubleshooting/aks/aks-troubleshooting.mdSupporting file
  • troubleshooting/aks/general-diagnostics.mdSupporting file
  • troubleshooting/aks/load-balancer-and-ingress.mdSupporting file
  • troubleshooting/aks/network-policy.mdSupporting file
  • troubleshooting/aks/networking.mdSupporting file
  • troubleshooting/aks/node-issues.mdSupporting file
  • troubleshooting/aks/pod-failures.mdSupporting file
  • troubleshooting/aks/references/aks-mcp.mdSupporting file
  • troubleshooting/aks/references/command-flows.mdSupporting file
  • troubleshooting/aks/references/inspektor-gadget.mdSupporting file
  • troubleshooting/aks/references/structured-input-modes.mdSupporting file
  • troubleshooting/aks/spot-and-zone-issues.mdSupporting file
  • troubleshooting/aks/upgrade-operations.mdSupporting file
  • troubleshooting/compute/references/cannot-connect-to-vm.mdSupporting file
  • troubleshooting/compute/references/credential-auth-errors.mdSupporting file
  • troubleshooting/compute/references/firewall-blocking.mdSupporting file
  • troubleshooting/compute/references/network-connectivity.mdSupporting file
  • troubleshooting/compute/references/rdp-connectivity.mdSupporting file
  • troubleshooting/compute/references/rdp-service-config.mdSupporting file
  • troubleshooting/compute/references/ssh-connectivity.mdSupporting file
  • troubleshooting/compute/references/vm-agent-not-responding.mdSupporting file
  • troubleshooting/compute/vm-troubleshooting.mdSupporting file
  • troubleshooting/messaging/README.mdSupporting file
  • troubleshooting/messaging/auth-best-practices.mdSupporting file
  • troubleshooting/messaging/azure-eventhubs-dotnet.mdSupporting file
  • troubleshooting/messaging/azure-eventhubs-java.mdSupporting file
  • troubleshooting/messaging/azure-eventhubs-js.mdSupporting file
  • troubleshooting/messaging/azure-eventhubs-py.mdSupporting file
  • troubleshooting/messaging/azure-servicebus-dotnet.mdSupporting file
  • troubleshooting/messaging/azure-servicebus-java.mdSupporting file
  • troubleshooting/messaging/azure-servicebus-js.mdSupporting file
  • troubleshooting/messaging/azure-servicebus-py.mdSupporting file
  • troubleshooting/messaging/service-troubleshooting.mdSupporting file

Operations mentioned in code and instructions

Run commands
scripts/aks-baseline.sh:1In the codeOpen original file
#!/usr/bin/env bash# aks-baseline.sh
scripts/aks-baseline.sh:141In the codeOpen original file
section "7. Recent warning events (last 40, sorted by time)"run "warning events" bash -c \    "set -o pipefail; kubectl get events -A --field-selector=type=Warning --sort-by=.lastTimestamp 2>/dev/null | tail -n 40"
scripts/appservice-diagnostics.sh:1In the codeOpen original file
#!/usr/bin/env bash# appservice-diagnostics.sh
Connect to websites
scripts/test-messaging-connectivity.ps1:91In the codeOpen original file
    try {        $resp = Invoke-WebRequest -Uri "https://$fqdn/" -Method Get -TimeoutSec 15 `            -UseBasicParsing -ErrorAction Stop
scripts/test-messaging-connectivity.sh:134In the codeOpen original file
# On success the namespace returns an Atom feed or HTTP 401 — either proves the# endpoint is reachable. A connection failure (curl exit != 0) means blocked.https_result() {
scripts/test-messaging-connectivity.sh:136In the codeOpen original file
https_result() {    if ! command -v curl >/dev/null 2>&1; then        # No curl: fall back to a plain TCP probe of 443.
Read keys or account settings
scripts/pod-evidence.sh:134In the codeOpen original file
    if [ "$SCAN_RC" -ne 0 ]; then        echo "ERROR: unable to list pods (kubectl exited $SCAN_RC). Check your cluster context and credentials." >&2        exit 1
references/container-apps/README.md:7In the instructionsOpen original file
|---------|--------------|-----------|| Image pull failure | ACR credentials missing | `az containerapp registry set --identity system` || ACR build fails | ACR Tasks disabled (free sub) | Build locally with Docker |
references/container-apps/README.md:81In the instructionsOpen original file
- Dockerfile `EXPOSE` statement- `process.env.PORT` or hardcoded port in app
Change files
troubleshooting/aks/networking.md:17In the instructionsOpen original file
# Only use it after the user explicitly approves a mutating test.kubectl run netdebug --image=curlimages/curl -it --rm -n <ns> -- \  curl -sv http://<service>.<ns>.svc.cluster.local:<port>/healthz
troubleshooting/aks/networking.md:57In the instructionsOpen original file
# Optional live DNS test from the same namespace as the failing podkubectl run dnstest --image=busybox:1.28 -it --rm -n <ns> -- \  nslookup <service-name>.<ns>.svc.cluster.local
Lines read
4,528
File checksum (to compare versions)
d2bff75f15ff73a9468f426ec87337daf97faebb439faef80afe01a9ed95fe9f