Skip to content

feat(file-shares): Add rule to disable public network access#3736

Draft
mathieusouflis wants to merge 1 commit intoAzure:mainfrom
mathieusouflis:feat/disable-public-network-access-on-file-shares
Draft

feat(file-shares): Add rule to disable public network access#3736
mathieusouflis wants to merge 1 commit intoAzure:mainfrom
mathieusouflis:feat/disable-public-network-access-on-file-shares

Conversation

@mathieusouflis
Copy link
Copy Markdown

@mathieusouflis mathieusouflis commented Mar 26, 2026

PR Summary

ISSUE : #3735

Add rule to disable public network access for File Shares

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • Change is not breaking
  • This PR is ready to merge and is not Work in Progress
  • Rule changes
    • Unit tests created/ updated
    • Rule documentation created/ updated
    • Link to a filed issue
    • Change log has been updated with change under unreleased section
  • Other code changes
    • Unit tests created/ updated
    • Link to a filed issue
    • Change log has been updated with change under unreleased section

@mathieusouflis mathieusouflis requested a review from a team as a code owner March 26, 2026 20:59
@mathieusouflis
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@mathieusouflis mathieusouflis marked this pull request as draft March 26, 2026 23:26
Copy link
Copy Markdown
Collaborator

@BernieWhite BernieWhite left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. Great start, see the comments below. Let me know if you need any further information.

For example:

```json
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Update examples for Arm JSON and Bicep. For the resource that is being tested. You can create an example in docs/examples/.


- [SE:06 Network controls](https://learn.microsoft.com/azure/well-architected/security/networking)
- [Security: Level 4](https://learn.microsoft.com/azure/well-architected/security/maturity-model?tabs=level4)
- [Azure deployment reference](https://learn.microsoft.com/azure/templates/microsoft.kusto/clusters)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Link to the resource being tested.

@@ -0,0 +1,85 @@
---
reviewed: 2025-11-04
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clear or update the date.

pillar: Security
category: SE:06 Network controls
resource: File Shares
resourceType: Microsoft.Kusto/clusters
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Update resource type.

kind: Rule
metadata:
name: Azure.Share.PublicAccess
ref: AZR-000538
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use 542 as other ids have open PRs.

ref: AZR-000538
tags:
release: preview
ruleSet: 2026_03
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use 2026_06


spec:
type:
- Microsoft.Kusto/clusters
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Update resource type.

@@ -0,0 +1,227 @@
[
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tests need an example share resource defined.

$ruleResult = @($filteredResult | Where-Object { $_.Outcome -eq 'Fail' });
$ruleResult | Should -Not -BeNullOrEmpty;
$ruleResult.Length | Should -Be 2;
$ruleResult.TargetName | Should -Be 'cluster-A', 'cluster-B';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Update to match the names of the file shares you create in the rest resources JSON file.

$ruleResult = @($filteredResult | Where-Object { $_.Outcome -eq 'Pass' });
$ruleResult | Should -Not -BeNullOrEmpty;
$ruleResult.Length | Should -Be 1;
$ruleResult.TargetName | Should -BeIn 'cluster-C';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same

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.

2 participants