Skip to content

DSTA-683: add Defender for Storage target containers - #82

Merged
micjustus-nc merged 6 commits into
mainfrom
feat/DSTA-683-defender-target-containers
Oct 1, 2026
Merged

micjustus-nc merged 6 commits into
mainfrom
feat/DSTA-683-defender-target-containers

Conversation

@micjustus-nc

Copy link
Copy Markdown
Contributor

Description

This PR adds support to create two new target containers for us with Defender for Cloud malware scanning.

Context

The two target containers support our workflow to ensure trust content uploaded into their designated storage containers is scanned and free from harmful malware. The clean-scans folder will hold all uploaded trust content that has been scanned and considered free from harmful malware; the quarantine-scans folder holds all content that Defender for Cloud scanned and considered potentially harmful.

Running the PR

To run the Terraform scripts for this PR,

⚠️ plan or apply Terraform commands require permissions to write to the Terraform backend storage.

Remove existing resources

  1. Navigate to Azure Portal
  2. Open the rg-nbsse-dev-uks resource group inside the NBSS Dev Extraction subscription
  3. Remove the sanbssedevupload (and if present, the sanbssedevdefender) storage account(s)
  4. After the resources are removed, proceed with the steps below.

Run Terraform

  1. Open an AVD instance with private connectivity to Terraform state storage.
  2. Inside the AVD instance, open Visual Studio Code
  3. git clone this repository and branch with the PR code changes
  4. Switch to the branch related to this PR
  5. Open a Terminal instance.
    If your account has permissions to write to Terraform backend storage:
    • run make dev terraform-plan to ensure state is up-to-date
    • run make dev terraform-apply to ensure that Defender for Cloud is applied to the storage account in the Terraform code)

(Provided no Terraform errors show in the terminal)
Confirm Defender storage account and containers

  1. Navigate to Azure Portal
  2. Open the rg-nbsse-dev-uks resource group inside the NBSS Dev Extraction subscription
  3. Inside the resource group should be at minimum, two resources
    3.1. the normal storage account for uploads (sanbssedevupload)
    3.2 the Defender for Cloud storage account (sanbssedevdefender)
  4. Open the sanbssedevdefender storage account
  5. Open the list of containers for this account
  6. In the containers list should exist clean-scans and quarantine-scans

Deployment model
This set of changes uses Terraform-based deployments to enable resources.

Deployment resources

  • a storage account for Defender for Cloud with two containers that are privately accessible

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@micjustus-nc micjustus-nc self-assigned this Sep 30, 2026
@samw-nhs
samw-nhs requested a balanced review from Copilot October 1, 2026 09:44
@micjustus-nc
micjustus-nc marked this pull request as ready for review October 1, 2026 09:44

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 review overview

🟡 Changes recommended

Malware scanning is disabled by default, target containers lack network access, and the Defender state migration is unsafe.

Review effort: Balanced
Findings: 6

Open (6)
What changed in this PR

Adds storage infrastructure for clean and quarantined scan results and updates Defender configuration.

Changes:

  • Creates private clean-scans and quarantine-scans containers.
  • Refactors Defender settings targeting.
  • Expands upload-container metadata outputs.
File Description
infrastructure/​terraform/​variables.tf Updates malware-scanning defaults.
infrastructure/​terraform/​output.tf Expands container output metadata.
infrastructure/​terraform/​defender.tf Adds target storage and Defender configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread infrastructure/terraform/defender.tf Outdated
Comment thread infrastructure/terraform/defender.tf
Comment thread infrastructure/terraform/defender.tf
Comment thread infrastructure/terraform/defender.tf
Comment thread infrastructure/terraform/output.tf
Comment thread infrastructure/terraform/variables.tf
@micjustus-nc
micjustus-nc marked this pull request as draft October 1, 2026 10:51
Ensure hub environment is specified
@micjustus-nc
micjustus-nc force-pushed the feat/DSTA-683-defender-target-containers branch from 93ed04e to 4a31fa1 Compare October 1, 2026 11:05
@micjustus-nc
micjustus-nc marked this pull request as ready for review October 1, 2026 11:58
samw-nhs
samw-nhs previously approved these changes Oct 1, 2026
@micjustus-nc
micjustus-nc force-pushed the feat/DSTA-683-defender-target-containers branch from 143a4d1 to 4bea18a Compare October 1, 2026 14:43
@micjustus-nc
micjustus-nc force-pushed the feat/DSTA-683-defender-target-containers branch from 4bea18a to 4b52a83 Compare October 1, 2026 15:45
@micjustus-nc
micjustus-nc merged commit 46935d8 into main Oct 1, 2026
8 checks passed
@micjustus-nc
micjustus-nc deleted the feat/DSTA-683-defender-target-containers branch October 1, 2026 15:46
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.

3 participants