Skip to content

Redesign airlock storage account architecture#4964

Open
rudolphjacksonm wants to merge 16 commits into
microsoft:mainfrom
marrobi:copilot/redesign-airlock-storage-accounts
Open

Redesign airlock storage account architecture#4964
rudolphjacksonm wants to merge 16 commits into
microsoft:mainfrom
marrobi:copilot/redesign-airlock-storage-accounts

Conversation

@rudolphjacksonm

Copy link
Copy Markdown
Collaborator

Resolves #4358

Note: Original pull request and comments are #4853.

Consolidate airlock storage architecture and implement metadata-based management

Summary

Redesigns the airlock storage architecture from 56+ per-workspace storage accounts (5 core + ~5 per workspace) down to 2 shared storage accounts, using container metadata to track request stages instead of physically copying blobs between accounts.

A new per-workspace airlock_version property (1 = legacy, 2 = consolidated) enables a gradual, backwards-compatible migration path.

Problem

The existing airlock design creates 5–10 storage accounts per workspace, each with private endpoints, EventGrid topics, and role assignments. At scale (100 workspaces) this results in:

  • ~56 storage accounts, 60+ private endpoints, 10+ EventGrid topics
  • ~$7,943/month in baseline infrastructure costs
  • Multi-minute stage transitions due to cross-account blob copies
  • Terraform plan times that grow linearly with workspace count

Changes

Core Terraform

  • Two new shared storage accounts: sa_airlock_core (external-facing) and sa_airlock_workspace_global (internal)
  • All legacy v1 resources (storage accounts, EventGrid topics) moved behind an enable_legacy_airlock toggle (default: true)
  • ABAC role conditions restrict API access by container metadata stage
  • App Gateway path rule for /airlock-storage/* routes public SAS requests to the consolidated account

API (api_app)

  • AirlockRequest model gains an airlock_version field (default 1)
  • StatusChangedData event includes review_workspace_id and airlock_version
  • Storage account resolution routes to legacy or consolidated accounts based on version
  • SAS URL generation uses App Gateway FQDN for publicly accessible stages

Airlock Processor (airlock_processor)

  • v1/v2 branching in StatusChangedQueueTrigger based on airlock_version
  • New blob_operations_metadata.py for in-place metadata updates (no blob copy)
  • New airlock_storage_helper.py to resolve the correct storage account per version/stage

Documentation

  • Rewrote airlock.md with the new architecture
  • Added airlock-legacy.md documenting the v1 design and migration steps

Migration path

  1. Deploy with enable_legacy_airlock = true (default) — both v1 and v2 accounts exist side-by-side
  2. Set airlock_version = 2 on individual workspaces — new requests use consolidated storage; in-flight v1 requests complete normally
  3. Once all workspaces are on v2 and no v1 requests remain, set enable_legacy_airlock = false to remove legacy accounts

Impact

Metric Before After Reduction
Storage accounts (100 WS) ~56 2 96%
Private endpoints 60+ 2–3 ~95%
EventGrid topics 10+ 2–3 ~75%
Monthly cost (100 WS) ~$7,943 ~$0 baseline ~100%
Stage transition time Minutes (blob copy) Near-instant (metadata) 97–99%

Version bumps

  • version.txt: 0.16.14 → 0.18.0
  • _version.py: 0.25.14 → 0.26.5
  • _version.py: 0.8.9 → 0.8.12

Testing

  • Tested v2 import and export flows end-to-end
  • Existing v1 logic is unmodified and continues to work for workspaces with airlock_version = 1**

Copilot AI review requested due to automatic review settings July 14, 2026 08:49
@rudolphjacksonm
rudolphjacksonm requested a review from a team as a code owner July 14, 2026 08:49
@rudolphjacksonm

rudolphjacksonm commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Review from @marrobi which needs addressing:

Review of remaining files — issues found

Terraform

  1. core/terraform/airlock/storage_accounts.tfsa_import_external was renamed in place to sa_airlock_core (and sa_import_in_progresssa_airlock_workspace_global). On existing deployments Terraform will see these as destroy + recreate of the original v1 accounts, even with enable_legacy_airlock=true (the v1 accounts are re-declared in storage_accounts_v1.tf under a count). This risks data loss / dropped v1 accounts on upgrade. A moved {} block or documented terraform state mv migration is needed.

  2. core/terraform/airlock/eventgrid_topics.tf — the for_each on azurerm_monitor_diagnostic_setting.eventgrid_system_topics merges v1 topic maps using [0] indexing gated on enable_legacy_airlock. Toggling the flag off→on can cause plan churn/index errors; worth validating the toggle in both directions in CI.

API / config

  1. api_app/services/airlock_storage_helper.pyget_storage_account_name_for_request has no final else, so unmatched statuses (e.g. Cancelled, Failed, Revoked) return None, which then flows into .format()/SAS generation. get_stage_from_status correctly returns "unknown"; the account resolver should raise or fall back consistently.

  2. api_app/services/legacy_airlock_guard.py — the guard is warning-only by default (BLOCK_DISABLE_LEGACY_AIRLOCK_IF_V1_EXISTS=false) and runs at API startup, i.e. after Terraform could already have destroyed the v1 accounts. Consider defaulting the block to true, or moving the dependency check to apply-time, so it actually prevents data loss rather than reporting it post-hoc.

Docs

  1. docs/azure-tre-overview/airlock.md — still references App Gateway routing (researcher -- "SAS token" --> appgw, "via SAS tokens (through the App Gateway)") which was removed from this PR. This should be corrected since public-stage access currently goes direct to storage.

  2. docs/azure-tre-overview/airlock.md — the ABAC condition example in "Cross-Workspace Isolation" uses pe-sa-airlock-ws-global-{workspace_short_id}, but the actual condition compares the full PE resource ID. Align the doc with the implementation.

mkdocs

  1. mkdocs.yml — the !!python/name:... tags now have a trailing empty-string scalar (e.g. format: !!python/name:pymdownx.superfences.fence_code_format ""). This is non-standard and likely breaks tag resolution / the docs build. Revert to the original form without "".

E2E

  1. e2e_tests/test_airlock_consolidated.py — the import path is CI-testable, but the export/cross-account-copy and cross-workspace ABAC denial paths are still not covered (workspace-global is private). Also the file is marked @pytest.mark.airlock but the new airlock_consolidated marker added to pytest.ini isn't applied — the selector is unused.

Housekeeping

  1. CHANGELOG.md — the same enhancement entry appears in two sections (one under a released version block); the released section shouldn't be edited. Consolidate into the single Unreleased block.

  2. Unrelated churnconfig.sample.yaml whitespace, e2e_tests/resources/workspace.py formatting, core/terraform/appgateway/appgateway.tf ip_tags, core/terraform/main.tf PE-dependency removal, and the wholesale mkdocs.yml re-indent add review noise; consider splitting into a separate PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the “airlock v2” consolidated storage design (2 shared storage accounts + metadata-based stage tracking), while keeping legacy v1 behavior available via per-workspace airlock_version and a core-level enable_legacy_airlock toggle/guardrails.

Changes:

  • Adds airlock_version workspace property and deploys either legacy (airlock) or consolidated (airlock_v2) workspace airlock Terraform.
  • Updates core Airlock Terraform to introduce consolidated storage accounts, unify EventGrid blob-created handling, and gate legacy resources behind enable_legacy_airlock.
  • Extends API + airlock processor to carry airlock_version/review_workspace_id through events and support v1/v2 execution paths; adds/updates tests and docs.

Reviewed changes

Copilot reviewed 65 out of 67 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
templates/workspaces/base/terraform/workspace.tf Switches workspace airlock module selection based on airlock_version and adds v2 module.
templates/workspaces/base/terraform/variables.tf Introduces airlock_version and marks legacy malware-scanning variables as unused in workspace TF.
templates/workspaces/base/terraform/airlock_v2/variables.tf Declares inputs for the new consolidated workspace airlock module.
templates/workspaces/base/terraform/airlock_v2/storage_accounts.tf Adds PE + ABAC-conditioned RBAC for workspace access to shared workspace-global storage.
templates/workspaces/base/terraform/airlock_v2/providers.tf Defines provider requirements/aliases for the new module.
templates/workspaces/base/terraform/airlock_v2/locals.tf Computes core RG + shared workspace-global storage account name.
templates/workspaces/base/terraform/airlock_v2/data.tf Reads core identity + core private DNS zone for use by workspace module.
templates/workspaces/base/template_schema.json Adds updateable airlock_version property to workspace schema.
templates/workspaces/base/porter.yaml Bumps base workspace bundle version and wires airlock_version parameter into TF.
templates/workspaces/airlock-import-review/terraform/import_review_resources.terraform Updates import-review workspace to support v1/v2 storage access patterns with conditional resources.
templates/workspaces/airlock-import-review/template_schema.json Adds airlock_version parameter to the import-review workspace template schema.
templates/workspaces/airlock-import-review/porter.yaml Bumps import-review bundle version and wires airlock_version into TF.
mkdocs.yml Updates MkDocs navigation to include legacy airlock + guardrails docs.
e2e_tests/test_airlock.py Removes the old “full flow” airlock test and keeps review-VM focused test.
e2e_tests/test_airlock_consolidated.py Adds new E2E tests validating consolidated (v2) airlock flows and storage routing.
e2e_tests/resources/workspace.py Minor string formatting normalization in identifier URI helper.
e2e_tests/pytest.ini Adds a marker for consolidated airlock tests.
e2e_tests/conftest.py Adjusts workspace setup fixture to support Manual/Automatic auth based on config.
docs/tre-admins/legacy-airlock-migration-guardrails.md Adds an operator runbook for safely disabling legacy v1 airlock.
docs/azure-tre-overview/airlock-legacy.md Adds documentation describing the legacy v1 per-stage storage architecture.
core/version.txt Bumps core component version.
core/terraform/variables.tf Adds enable_legacy_airlock + acknowledgement/blocking guardrail variables.
core/terraform/main.tf Passes enable_legacy_airlock into airlock module and tweaks dependencies.
core/terraform/appgateway/appgateway.tf Adjusts lifecycle ignores for App Gateway public IP tags.
core/terraform/api-webapp.tf Plumbs legacy-airlock guardrail settings into API app settings.
core/terraform/airlock/variables.tf Adds enable_legacy_airlock variable in airlock module.
core/terraform/airlock/storage_accounts.tf Introduces consolidated storage accounts and updated PE/RBAC/EventGrid wiring.
core/terraform/airlock/storage_accounts_v1.tf Adds legacy v1 storage accounts behind enable_legacy_airlock.
core/terraform/airlock/locals.tf Adds consolidated names and reintroduces v1 names conditionally for legacy mode.
core/terraform/airlock/identity.tf Removes legacy role assignments from this file (moved to v1-specific file).
core/terraform/airlock/eventgrid_topics.tf Unifies blob-created subscriptions and adds workspace-global blob-created plumbing; keeps legacy conditionally.
core/terraform/airlock/eventgrid_topics_v1.tf Adds legacy v1 EventGrid system topics/subscriptions behind enable_legacy_airlock.
core/terraform/airlock/data.tf Points diagnostic categories lookup at the new consolidated system topic.
config.sample.yaml Documents and adds new legacy-airlock config toggles.
config_schema.json Adds schema entries for legacy-airlock toggles.
CHANGELOG.md Adds unreleased changelog entry for airlock migration + related template fix.
api_app/tests_ma/test_services/test_legacy_airlock_guard.py Adds unit tests for the new API startup guard.
api_app/tests_ma/test_services/test_airlock.py Adds tests for public-stage detection and status-changed event payload additions.
api_app/tests_ma/test_services/test_airlock_storage_helper.py Adds tests for API storage-account/stage mapping logic (v1/v2).
api_app/services/legacy_airlock_guard.py Implements API startup guardrails for disabling legacy airlock safely.
api_app/services/airlock.py Adds v2 storage resolution path and updates status-changed event sending.
api_app/services/airlock_storage_helper.py Adds API helper to map request type/status/version to storage account + metadata stage.
api_app/resources/constants.py Adds consolidated storage/stage constants alongside legacy constants.
api_app/models/domain/events.py Extends StatusChangedData with review_workspace_id and airlock_version.
api_app/models/domain/airlock_request.py Adds airlock_version field to AirlockRequest domain model.
api_app/main.py Runs legacy-airlock migration guard during API startup lifespan.
api_app/event_grid/event_sender.py Includes review_workspace_id + airlock_version in emitted StatusChanged events and adjusts workspace id semantics for v2.
api_app/db/repositories/workspaces.py Adds query helper to detect active v1 workspaces.
api_app/db/repositories/airlock_requests.py Adds “in-flight v1 requests” query for guardrails and stores airlock_version on request creation.
api_app/core/config.py Adds env-driven config flags for legacy airlock enable/block behavior.
api_app/api/routes/api.py Removes redundant global openapi_definitions lines.
api_app/api/routes/airlock.py Stamps new airlock requests with workspace airlock_version.
api_app/_version.py Bumps API version.
airlock_processor/tests/test_status_change_queue_trigger.py Extends tests for v1/v2 branching, review workspace id handling, and v2 copy/metadata transitions.
airlock_processor/tests/test_blob_created_trigger.py Adds tests for v2 BlobCreated processing based on container metadata stage.
airlock_processor/tests/shared_code/test_blob_operations.py Adds tests for new blob-copy polling helper.
airlock_processor/tests/shared_code/test_blob_operations_metadata.py Adds comprehensive tests for metadata-based container operations.
airlock_processor/tests/shared_code/test_airlock_storage_helper.py Adds tests for processor storage-account/stage mapping logic (v1/v2).
airlock_processor/StatusChangedQueueTrigger/init.py Implements v1/v2 branching: metadata stage updates for v2 and legacy copy behavior for v1.
airlock_processor/shared_code/constants.py Adds consolidated storage/stage constants for processor side.
airlock_processor/shared_code/blob_operations.py Adds copy result return + blob-copy completion polling helper.
airlock_processor/shared_code/blob_operations_metadata.py Adds metadata-based container create/update/read/delete helpers for v2.
airlock_processor/shared_code/airlock_storage_helper.py Adds processor helper to map request type/status/version to storage account + metadata stage.
airlock_processor/BlobCreatedTrigger/init.py Adds v2 BlobCreated handling based on container metadata stage.
airlock_processor/_version.py Bumps airlock processor version.
.gitignore Ignores *_old.tf files.

Comment thread templates/workspaces/base/terraform/airlock_v2/storage_accounts.tf
Comment thread templates/workspaces/base/terraform/airlock_v2/storage_accounts.tf
Comment thread api_app/db/repositories/airlock_requests.py
Comment thread docs/azure-tre-overview/airlock-legacy.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md
Comment on lines +137 to 139
# Return standard blob storage URL format
return "https://{}.blob.{}/{}?{}" \
.format(account_name, STORAGE_ENDPOINT, airlock_request.id, token)
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Unit Test Results

901 tests   901 ✅  9s ⏱️
  2 suites    0 💤
  2 files      0 ❌

Results for commit 878ea01.

♻️ This comment has been updated with latest results.

@rudolphjacksonm rudolphjacksonm changed the title Copilot/redesign airlock storage accounts Redesign airlock storage account architecture Jul 14, 2026
rudolphjacksonm pushed a commit to marrobi/AzureTRE that referenced this pull request Jul 16, 2026
…t#4964)

- Add Terraform moved blocks for safe storage account state migration (sa_import_external → sa_airlock_core, sa_import_in_progress → sa_airlock_workspace_global)
- Fix storage helper to raise ValueError for unmapped airlock request statuses instead of returning None
- Change guard default to BLOCK_DISABLE_LEGACY_AIRLOCK_IF_V1_EXISTS=true to prevent data loss on misconfiguration
- Register airlock_consolidated pytest marker and apply to consolidated test suite
- Validate EventGrid diagnostic_setting for_each stability with flag toggles
- Verify docs reference full PE resource IDs in ABAC conditions (not just names)
- Confirm App Gateway routing references removed from documentation
- All 66 storage helper tests passing with enhanced error coverage
- Terraform validation passes

Item #12 (unrelated whitespace/formatting churn) deferred to separate PR to keep this PR focused.
@marrobi

marrobi commented Jul 16, 2026

Copy link
Copy Markdown
Member

@rudolphjacksonm might be able to get an agent to test this from local machine, test the import and export paths using runcommamnd on the various VMs. Would eb good to extend the e2e airlock tests (albeit not run them on each PR!)

@marrobi

marrobi commented Jul 16, 2026

Copy link
Copy Markdown
Member

original test plan: #4853 (comment)

@rudolphjacksonm
rudolphjacksonm force-pushed the copilot/redesign-airlock-storage-accounts branch from 96b5dfa to 00f2184 Compare July 17, 2026 09:02
@rudolphjacksonm

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/29574605411 (with refid 2b467883)

(in response to this comment from @rudolphjacksonm)

Copilot AI review requested due to automatic review settings July 22, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 65 out of 67 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • core/terraform/airlock/.terraform.lock.hcl: Generated file
Comments suppressed due to low confidence (1)

docs/azure-tre-overview/airlock-legacy.md:10

  • This sentence states airlock_version: 1 is "the default", but the workspace base template defaults airlock_version to 2 (see templates/workspaces/base/terraform/variables.tf). This is misleading for new deployments and migration guidance.

Comment thread core/terraform/airlock/storage_accounts.tf
Comment thread core/terraform/airlock/storage_accounts.tf
Comment thread devops/scripts/set_docker_sock_permission.sh Outdated
Comment thread devops/scripts/set_docker_sock_permission.sh Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 65 out of 67 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • core/terraform/airlock/.terraform.lock.hcl: Generated file
Comments suppressed due to low confidence (4)

docs/azure-tre-overview/airlock-legacy.md:10

  • This doc claims airlock_version: 1 is the default, but the base workspace template now defaults airlock_version to 2 (e.g., templates/workspaces/base/terraform/variables.tf sets default=2). This can mislead operators during migration/rollout.
    core/terraform/airlock/storage_accounts.tf:13
  • Same issue as the previous moved block: mapping legacy sa_import_in_progress to consolidated sa_airlock_workspace_global will churn the existing in-progress account (stalimip{tre_id}) into a different-named resource (stalairlockg{tre_id}) and then recreate the legacy account at sa_import_in_progress[0]. This is destructive for upgrades; move should target the new counted legacy address instead.
    devops/scripts/set_docker_sock_permission.sh:47
  • groupadd requires root privileges, but this script is sourced from the Makefile (not run under sudo). Without sudo here, the permission fix will fail in non-root environments.
    devops/scripts/set_docker_sock_permission.sh:51
  • usermod/chmod require elevated privileges; when this script is sourced from the Makefile without sudo, these commands will fail. Prefix with sudo to preserve the prior behavior.

Comment thread core/terraform/airlock/storage_accounts.tf
Comment thread devops/scripts/set_docker_sock_permission.sh Outdated
Copilot AI added a commit that referenced this pull request Jul 23, 2026
- Add provider = azurerm.core to data source and role assignment in
  airlock_v2/storage_accounts.tf to fix split-subscription deployments
- Fix @finalStatuses enum serialization: convert to string values for
  Cosmos SDK JSON compatibility in airlock_requests.py
- Fix incorrect 'default' claim in airlock-legacy.md (default is v2)
- Add missing PR reference to CHANGELOG.md bug fix entry
- Remove inaccurate 'via App GW/SAS' comments in airlock.py and update
  SAS URL comment to accurately describe direct storage account URLs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rudolphjacksonm

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/30008586146 (with refid 2b467883)

(in response to this comment from @rudolphjacksonm)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 66 out of 68 changed files in this pull request and generated 6 comments.

Files not reviewed (1)
  • core/terraform/airlock/.terraform.lock.hcl: Generated file

Comment thread templates/workspaces/base/terraform/variables.tf
Comment thread templates/workspaces/base/template_schema.json
Comment thread templates/workspaces/base/porter.yaml
Comment thread core/terraform/airlock/storage_accounts.tf
Comment thread templates/workspaces/airlock-import-review/template_schema.json
Comment on lines +136 to +139
- name: airlock_version
type: integer
default: 2
description: "Airlock storage version: 1 = legacy per-stage storage accounts (stalimip{tre_id}), 2 = consolidated metadata-based storage (stalairlock{tre_id})"
Copilot AI review requested due to automatic review settings July 23, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rudolphjacksonm

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/30014711207 (with refid 2b467883)

(in response to this comment from @rudolphjacksonm)

Copilot AI review requested due to automatic review settings July 23, 2026 14:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rudolphjacksonm

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/30015039317 (with refid 2b467883)

(in response to this comment from @rudolphjacksonm)

Copilot AI review requested due to automatic review settings July 23, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 23, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rudolphjacksonm

Copy link
Copy Markdown
Collaborator Author

/test-extended

@github-actions

Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/30015552628 (with refid 2b467883)

(in response to this comment from @rudolphjacksonm)

Copilot AI review requested due to automatic review settings July 24, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 65 out of 68 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • core/terraform/airlock/.terraform.lock.hcl: Generated file
Comments suppressed due to low confidence (2)

templates/workspaces/base/terraform/variables.tf:191

  • This description says the scan result topic is "no longer used" after consolidation, but it is still used for legacy v1 airlock deployments. Please clarify so operators understand when this input is required.
    api_app/services/airlock.py:145
  • SAS URL generation currently always returns the direct storage account URL (https://{account}.blob.{suffix}/...). The PR description states that publicly accessible stages should use the App Gateway FQDN/path (e.g., /airlock-storage/*) for SAS URLs. If that routing is still required, this function needs a way to switch the host for public stages (likely using is_publicly_accessible_stage + a configured gateway hostname).
    # Return standard blob storage URL format
    return "https://{}.blob.{}/{}?{}" \
        .format(account_name, STORAGE_ENDPOINT, airlock_request.id, token)


def get_account_url(account_name: str) -> str:
    return f"https://{account_name}.blob.{STORAGE_ENDPOINT}/"

type = bool
default = false
description = "Enable Airlock malware scanning for the workspace"
description = "Enable Airlock malware scanning for the workspace. Passed by porter bundle but no longer used in workspace terraform after airlock consolidation."
Comment on lines +100 to +104
@Environment[Microsoft.Network/privateEndpoints] StringEqualsIgnoreCase
'${azurerm_private_endpoint.sa_airlock_core_pe[0].id}'
AND
@Resource[Microsoft.Storage/storageAccounts/blobServices/containers/metadata:stage]
StringEquals 'import-in-progress'
Comment on lines +113 to +118
def _handle_v2_blob_created(json_body, topic, request_id, stepResultEvent, dataDeletionEvent):
"""Handle BlobCreated events from v2 consolidated storage accounts.

In v2, cross-account copies (e.g., import approval: core → workspace-global)
fire BlobCreated events. Container metadata determines the stage and appropriate
step result, matching the v1 pattern where BlobCreatedTrigger signals copy completion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign airlock to reduce number of storage accounts used

3 participants