[PR #3970] [MERGED] [management] Add option to disable default all-to-all policy #24263

Open
opened 2026-08-05 06:08:28 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3970
Author: @aliamerj
Created: 6/12/2025
Status: Merged
Merged: 7/1/2025
Merged by: @mlsmaycon

Base: mainHead: disableDefaultPolicy


📝 Commits (2)

  • 47344c3 feat: add DisableDefaultPolicy config option
  • 4672873 make disableDefaultPolicy configurable via setup.env

📊 Changes

28 files changed (+82 additions, -65 deletions)

View changed files

📝 .github/workflows/test-infrastructure-files.yml (+2 -0)
📝 client/cmd/testutil_test.go (+1 -1)
📝 client/internal/engine_test.go (+1 -1)
📝 client/server/server_test.go (+1 -1)
📝 infrastructure_files/base.setup.env (+2 -0)
📝 infrastructure_files/management.json.tmpl (+1 -0)
📝 infrastructure_files/setup.env.example (+2 -1)
📝 infrastructure_files/tests/setup.env (+1 -0)
📝 management/client/client_test.go (+1 -1)
📝 management/cmd/management.go (+1 -1)
📝 management/server/account.go (+8 -4)
📝 management/server/account_test.go (+5 -5)
📝 management/server/dns_test.go (+2 -2)
📝 management/server/ephemeral_test.go (+1 -1)
📝 management/server/group_test.go (+1 -1)
📝 management/server/http/testing/testing_tools/tools.go (+1 -2)
📝 management/server/management_proto_test.go (+1 -1)
📝 management/server/management_test.go (+1 -1)
📝 management/server/nameserver_test.go (+2 -2)
📝 management/server/peer_test.go (+8 -8)

...and 8 more files

📄 Description

Describe your changes

This PR introduces a new configuration option DisableDefaultPolicy that prevents the creation of the default all-to-all policy when new accounts are created. This is useful for automation scenarios where explicit policies are preferred.

Key Changes:

  • Added DisableDefaultPolicy flag to the management server config
  • Modified account creation logic to respect this flag
  • Updated all test cases to explicitly pass the flag (defaulting to false to maintain backward compatibility)
  • Propagated the flag through the account manager initialization chain

Testing:

  • Verified default behavior remains unchanged when flag is false
  • Confirmed no default policy is created when flag is true
  • All existing tests pass with the new parameter

Closes #3932

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/3970 **Author:** [@aliamerj](https://github.com/aliamerj) **Created:** 6/12/2025 **Status:** ✅ Merged **Merged:** 7/1/2025 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `disableDefaultPolicy` --- ### 📝 Commits (2) - [`47344c3`](https://github.com/netbirdio/netbird/commit/47344c3fa8c86b33fd81c1d44ba4e346963d86d2) feat: add DisableDefaultPolicy config option - [`4672873`](https://github.com/netbirdio/netbird/commit/46728736c96f82cd0757d0ae066afbeee08e9792) make disableDefaultPolicy configurable via setup.env ### 📊 Changes **28 files changed** (+82 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-infrastructure-files.yml` (+2 -0) 📝 `client/cmd/testutil_test.go` (+1 -1) 📝 `client/internal/engine_test.go` (+1 -1) 📝 `client/server/server_test.go` (+1 -1) 📝 `infrastructure_files/base.setup.env` (+2 -0) 📝 `infrastructure_files/management.json.tmpl` (+1 -0) 📝 `infrastructure_files/setup.env.example` (+2 -1) 📝 `infrastructure_files/tests/setup.env` (+1 -0) 📝 `management/client/client_test.go` (+1 -1) 📝 `management/cmd/management.go` (+1 -1) 📝 `management/server/account.go` (+8 -4) 📝 `management/server/account_test.go` (+5 -5) 📝 `management/server/dns_test.go` (+2 -2) 📝 `management/server/ephemeral_test.go` (+1 -1) 📝 `management/server/group_test.go` (+1 -1) 📝 `management/server/http/testing/testing_tools/tools.go` (+1 -2) 📝 `management/server/management_proto_test.go` (+1 -1) 📝 `management/server/management_test.go` (+1 -1) 📝 `management/server/nameserver_test.go` (+2 -2) 📝 `management/server/peer_test.go` (+8 -8) _...and 8 more files_ </details> ### 📄 Description ## Describe your changes This PR introduces a new configuration option `DisableDefaultPolicy` that prevents the creation of the default all-to-all policy when new accounts are created. This is useful for automation scenarios where explicit policies are preferred. ### Key Changes: - Added DisableDefaultPolicy flag to the management server config - Modified account creation logic to respect this flag - Updated all test cases to explicitly pass the flag (defaulting to false to maintain backward compatibility) - Propagated the flag through the account manager initialization chain ### Testing: - Verified default behavior remains unchanged when flag is false - Confirmed no default policy is created when flag is true - All existing tests pass with the new parameter ## Issue ticket number and link Closes #3932 ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 06:08:28 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#24263