network: default egress policy 'allow' for Isolated networks (configurable)#13684
Open
andrijapanicsb wants to merge 1 commit into
Open
network: default egress policy 'allow' for Isolated networks (configurable)#13684andrijapanicsb wants to merge 1 commit into
andrijapanicsb wants to merge 1 commit into
Conversation
Isolated guest networks created from the built-in default offerings (DefaultIsolatedNetworkOfferingWithSourceNatService and DefaultIsolatedNetworkOffering) previously denied all egress by default, while createNetworkOffering without an explicit egressdefaultpolicy and VPC tiers already allow egress. This aligns the built-in Isolated offerings with allow-by-default and makes the behaviour configurable. - Add global setting network.isolated.default.egress.policy.allow (default true). - Seed the built-in default Isolated network offerings with the egress default policy taken from this setting. - createNetworkOffering without an explicit egressdefaultpolicy now follows the same setting instead of a hard-coded allow. Only affects fresh installations and offerings created without the parameter; existing network offerings and networks are unchanged.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13684 +/- ##
=========================================
Coverage 19.64% 19.64%
- Complexity 19796 19798 +2
=========================================
Files 6368 6368
Lines 575119 575128 +9
Branches 70382 70382
=========================================
+ Hits 112994 113000 +6
+ Misses 449839 449838 -1
- Partials 12286 12290 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@blueorangutan package kvm |
|
@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with kvm SystemVM template(s). I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18655 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Isolated guest networks created from the built-in default network offerings
(
DefaultIsolatedNetworkOfferingWithSourceNatServiceandDefaultIsolatedNetworkOffering) currently deny all egress by default. Thiscomes from how they are seeded in
ConfigurationServerImpl: they use aNetworkOfferingVOconstructor that does not setegressdefaultpolicy, so itfalls back to the Java primitive default (
false= deny). The DB column defaultis also
false.Meanwhile:
createNetworkOffering, when called without an explicitegressdefaultpolicy,already defaults to allow (
NetworkOfferingBaseCmd#getEgressDefaultPolicyreturned
truewhennull).egress out of the box.
So we ship two inconsistent defaults (built-in Isolated offering = deny,
API-created offering = allow), and the default "simple Isolated network"
experience is the more surprising of the two. Deny-by-default egress on a NAT'd
Isolated network provides little practical security value — the network has no
inbound reachability without explicit static-NAT/port-forwarding/LB + firewall
rules — but it regularly surprises operators whose freshly deployed VMs cannot
reach package mirrors, NTP, metadata, etc. until an allow-all egress rule is
added.
This PR makes allow the default for the built-in Isolated offerings and makes
the behaviour configurable.
Changes
network.isolated.default.egress.policy.allow(Boolean,default
true).default policy taken from this setting.
createNetworkOfferingwithout an explicitegressdefaultpolicynow followsthe same setting instead of a hard-coded
true, so the built-in and API pathsagree.
Operators who prefer deny-by-default set the setting to
falsebefore firstinitialization, or continue to create/use a custom offering with
egressdefaultpolicy = deny(that path is unchanged).Backward compatibility
Deliberately scoped to be safe:
at first initialization; upgrades do not re-seed them. No data migration runs
against existing
network_offeringsrows or existing networks, so everyalready-created offering and network keeps its current policy.
allow-by-default.
egressdefaultpolicyparameter and per-offering behaviour are unchanged;this only changes a default.
egress_default_policyDB column default is intentionally not changedand no
UPDATEis run against existing rows — the application always sets thevalue explicitly on insert, so the setting is the single control point.
The one real consideration is security posture on new clouds: an operator who
relied on the historical deny-by-default of the built-in offering now gets
allow-by-default. That is why it is an operator-overridable, documented setting
rather than a silent flip, and should be called out in the release notes.
Types of changes
How Has This Been Tested?
api,engine/schema, andservercompile cleanly with the change.initialization and via
listNetworkOfferings/listConfigurationsisoutstanding and will be added; happy to extend Marvin coverage for the new
default if reviewers prefer.