Commit 0bd4dec
committed
Network: default egress policy Allow for Isolated networks on fresh installations
The built-in Isolated network offerings were seeded with
egress_default_policy = false (Deny), while:
- the createNetworkOffering API already defaults egressdefaultpolicy to true
(Allow) when the parameter is omitted (NetworkOfferingBaseCmd),
- the UI's Add Network Offering form contradicted that API default by
preselecting Deny and sending an explicit egressdefaultpolicy=false,
- the Kubernetes service rejects isolated offerings with egress Deny and
creates its own default offering with egress Allow,
- VPC tiers have no such baked-in Deny: allow-all (default_allow ACL) is a
first-class choice.
Seed both built-in Isolated offerings with egress Allow on fresh
installations, and align the UI form default with the existing API default.
For DefaultIsolatedNetworkOffering (no Firewall service) the flag is inert
and set only so API responses do not advertise a misleading Deny policy.
No global setting is introduced: per-offering configurability already exists
via the egressdefaultpolicy parameter, and a setting consumed once at
first-boot seeding but live for later createNetworkOffering calls would have
inconsistent lifecycle semantics.
Backward compatibility: createDefaultNetworkOfferings() only runs on first
boot (guarded by the 'init' configuration flag) and
persistDefaultNetworkOffering() is find-or-create by unique name - it never
updates an existing row. No upgrade SQL is shipped, deliberately: egress
enforcement reads the offering row live on every VR rule programming, so
flipping existing rows would change the behavior of existing networks.
Upgraded clouds keep Deny on the pre-existing built-in offering; an
Allow-by-default offering for new networks on upgraded clouds is left as a
follow-up (new/versioned offering).
Unit tests cover the fresh-install seeding values and the API default for
omitted/explicit egressdefaultpolicy.1 parent 4f11707 commit 0bd4dec
5 files changed
Lines changed: 103 additions & 1 deletion
File tree
- api/src/test/java/org/apache/cloudstack/api/command/admin/network
- engine/schema/src/main/java/com/cloud/offerings
- server/src
- main/java/com/cloud/server
- test/java/com/cloud/server
- ui/src/views/offering
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1070 | 1076 | | |
1071 | 1077 | | |
1072 | 1078 | | |
| |||
1084 | 1090 | | |
1085 | 1091 | | |
1086 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1087 | 1096 | | |
1088 | 1097 | | |
1089 | 1098 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
125 | 164 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| |||
0 commit comments