HandsOnAzure

Active researchIndependent projectUpdated November 2026

Autonomous Security Auditor: Independent, Evidence-Based Cloud Security Reviews

A read-only security auditing system for discovering what exists, evaluating controls and permission boundaries, and explaining what can, and cannot, be verified.

  • Python
  • Azure Container Apps
  • Managed identity
  • Azure Resource Manager
  • Microsoft Entra
  • Power Platform
  • Microsoft Foundry
  • Grafana
  • Terraform

See the architectureWhat works todayCode on GitHub ↗Facts last checked 2026-11-23.

Concept and motivation

Security in an enterprise system does not live in one dashboard. It is spread across resources, identities, application permissions, API policies, AI agents, connected services and the boundaries between them. A control can be missing, disabled, or simply impossible to verify with the access an auditor has.

I started ASA to try a different approach: an independent auditor that collects read-only evidence, applies deterministic rules, and uses AI only to explain findings without inventing evidence. MiniBank is the first environment under review, not a hard dependency. The design should work for other environments over time.

A strict boundary

ASA is not an enforcement or remediation platform. It does not change monitored infrastructure, grant permissions, enable Defender or Sentinel, adjust guardrails, fix configurations, block pipelines or modify business data. It discovers, assesses, reports, alerts and recommends. Anything ASA provisions or maintains is its own isolated infrastructure.

The rule that matters most: a missing permission, an unsupported API or absent evidence is NOT VERIFIED, never “secure”.

Goals and scope

  • Inventory resources, identities, relationships, network exposure and permission boundaries.
  • Assess existing and missing controls against evidence-backed rules.
  • Report audit-coverage gaps next to findings, including AI, SaaS and cross-platform boundaries.
  • Keep a history of assessments and explain changes with reproducible evidence.
  • Offer reports, a dashboard and notification-only alerts.
  • Use a Foundry model to summarize findings, while deterministic checks remain the only authority for PASS, FAIL and NOT VERIFIED.

Architecture

A scheduled scanner job runs in ASA’s own Azure resource group. Its managed identity has Reader access to the audited scope, and the collector can only issue read calls: anything else is blocked in code, and a test proves it. Collectors feed a deterministic rule engine and a trust graph, and the results are stored as timestamped snapshots in private storage. A Foundry model can write a narrative from sanitized evidence, but every claim must carry an exact citation, and a wrong citation rejects the narrative. Reports are exported as HTML, JSON and Markdown, and counts-only metrics go to Grafana. Broader Entra, Power Platform and Copilot Studio visibility is ongoing work, and sources the auditor cannot read stay explicitly unverified.

The diagram is conceptual. Solid lines are implemented and verified in this snapshot; dashed ones are not. It shows no path from ASA into the audited environment, because there is none.

ASA: collect read-only, decide deterministically, explain with citations
ASA: collect read-only, decide deterministically, explain with citationsA scheduled scanner job in ASA's own Azure resource group runs under a managed identity that has Reader access to the audited MiniBank scope and calls its APIs read-only. Collectors feed a deterministic rule engine and a trust graph; results are stored as timestamped snapshots in private storage. A Foundry model writes a narrative that must cite sanitized evidence and cannot change a verdict. Reports are produced as HTML, JSON and Markdown, and counts-only metrics go to a Grafana dashboard. ASA has no write path to the audited environment.AUDITEDMiniBank labRead-only scope, neverchangedASA · AZUREScanner jobReader identity, GETonlyASARule engine20 deterministic rulesASATrust graphConfirmed, inferred,unknownASA · AZUREEvidence storePrivate, timestampedsnapshotsFOUNDRYNarrativeCites sanitized evidenceonlyASAReportsHTML, JSON, MarkdownGRAFANADashboardCounts-only metrics
  1. Scanner job → MiniBank lab (read-only calls; there is no write path to the audited environment) verified
  2. Scanner job → Rule engine (collected evidence) verified
  3. Scanner job → Trust graph (collected relationships) verified
  4. Rule engine → Evidence store (verdicts: PASS, FAIL, NOT VERIFIED, N/A) verified
  5. Trust graph → Evidence store (each edge labelled by its weakest evidence) verified
  6. Evidence store → Narrative (sanitized evidence; the narrative is rejected if a citation is wrong) verified
  7. Evidence store → Reports verified
  8. Evidence store → Dashboard (counts-only metrics; evidence stays in private storage) verified
Text version of this diagram

A scheduled scanner job in ASA's own Azure resource group runs under a managed identity that has Reader access to the audited MiniBank scope and calls its APIs read-only. Collectors feed a deterministic rule engine and a trust graph; results are stored as timestamped snapshots in private storage. A Foundry model writes a narrative that must cite sanitized evidence and cannot change a verdict. Reports are produced as HTML, JSON and Markdown, and counts-only metrics go to a Grafana dashboard. ASA has no write path to the audited environment.

  1. Scanner job → MiniBank lab (read-only calls; there is no write path to the audited environment): verified.
  2. Scanner job → Rule engine (collected evidence): verified.
  3. Scanner job → Trust graph (collected relationships): verified.
  4. Rule engine → Evidence store (verdicts: PASS, FAIL, NOT VERIFIED, N/A): verified.
  5. Trust graph → Evidence store (each edge labelled by its weakest evidence): verified.
  6. Evidence store → Narrative (sanitized evidence; the narrative is rejected if a citation is wrong): verified.
  7. Evidence store → Reports: verified.
  8. Evidence store → Dashboard (counts-only metrics; evidence stays in private storage): verified.

Implementation

  • Python scanner with typed collector and rule interfaces. Provider code is separate, so other clouds and agent platforms can be added later.
  • 20 deterministic rules covering identity and access, data, network, authorization at sensitive steps, logging, AI agents and tools, OAuth, data-loss prevention, detection, and prompt injection.
  • Evidence model: every result carries a status (PASS, FAIL, NOT VERIFIED, NOT APPLICABLE), the source, the scope, the collection time and a confidence. A PASS without evidence and a NOT VERIFIED without a reason are rejected by the model itself.
  • Prompt-injection handling: text from logs and tool results is treated as untrusted data, fenced away from instructions, and never reaches a tool that can write.
  • Terraform and Azure: ASA’s own resource group, a key vault for the credential it needs to push metrics, a Container Apps job on a schedule, private storage and a remote state. The shared state store and the audited environment are separate.
  • Offline first: a demo mode produces synthetic secure, insecure and unobservable fixtures, always labelled as synthetic.

Design decisions

A running log. I add an entry when I make a decision that shapes ASA, and I keep the old ones, so the reasoning stays visible as the project changes. Newest first. The four oldest are the architecture decision records in the repository.

  1. 2026-11-23 Do not give the scheduled job broad tenant consent

    Why
    Running as a scheduled job under its own identity, ASA sees less of Power Platform and Entra than I do with my own login. Some of the missing reads, such as tenant-wide data-loss-prevention policies, need a role that is not read-only.
    Decision
    Grant only narrow, read-only roles, ordered from least to most privilege, each with my approval. Do not register the job as a management app for policies. Leave what stays out of reach as NOT_VERIFIED, and collect it only in scans I run myself, labelled as such.
    Consequence
    The scheduled report has lower coverage than an interactive scan and says so. The auditor never holds a privilege it could misuse.
  2. 2026-11-22 The dashboard holds counts only

    Why
    A dashboard in an external service should not become a second copy of the evidence.
    Decision
    Push only counts per status, rule and severity to Grafana. Evidence and snapshots stay in ASA's private storage, and the dashboard says so in its own About panel.
    Consequence
    The dashboard cannot drill down to the evidence. That needs a separate, authenticated path, which is still to be designed.
  3. 2026-11-22 Evidence gaps and provenance are first-class

    Why
    An auditor that cannot read something must not look as if it found nothing.
    Decision
    Every node and edge records its source, API, time and mode. A denied or unsupported read becomes a gap that the rules turn into NOT_VERIFIED with the reason. Coverage is reported before findings. Relationships taken from documentation are never marked confirmed.
    Consequence
    An environment with no read permission scores low coverage instead of looking secure.
  4. 2026-11-22 Independent repository, identity and boundary

    Why
    An auditor that shares code, identity or state with what it audits is not independent.
    Decision
    ASA has its own repository, resource group, Terraform state and managed identity. MiniBank is only read, and its repository and resources are never modified. The runtime uses the standard library only, and a provider interface keeps cloud specifics out of the rules.
    Consequence
    Other clouds and agent platforms can be added later without touching the rules.
  5. 2026-11-22 Rules decide; the model explains

    Why
    A language model as the judge would be hard to reproduce, open to injected text, and able to invent findings.
    Decision
    PASS, FAIL, NOT VERIFIED and NOT APPLICABLE come only from deterministic rules over collected evidence. The model gets sanitised, fenced, read-only evidence, may correlate and narrate, and must cite findings. Its output is rejected if it cites something that does not exist.
    Consequence
    Model quality affects readability only, never correctness, and the pipeline also runs with a mock model and no cloud access.
  6. 2026-11-22 ASA is read-only and never enforces

    Why
    A security tool that can also change things becomes a high-value target and blurs the line between finding and fixing.
    Decision
    ASA discovers, assesses, reports and recommends. It never remediates, blocks, enables defences or alters what it audits. This is enforced in code (a GET-only client with a host allowlist and an agent tool allowlist) and in Terraform (write roles are rejected).
    Consequence
    A person or another pipeline has to act on findings. ASA's value is evidence and honesty about what it can see.

Current state

This is a snapshot from the project documents, commits and run records up to 2026-11-23. Result counts change with every scan, and a dated sample is not a security score, so the table describes capabilities rather than numbers; the dashboard screenshot below shows one day’s counts.

Verified live Seen working in a real run, with a record of it.Tested locally Works in automated or local tests. Not proof of live behaviour.In progress Being built, or partly working. The note says which part.Planned Designed or on the list. Nothing to show yet.Not verified Built or reported, but not confirmed in this snapshot.
CapabilityStatusEvidence and limits
Deterministic rule engineTested locally20 rules and 58 automated tests (2026-11-23). A rule can only pass with evidence, and a missing permission or API is NOT VERIFIED, never PASS. Tests check this with blanked, failing and denied data.
Read-only scan of an Azure scopeVerified liveGET-only calls, plus a read-only graph query. Real scans ran on 2026-11-22 under my own login, and then as a scheduled job in Azure under a dedicated identity that has Reader access to the audited scope.
Narrative written by a Foundry modelVerified liveA model wrote a summary from sanitised evidence, live, under both identities. A wrong citation rejects the whole narrative. No test grades the quality of the writing.
Microsoft Entra and Power Platform collectorsVerified liveGET-only, verified live under my own login. The scheduled job has narrower access by design, so its coverage is lower and the report says so.
Copilot Studio agent inventoryVerified liveReported working for the scheduled job through a read-only Dataverse role (project notes, 2026-11-23). It did not work for my own interactive login, which is why the evidence is per identity.
Logs and telemetry coverageVerified liveChecks which diagnostic settings and logs exist and whether data is arriving, as aggregates only, without reading log content. Gaps are listed as unknowns.
Trust graph and trust-path reportIn progressEvery edge is labelled confirmed, inferred or unknown, with how to confirm it. One chain is confirmed from live evidence: API gateway, function, its identity, storage. The hops through Power Platform are still inferred or unknown, and business authorization is always reported as not proven.
Snapshots, drift and notification-only alertsTested locallyTested with fixtures, and one live snapshot and drift run were done. Alerts go to a local outbox. Webhook delivery is untested.
Grafana dashboardVerified liveA running dashboard shows the current status counts, the history of findings by status, audit completeness over time, and which rules fail or cannot be verified. It is fed by counts-only metrics, and evidence stays in private storage. Screenshot below, taken 2026-11-23.
DLP policies and Entra app details for the scheduled jobNot verifiedDenied to the job by design: it is read-only and has no tenant-wide consent. Reported as NOT VERIFIED.
Hosted dashboard with sign-in, immutable evidence storagePlannedOptions are evaluated. Today the output is static HTML, JSON and Markdown, plus the metrics push.
Other environments (AWS Bedrock, MCP servers, other agent platforms)PlannedThe provider interface exists. Nothing but Azure is collected.

Engineering challenges and lessons

  • Missing visibility is not a passing check. The scheduled job sees less than I do with my own login, so ASA reports its own coverage next to its findings, and the unknowns are a first-class result.
  • Deterministic rules should own verdicts; a language model can explain them, not invent them. The first live narrative was rejected because the model shortened an asset identifier in a citation. The fix was to give every finding an exact citation string, and a wrong citation still rejects the whole narrative.
  • A trust graph is only as good as the provenance of each edge. Observed, inferred and unknown are different states, and a chain is only as strong as its weakest edge. Business authorization is never claimed without evidence.
  • A scanner with read access still deserves a threat model. Minimal permissions, private evidence storage, read-only calls enforced in code, and prompt-injection handling are part of the design, not an afterthought.
  • The auditor can be wrong too. In the first live scan, an API gateway policy with a byte-order mark in its text produced a false failure. I fixed the parser and added a regression test.

Evidence and screenshots

The first picture is the running dashboard of the MiniBank lab. The second is a report from the built-in fixture mode, and it shows the idea in one picture: when the auditor cannot read something, the result is NOT_VERIFIED and the coverage number drops. All data in the lab is invented, so nothing here describes a real organisation.

A Grafana dashboard titled ASA security audit overview: a gauge of audit completeness, tiles with the number of results per status, two history charts, and two tables listing which rules fail and which could not be verified.
The Grafana dashboard for the MiniBank lab, 23 November 2026, cropped to the panels. It shows the current number of results per status, how they changed over the past days, audit completeness (the share of checks that could be verified), and which rules fail or could not be verified. It receives counts only; the evidence behind them stays in private storage. The lab holds only invented data.
An ASA report for a synthetic environment: coverage of 4.5 percent, 21 results marked NOT_VERIFIED and none failed, with a table of findings whose summaries say what could not be observed.
The report for the built-in "unobservable" fixture: an invented environment where almost nothing can be read. Coverage is 4.5 percent, so ASA reports 21 results as NOT_VERIFIED instead of calling anything secure. Every item is synthetic and labelled SYNTHETIC FIXTURE.

Source code and reproducibility

The code is public on GitHub under the MIT licence: net9876/asa. It is a work in progress. The reproducible part is the offline demo: it needs no cloud access and produces the synthetic report shown above (./scripts/bootstrap.ps1, then asa demo). A real scan needs read-only access to an Azure scope of your own, and the Terraform for ASA’s own resources was validated but is meant to be planned and approved before it is applied.

Explore code on GitHub ↗

What’s next

  • Deeper Entra and Power Platform read-only collectors, and Copilot Studio and Foundry agent and tool scopes.
  • A verified trust and data graph for the full user-to-data path, with the unknown hops reduced one by one.
  • A dashboard with a secure drill-down to evidence, and a decision on where it is hosted.
  • Drift history and notification policies.
  • Reusable assessment packs for other environments.
  • ASA stays an auditor. It will not be given a write path.