Skip to content
jusso-devPublic

About

Diagram-driven Azure Infrastructure as Code, with a rules engine that knows when the picture is wrong.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

148 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bunya logo

Bunya

Diagram-driven Azure Infrastructure as Code, with a rules engine that knows when the picture is wrong.

Bunya canvas with the three-tier private architecture template loaded

Bunya turns Azure architecture diagrams into production-shaped Terraform, Bicep, ARM, az CLI, PowerShell, an audit-only Azure Policy initiative, Mermaid, and an auto-generated README, in one pass. The diagram is the input. The IaC is the output. And before anything is emitted, the graph is checked against 293 cited rules drawn from PSRule, Checkov, Azure Policy, the Microsoft Cloud Security Benchmark, the Australian ISM, and the Essential Eight.

Skip to: How it works - Generators - Rules engine - Organisation rule engine - MCP server - Local dev - Known gaps


Why Bunya is not just another diagram tool

There are dozens of tools that draw Azure boxes and arrows. Most of them are diagram-first: pretty PNGs, awkward export buttons, and IaC output that no serious engineer would put in front of a terraform plan. Bunya inverts that. The diagram is a UI for the graph, the graph is the source of truth, and the generators are the thing the project is actually judged on.

What that means in practice:

Most diagram tools Bunya
Boxes and arrows are the artefact The graph is the artefact, diagram is a view
Export-to-Terraform is a half-finished feature Six generators with snapshot tests
Edges are decoration Edges have semantics: network, identity, data, depends_on, diagnostic - and they shape the generated resources
One Resource Group, hard-coded Multi-RG architectures with nested containers, parent-aware emitters
Free text validation if any 293 rules, each citing an authoritative publisher
"Looks good" is the gate Every rule has an autofix or an explainable failure

The whole point is the IaC. Drop a Resource Group on the canvas, drop an App Service Plan and a Web App inside it, connect them with a data edge to Storage and an identity edge to Key Vault, and click Terraform. What comes out is real, idiomatic HCL with role assignments, diagnostic settings, and managed-identity wiring. Click Bicep and the same graph emits idiomatic Bicep, not a transliteration. Click PowerShell and the same graph emits splatted, Set-StrictMode-aware Az cmdlets that pass -WhatIf.

Built for Australian compliance

The product is opinionated about where data lives and how it talks. Default region is australiaeast. Cross-region edges are flagged. Cosmos DB with multi-region writes inside an Australia-resident workload raises a finding. Resource names that don't pass the Azure Naming Tool's regex are caught at design time, not at terraform apply. The Australian Government Information Security Manual and the ACSC Essential Eight are first-class rule sources, not afterthoughts.

If you are building for IRAP-aligned hosting, the rules engine is the part of this tool that earns its keep.


How it works

Palette ─┐
         ├─ drag/click ─┐
Templates┘              │
                        ▼
                  ┌───────────┐
                  │   Graph   │ ◄── Zod-validated, undo/redo, share URL
                  └─────┬─────┘
                        │
            ┌───────────┼────────────┐
            ▼           ▼            ▼
    ┌──────────┐ ┌──────────┐ ┌──────────┐
    │ Validate │ │  Render  │ │ Generate │
    │293 rules │ │ ReactFlow│ │  6 IaC   │
    └────┬─────┘ └──────────┘ └────┬─────┘
         │                         │
         ▼                         ▼
    Findings panel           Terraform, Bicep,
    with citations           ARM, az CLI,
    + autofix buttons        PowerShell, Mermaid,
                             README + zip download
  1. Drag a service from the palette onto the canvas. Hit-test places the node inside the smallest container that accepts it. Resource Groups accept anything except other RGs. Virtual Networks accept Subnets. App Service Plans accept Web Apps and Function Apps.
  2. Drag from a node handle to another node to connect them. The edge kind is inferred from the pair: App Service -> Storage is data, App Service -> Key Vault is identity, anything -> Log Analytics is diagnostic. Invalid connections are blocked at drag-time with a toast explaining why.
  3. Right panel auto-generates a form from the selected node's Zod schema. Numeric ranges, enum dropdowns, boolean toggles, JSON record editors.
  4. The validation panel runs after every change. Findings link back to nodes and edges; auto-fixable ones get a button.
  5. The output panel emits six IaC formats plus an auto-README. Copy any file, download any file, or hit "Download all" for a zip you can drop into a fresh repo and terraform apply.

The whole thing is client-side. No backend, no accounts, no telemetry. Persistence is localStorage plus three escape hatches:

  • Share URL - gzips the graph into the URL fragment. Paste, open, same canvas.
  • Image (JPEG / PNG) - the buttons at the top right of the canvas download the whole diagram as a picture, in the current light or dark theme, for documents and slides.
  • Export - downloads a versioned .bunya.json envelope ({ format, version, exportedAt, generator, document }). Hand it to a colleague, attach it to a Jira ticket, check it into a repo. It survives schema migrations because it pins schemaVersion and runs through lib/graph/migrate.ts on load.
  • Import - via the toolbar button OR by dragging a .bunya.json or ARM template JSON file onto the canvas. You can also paste Azure Portal Export Template ARM JSON into the import dialog. Malformed files surface an explanation without clobbering the current graph.

Supported services and import

Bunya currently models 26 Azure service/resource types:

  • Scaffold: Resource Group.
  • Network: Virtual Network, Subnet, Network Security Group, Private Endpoint, Private DNS Zone, Front Door, Application Gateway.
  • Compute: App Service Plan, Web App (App Service), Function App, Static Web App, Azure Kubernetes Service, Virtual Machine Scale Set.
  • Data: Storage Account, Azure SQL Database, Cosmos DB, Container Registry.
  • Security and identity: Key Vault, User-Assigned Managed Identity, Role Assignment.
  • Observability: Application Insights, Log Analytics Workspace, Monitor Alert Rule, Action Group.
  • Integration: API Management.

ARM import is an approximation: unsupported resources are skipped, and settings outside Bunya's model may use defaults. Import warnings identify skipped resources, defaulted settings and locations that cannot be represented. Review the diagram and its settings before generating deployment files.

ARM import is designed for the Azure Portal Export Template workflow. Paste the ARM JSON or upload the file, and Bunya converts supported resources into a working graph:

  • Resource Groups, Virtual Networks, App Service Plans and their children are imported as nested containers where appropriate.
  • App Service Plans become bounding boxes for Web Apps and Function Apps.
  • AKS and VMSS imports preserve subnet references, node sizing, networking settings, managed identity, availability zones, monitoring hints and Log Analytics links where ARM exposes them.
  • Private Endpoints import their subnet and target service edges.
  • Private DNS Zones, VNet links and Private Endpoint DNS zone groups import as graphable DNS nodes and network edges.
  • Function Apps infer backing Storage Account edges from AzureWebJobsStorage and ARM app settings.
  • Role Assignments, Monitor Alert Rules and Action Groups import as explicit graph nodes where the exported template contains them.
  • Unsupported ARM resources are skipped with a warning instead of failing the whole import.
  • Resource condition values are evaluated from the template alone (literals, parameter defaults and template-only functions). A condition that is true keeps the resource. One that is false, depends on a value only known at deployment, or is not a boolean leaves the resource out, with a warning that says which.
  • copy loops are not expanded. A resource with a copy block, and a virtual network's copied subnets, are left out with a warning; draw one resource for each instance yourself. A resource left out also leaves out the resources nested in it.

Generators

Each generator is a pure function (graph) -> GeneratedFile[]. Every change to a generator forces a snapshot diff, so output regressions are visible on PRs. Implicit resources (Function App without Storage, App Service without Plan, Private Endpoint without Subnet) are inserted with a comment marker so the user can promote them to explicit nodes.

Target Files emitted Idiom
Terraform versions.tf, main.tf, variables.tf, outputs.tf AzureRM 4.x. Per-resource module-friendly layout. Role assignments for identity edges. Diagnostic settings per diagnostic edge. Parent-aware resource_group_name. Includes AKS, VMSS, Private DNS Zone, Action Group and alert scaffolding.
Bicep main.bicep, main.parameters.json targetScope = 'resourceGroup'. @allowed decorators on enum properties. @secure() only when SQL is in the graph. Includes explicit service resources and comments where workload-specific alert/RBAC criteria need review.
ARM JSON azuredeploy.json, azuredeploy.parameters.json Verbose but valid. Dependency graph derived from edges, not hand-rolled. Emits Private DNS zones, VNet links, Private Endpoint DNS zone groups, generalized role assignments, alerts and action groups.
az CLI deploy.sh set -euo pipefail. --only-show-errors. Login check. SQL_ADMIN_PASSWORD guard only emitted when SQL is present. Emits deployable commands where CLI supports the resource cleanly and review comments for complex alert/RBAC cases.
PowerShell Deploy-Infrastructure.ps1 [CmdletBinding(SupportsShouldProcess)]. Splatting. Set-StrictMode -Version Latest. No Write-Host. Emits deployable Az cmdlets where practical and explicit review comments for complex alert/RBAC cases.
Mermaid architecture.mmd flowchart LR with per-category classDefs and edge-kind labels.
README README.md Inlined Mermaid + deployment commands per format.
Azure Policy POLICY.md, initiative.definitions.json, policy.bicep, policy-assignment.bicep, deploy-policy.sh The built-in Azure Policy definitions that check the same settings as the diagram's rules, packaged as one initiative and assigned to the deployed resource group (the script skips groups that do not exist). Audit effects only; allowed locations are the Australian regions the sovereignty rules accept. Subscription-level built-ins (Defender plans, resource-group locations) are listed, not assigned. See Runtime guardrails.
Cost cost-estimate.md + in-tab table Indicative monthly estimate per resource with AUD/USD toggle and a user-editable AUD/USD exchange rate (persisted to localStorage, plug in your treasury's number for accurate AUD). Source: https://prices.azure.com/api/retail/prices; refresh via pnpm prices:refresh.

Conditional parameters: when the graph has no SQL Database, no generator emits a SQL admin password parameter. When the graph has no Virtual Network, no generator emits networking scaffolding. The output mirrors the graph exactly.

Bicep generated for the three-tier template, side-by-side with the canvas

Cost tab showing monthly estimate per resource for the three-tier template

Rules engine

Bunya checks every graph against about 300 hand-curated rules. Every rule cites a real URL. The running app never makes HTTP calls; rules ship as committed TypeScript under lib/rules/. lib/rules/registry.ts lists every rule bundle and the upstream version it was curated against, and the nightly pnpm upstream:check reports when an upstream moves past that pin.

Bundles (rule counts per bundle are in project-docs/rules/COVERAGE.md):

  • PSRule for Azure - Storage, App Service, SQL, Cosmos, Key Vault, ACR, VNet/NSG, App Gateway, Front Door, APIM, Functions, App Insights, Log Analytics.
  • Checkov - CKV_AZURE_* checks.
  • Azure Policy built-ins - policies translated from Azure/azure-policy.
  • Azure Naming Tool - length/charset rules.
  • Bicep types - enum/range rules derived from the resource type schemas.
  • Australian Government ISM - controls including ISM-0974, ISM-1552, ISM-1525, ISM-1480, ISM-0405.
  • Essential Eight Maturity Model - strategy mappings to cloud configuration.
  • Azure Private Link FAQ - Private Endpoint topology, the single richest source for edge rules.
  • Microsoft Learn well-known patterns - reference-architecture rules.
  • Application Insights, App Service Plan, NSG and User-Assigned Identity expansions - per-service bundles under lib/rules/sources/expansion-*.
  • Bunya graph rules - lib/rules/graph-rules/, covering implicit dependencies, identity flow, observability, sovereignty, naming, cost, and compliance.

Recent graph-level coverage includes:

  • Private Endpoint DNS correctness: matching Private DNS Zone, DNS zone group and VNet link.
  • AKS hardening: kubenet retirement warning, network policy in prod, ACR identity edge, private/API exposure, Log Analytics and availability zones.
  • VMSS hardening: subnet attachment, rolling upgrade mode, health probe / Application Health extension, Azure Monitor Agent / Log Analytics and availability zones.
  • Public-network-disabled resources must have a valid private access path.
  • Identity edges generate/check Azure RBAC role-assignment intent.
  • Production graphs need Monitor Alert Rules and Action Groups, not only log storage.

Findings link to their source (source.url). Many carry an autofixId you can apply with one button. The compliance tables in project-docs/rules/COVERAGE.md are regenerated with pnpm rules:coverage. project-docs/rules/GAPS.md is honest about what is not checked: CIS Benchmarks, PCI DSS, HITRUST CSF, runtime policy, cost prediction, multi-region failover correctness.

CIS alignment (not compliance)

Bunya does not ship CIS Microsoft Azure Foundations Benchmark content; the CIS licence terms do not permit redistributing it in Bunya. Instead, rules are tagged with the CIS control a matching Azure Policy built-in is grouped under in Microsoft's CIS Azure Foundations v3.0.0 regulatory-compliance initiative. 44 rules carry tags such as cis-azure-v3.0.0:4.15, and the validation panel shows them as "Aligned: CIS Azure 3.0.0 §4.15". The mapping lives in lib/rules/compliance/policy-alignments.ts; pnpm compliance:sync copies only control IDs from Azure/azure-policy (MIT). Alignment means the same setting is checked. It does not make a workload CIS compliant (#5). Bunya does not check PCI DSS or HITRUST CSF.

Validation findings panel with a real auto-fix

Runtime guardrails (Azure Policy export)

Bunya is design-time only: it never connects to your tenant, so it does not detect drift (#8). The Azure Policy output tab bridges that gap. It exports the Azure Policy built-ins that check the same settings as the rules relevant to your diagram, as a single initiative assigned to the deployed resource group:

az deployment sub create --location australiaeast --template-file azure-policy/policy.bicep
# or
bash azure-policy/deploy-policy.sh

Every effect is Audit or AuditIfNotExists; review the compliance results in Azure Policy before switching anything to Deny. Graph-shape rules (edges, topology, naming) have no built-in policy equivalent and stay design-time.

Organisation rule engine

Bunya also has a session-scoped organisation rule engine for rules that are specific to your platform team, landing zone, IRAP boundary, or internal Azure Policy initiative. Open Org Rules in the toolbar to create rules without changing the built-in rule bundle.

Organisation rules run in the same validation pipeline as PSRule, Checkov, Azure Policy, ISM and Bunya graph rules. Findings show in the same panel, carry the configured severity, and link back to the offending node. They are stored separately from the diagram so teams can test different policy packs against the same architecture.

What the creator supports today:

  • Property violation rules - flag resources when a property is equals, not_equals, present, missing, truthy, falsy or includes a value. Example: publicNetworkAccess equals true on Web Apps, Functions, Key Vaults and Container Registries.
  • Relationship rules - require or forbid graph edges by direction, edge kind and target service. Example: VMSS must have an outgoing diagnostic edge to Log Analytics, or Storage must have an incoming network edge from Private Endpoint.
  • Service scoping - apply a rule to one service type, several service types, or every graph node.
  • Severity and enablement - set error, warning or info, then toggle individual rules on and off without deleting them.
  • Presets - add starter packs for No Public, Private Path, and Diagnostics. These are ordinary organisation rules after import, so they can be edited by exporting the pack, changing the JSON, and importing it again.

The Azure Policy import path is designed for the policy JSON teams already have. Paste an Azure Policy definition, upload a JSON policy file, or import a previous Bunya organisation rule pack. Bunya translates simple policyRule.if conditions into graph checks by mapping common ARM resource types and aliases, including:

  • Microsoft.Web/sites -> Web App / Function App style publicNetworkAccess checks where the graph exposes that property.
  • Microsoft.Storage/storageAccounts -> Storage Account public network, anonymous blob access and minimum TLS checks.
  • Microsoft.KeyVault/vaults -> Key Vault public network and purge protection checks.
  • Microsoft.ContainerRegistry/registries -> Container Registry public network access checks.
  • Microsoft.ContainerService/managedClusters -> AKS-scoped rules when the policy field can be mapped to a Bunya property.
  • Microsoft.Compute/virtualMachineScaleSets -> VMSS-scoped rules when the policy field can be mapped to a Bunya property.

Translation is intentionally conservative: if a policy condition cannot be represented as a node-property or graph-edge check, import reports that it could not extract usable rules instead of pretending runtime Azure Policy can be fully simulated in a diagram. Complex effects, parameters, deployment-time remediation and deployIfNotExists resources still belong in Azure Policy. Bunya's value is catching the design intent while the architecture is still being shaped.

Rule packs export as a versioned .bunya-rules.json envelope:

{
  "format": "bunya-organisation-rules",
  "version": 1,
  "exportedAt": "2026-06-03T00:00:00.000Z",
  "rules": [
    {
      "id": "ORG.NO.PUBLIC.INGRESS",
      "name": "No public ingress",
      "description": "Internet-facing ingress must be explicitly approved.",
      "severity": "error",
      "enabled": true,
      "serviceTypes": ["appService", "functionApp"],
      "property": {
        "key": "publicNetworkAccess",
        "operator": "equals",
        "value": true
      },
      "message": "Public network access is not allowed for these workloads."
    }
  ]
}

Rules persist in localStorage under bunya.organisationRules for the current browser session. They do not affect generated IaC directly; they affect the validation gate, which is deliberate. If an organisation rule says "no public ingress", the graph must model the private path explicitly before the design goes clean.

Containers and hierarchy

Real Azure architectures span multiple Resource Groups, Virtual Networks hold Subnets, and App Service Plans are the compute boundary for Web Apps and Function Apps. Bunya's graph models all three. Resource Groups, Virtual Networks and App Service Plans render as dashed bounding boxes with a coloured header pill. Drop a Storage Account inside an RG, a Subnet inside a VNet, or a Function App inside a Plan and it becomes a child node, dragging-bound to its parent. The generators walk the parent chain when resolving resource_group_name, virtual_network_name or serverFarmId, so re-parenting in the UI re-points the IaC.

Resource Group container with App Service Plan, App Service, Storage and Key Vault inside

Starter templates

Three templates exist; choose one from the toolbar's Templates dropdown:

  • Static web app with API - Static Web App + Function App + Storage + Application Insights pipeline.
  • Three-tier web app - App Service + SQL + Storage behind Private Endpoints, with Key Vault and Log Analytics.
  • Event-driven Functions - Function App + Storage + Cosmos DB with managed identity to Key Vault and App Insights to Log Analytics.

MCP server

Bunya includes a Node.js MCP server so an MCP-compatible assistant can turn a plain-English Azure architecture discussion into the same graph used by the editor. The connected assistant interprets the description; Bunya then builds and validates the explicit Azure service plan, returns a link that opens the diagram in the canvas, and exports the generated IaC.

It provides four tools:

  • bunya_list_services — supported Azure services, defaults and permitted connections.
  • bunya_create_diagram — creates a graph, returns Mermaid, rule findings and a Bunya view URL.
  • bunya_validate_diagram — runs the cited Azure and compliance rules against a graph.
  • bunya_export_iac — returns Terraform, Bicep, ARM JSON, az CLI, PowerShell, Azure Policy, Mermaid or README files.

Local MCP connection

The stdio process is the simplest option for desktop MCP clients. Start it with pnpm mcp, or register it in your client configuration:

{
  "mcpServers": {
    "bunya": {
      "command": "pnpm",
      "args": ["--dir", "/absolute/path/to/Bunya", "mcp"],
      "env": {
        "BUNYA_APP_URL": "http://localhost:3000/"
      }
    }
  }
}

Set BUNYA_APP_URL to the deployed Bunya editor URL when it is not running on localhost. Created diagrams are encoded in the URL fragment, so the link opens the exact graph without server-side storage.

Hosted MCP endpoint

For a remote deployment, run the stateless Streamable HTTP server:

HOST=0.0.0.0 PORT=3001 BUNYA_ALLOWED_HOSTS=bunya.example.com BUNYA_APP_URL=https://bunya.example.com/ pnpm mcp:http

It serves POST /mcp and GET /health. Default binding is loopback only. Remote binding requires an explicit comma-separated BUNYA_ALLOWED_HOSTS list (exact Host headers, including ports when used). Browser origins are rejected unless listed in BUNYA_ALLOWED_ORIGINS. Request bodies are limited to 1 MiB. Put authentication and TLS at the reverse proxy or platform edge before exposing /mcp to other people. The server does not apply infrastructure or retain diagrams; it only constructs, validates and renders graph/IaC responses.

Local development

pnpm install
pnpm dev          # http://localhost:3000
pnpm mcp          # local stdio MCP server
pnpm mcp:http     # Streamable HTTP MCP server on http://localhost:3001/mcp

Open the editor. Drag from the left palette. Click Templates to load a preset. The output panel updates live as you edit.

Scripts:

pnpm typecheck       # tsc --noEmit, strict
pnpm test            # vitest run (unit tests, snapshot coverage of every generator)
pnpm e2e             # playwright tests against the dev server (not the documentation screenshots)
pnpm e2e:pages       # playwright smoke tests against out/ served at /Bunya/ (run pnpm build:pages first)
pnpm e2e:screenshots # regenerate the README screenshots in project-docs/screenshots (opt-in; rewrites tracked PNGs)
pnpm build           # next build (Turbopack)
pnpm build:pages     # static export to out/ with the /Bunya base path (deployed on pushes to main once verification passes)
pnpm rules:verify    # every rule matches RuleSchema, no duplicate ids, >=100 total
pnpm rules:coverage  # regenerate project-docs/rules/COVERAGE.md + GAPS.md
pnpm prices:refresh  # fetch Azure Retail Prices API and stage a snapshot diff
pnpm compliance:sync --repo <azure-policy checkout>  # refresh policy metadata + CIS control IDs
pnpm icons:sync      # refresh official Azure icons from the current Microsoft pack
pnpm upstream:check  # report rule-source releases, AzureRM majors and Azure retirements

Nightly upstream sync

.github/workflows/nightly-upstream.yml runs every night (03:23 AEST) and on demand:

  • Icons: downloads the current Azure architecture icon pack and refreshes public/azure-icons/ from lib/catalogue/icon-manifest.json, byte for byte.
  • Azure Policy metadata: re-reads built-in policies and the CIS initiative, then flags mapped policies that were renamed, deprecated or removed, and newer CIS initiative versions.
  • Upstream report: PSRule, Checkov and Azure Naming Tool releases newer than the pins, new AzureRM provider majors, Azure retirement notices for modelled services, and hand-curated sources due for review.

Mechanical updates are pushed to automation/nightly-upstream as one pull request. Anything that needs a human is tracked in a single Nightly upstream report issue, which closes itself when nothing is outstanding. To let the workflow open pull requests that also trigger CI, add a BUNYA_AUTOMATION_TOKEN secret (fine-grained PAT with contents, pull requests and issues read/write). Otherwise enable "Allow GitHub Actions to create and approve pull requests"; if neither is set, the branch is still pushed and linked from the issue.

Architecture

app/(canvas)/page.tsx               # editor route
components/
  canvas/Canvas.tsx                 # React Flow wrapper
  canvas/ServiceNode.tsx            # custom service node renderer
  canvas/ContainerNode.tsx          # bounding-box for Resource Group, VNet and App Service Plan
  canvas/Toolbar.tsx                # Undo/Redo, Templates, Share, panel toggles
  canvas/OrganisationRulesPanel.tsx # custom org rules, Azure Policy import/export
  canvas/ValidationPanel.tsx        # cited findings + autofix buttons
  catalogue/ServicePalette.tsx      # 26 services in 7 categories, drag + click
  output/OutputTabs.tsx             # seven tabs, copy/download/zip
  properties/PropertiesPanel.tsx    # auto-generated form from Zod schema
lib/
  graph/schema.ts                   # Zod schemas for GraphDocument/Node/Edge
  graph/arm-import.ts               # ARM template import (arm-expressions.ts evaluates template expressions)
  graph/topology.ts                 # graph queries shared by rules and exporters
  graph/serialise.ts                # gzip + base64url share URL, localStorage
  session/store.ts                  # Zustand store, undo/redo, reparent
  session/                          # import flow, node factory, canvas geometry, presets
  catalogue/azure.ts                # Azure facts: ARM types, private link zones, roles, regions
  catalogue/services.ts             # 26-service catalogue, allowed targets
  catalogue/icons.tsx               # Azure icon assets + category theme
  catalogue/templates.ts            # three starter templates
  catalogue/connections.ts          # canConnect() drag-time validator
  generators/                       # exporters; registry.ts lists every output for the UI and MCP
  rules/                            # rules engine: schema, runtime, sources
    runtime.ts                      # validate(): built-in + organisation rules
    organisation.ts                 # session custom rules + Azure Policy translation
    registry.ts                     # every rule bundle + its upstream pin
    sources/<publisher>/rules.ts    # one hand-curated bundle per upstream source
    graph-rules/                    # Bunya's own BUNYA.* rules
scripts/
  rules-verify.ts                   # pnpm rules:verify (CI)
  serve-pages.mjs                   # serves out/ at /Bunya/ for pnpm e2e:pages (local only)
  generate-coverage.ts              # COVERAGE.md + GAPS.md generator
mcp/
  server.ts                          # stdio MCP entry point
  http.ts                            # stateless Streamable HTTP MCP entry point
  create-server.ts                   # shared MCP tools and authoring guide
  bunya.ts                           # graph construction, validation and export adapter
project-docs/
  rules/SOURCES.md                  # 20 sources, classified INGEST/MANUAL/OUT-OF-SCOPE
  rules/COVERAGE.md                 # auto-generated coverage tables
  rules/GAPS.md                     # auto-generated gap report
  screenshots/                      # captured by e2e/screenshots.spec.ts
e2e/                                # Playwright tests

Tech stack

  • Next.js 16 (App Router, Turbopack)
  • TypeScript, strict mode, no any
  • React Flow 11 for the canvas
  • Zustand for graph state
  • Zod for schema and form generation
  • Tailwind CSS v4
  • Lucide for toolbar/action icons; Azure architecture icon assets for service nodes.
  • Vitest for unit tests, Playwright for end-to-end and visual capture
  • tsx for the rules-engine build scripts

No backend. No accounts. No database. All client-side.

Microsoft icon usage

Bunya may display Microsoft or Azure product icons only in the way Microsoft permits them to be used for architecture diagrams, training materials, or documentation. See Microsoft's Azure architecture icon guidance for the current source guidance.

Do:

  • Use the icon to illustrate how products can work together.
  • In diagrams, include the product name somewhere close to the icon.
  • Use the icons as they would appear within Azure.

Don't:

  • Crop, flip, or rotate icons.
  • Distort or change icon shape in any way.
  • Use Microsoft product icons to represent Bunya or any other product or service.

Every service type uses its own icon from Microsoft's Azure architecture icon pack (currently V24), recorded with a SHA-256 hash in lib/catalogue/icon-manifest.json. pnpm icons:sync and the nightly workflow copy icons unmodified from the official pack.

Known gaps

Bunya is honest about scope. The full live list is at project-docs/rules/GAPS.md. Highlights:

  • Azure services outside the 26 modelled node types are skipped during ARM import with a warning. The most important missing first-class services are Load Balancer, Public IP, NAT Gateway, Route Table, Azure Firewall, Bastion, Data Collection Rule, Recovery Services Vault, Service Bus, Event Grid, Event Hubs, Logic Apps, Container Apps, PostgreSQL Flexible Server, Redis and Virtual Machines.
  • Monitor Alert Rule generation is intentionally scaffolded: the graph models alert ownership and routing, but metric names, dimensions and thresholds still need workload-specific review.
  • Explicit Role Assignment nodes are graphable and ARM-exportable when Bunya can resolve principal and scope. Some CLI/PowerShell/Terraform/Bicep cases emit review comments where a principal ID or exact scope cannot be inferred safely.
  • AKS node pools are modelled as properties of the AKS node, not separate draggable node-pool resources yet.
  • VMSS health probes and Azure Monitor Agent are modelled as properties today; Load Balancer probes, Application Health extension and Data Collection Rules are not first-class graph nodes yet.
  • CIS Microsoft Azure Foundations Benchmark - not ingested because it is not redistributable under its licence terms; rules carry CIS control IDs through Azure Policy alignment instead (#5).
  • PCI DSS - permanently out of scope; Bunya cannot and should not certify card workloads, so use a QSA (#6).
  • HITRUST CSF - won't fix; a commercial US-healthcare framework outside the Australian-government audience (#7).
  • Runtime policy enforcement (drift detection at runtime) - out of scope because it needs tenant credentials and a backend; export the Azure Policy initiative instead (#8).
  • AWS support, GCP support - permanently out of scope; the catalogue, rules and generators are built on Azure's resource model (#10).
  • Rule sources are pinned (PSRule v1.42.0, Checkov v3.2.0, Azure Naming Tool v3.4.0) and the Terraform generator targets AzureRM 4.x. The nightly upstream report tracks newer releases until rules are re-curated.

The bunya pine

Bunya is named after the bunya pine, Araucaria bidwillii, a tall conifer native to south-east Queensland and parts of northern New South Wales. The tree has a distinctive architectural silhouette: a straight central trunk with tiered, geometric branches stepping out at regular intervals. It looks like a system diagram already.

The bunya is also significant in Aboriginal culture. Every few years the trees produce enormous cones full of edible nuts, and historically this triggered large gatherings of nations from across the region. People travelled long distances to meet, trade, settle disputes, and share knowledge before dispersing again. That is the metaphor for what this tool does: it gathers disparate Azure services into a shared structure, makes the relationships between them explicit, and then disperses the result into the formats different teams actually use.

Contributing

Pull requests welcome. The bar:

  • pnpm typecheck clean
  • pnpm test green (add tests for new generators or rules)
  • pnpm e2e green; for UI changes also pnpm build:pages && pnpm e2e:pages (CI runs both, and Pages deploys only after they pass)
  • New rules must cite a source URL (verify.ts will block PRs that don't)
  • Generator changes get snapshot diffs reviewed
  • Australian spelling in user-facing copy

Licence

MIT. See LICENSE.

Safe import and export behavior

  • Imports and inflated share links are limited to 1 MiB, 32 nesting levels, 200 nodes and 1,000 edges. Invalid properties, duplicate IDs, dangling references and parent cycles are rejected before replacing the current diagram.
  • Deployment exporters accept plain literal values, not embedded shell/IaC expressions. Unsupported quotes, control characters and expression syntax produce a visible generation error; the editable graph remains available for JSON export.
  • NSG rules and associations are not yet emitted faithfully. Deployment export is blocked when those controls are requested, rather than silently dropping firewall intent. Diagram, README and cost outputs remain available. A complete ZIP requires all outputs to succeed.
  • SQL administrator passwords and SSH public keys have no generated defaults. Supply them securely at deployment time. Private Function App CLI exports and private web/registry PowerShell exports include companion ARM files so public access is disabled during creation, not in a later update. Keep these files together with the script. These companion deployments accept one resource group; multi-group diagrams are rejected to preserve scope.
  • Validation checks are advisory model checks, not certification or live Azure policy enforcement. Azure Policy import accepts only one recognized resource type AND one scalar violation with audit/deny effect. Unsupported compound and set conditions are rejected.
  • New, import and template replacement can be undone. Browser storage failures show a warning; use Export to retain work when storage is unavailable. Shared URLs contain the complete diagram and should be shared only with intended recipients.

ARM role assignments use explicit resource scope, following Microsoft's extension-resource guidance. Private Endpoint policies remain operator-controlled; enabling them applies NSG/route policies according to Microsoft's network-policy documentation.

About

Diagram-driven Azure Infrastructure as Code, with a rules engine that knows when the picture is wrong.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages