updateNetworkACLItem with partialupgrade=false leaves a rule broken when cidrlist or traffictype is left out, and drops an ICMP type given with tcp
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 42/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- backend-api-design, cloud
Rechercherichtung
Start by reading updateNetworkACLItem, transferDataToNetworkAclRulePojo(), NetworkACLItemDaoImpl.update() and NetworkACLItemCidrsDaoImpl.updateCidrs(); trace validation alongside createNetworkACL and the default partial upgrade path. Check the existing tests for network ACL rule updates and add coverage for missing required fields, invalid traffic type, ICMP parameters with another protocol, and rollback when CIDR updates fail. Done means invalid calls fail before leaving a partial update and valid calls preserve the documented behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
problem
updateNetworkACLItem with partialupgrade=false replaces every field of the rule with what the call passes. Two cases go wrong.
1. A field left out is written as null, and the rule is left broken.
When cidrlist or traffictype is left out, transferDataToNetworkAclRulePojo() sets them to null. NetworkACLItemDaoImpl.update() then writes the rule row and only afterwards updates the CIDRs, outside a transaction:
- with
cidrlistleft out,NetworkACLItemCidrsDaoImpl.updateCidrs()fails withCannot invoke "java.util.List.size()" because "cidrs" is null. The call fails, but the row has already been committed with the null traffic type. - from then on
listNetworkACLsfor that list fails withCannot invoke "...TrafficType.toString()" because ... getTrafficType() is null, and applying the list fails the same way inSetNetworkACLCommand, until the rule is updated again with every field.
When protocol is left out, the call fails earlier with a NullPointerException in updateIcmpCodeAndTypeFullUpgrade(). Nothing is written in that case, but the error is an NPE rather than a message. (#14046 removes that NPE; the rule would then be saved without a protocol, which createNetworkACL never allows.)
action left out is already handled: it becomes Allow, as on create.
2. An ICMP type or code given with another protocol is silently dropped.
partialupgrade=false protocol=tcp icmptype=8 is accepted, and the rule is saved as tcp without the ICMP type. createNetworkACL with the same parameters, and the same update with the default partialupgrade=true, both refuse it with "Can specify icmpCode and icmpType for ICMP protocol only".
versions
4.20 and later for the dropped ICMP type; the null fields since partialupgrade was added in 4.12. Seen on 4.22 and main.
The steps to reproduce the bug
- In a VPC, create an ACL list and a rule on it:
createNetworkACL aclid=<list> protocol=tcp startport=80 endport=80 cidrlist=10.1.2.0/24 action=allow traffictype=ingress. updateNetworkACLItem id=<rule> partialupgrade=false protocol=udp startport=53 endport=53. It fails with thecidrs is nullNPE.listNetworkACLs aclid=<list>now fails with thegetTrafficType() is nullNPE.updateNetworkACLItem id=<rule> partialupgrade=false protocol=tcp cidrlist=10.1.2.0/24 action=allow traffictype=ingressrepairs it.- On an ICMP rule,
updateNetworkACLItem id=<rule> partialupgrade=false protocol=tcp icmptype=8 cidrlist=10.1.2.0/24 action=allow traffictype=ingressis accepted, and the rule is tcp with no ICMP type.
What to do about it?
- With
partialupgrade=false, refuse the call whenprotocol,cidrlistortraffictypeis missing, before anything is written. Defaulting them as create does would silently widen a rule to every address, or turn an egress rule into an ingress rule. - Refuse an invalid
traffictypeon update, as create does, instead of ignoring it. - Keep an ICMP type or code given with another protocol, so that the existing validation refuses it.
- Write the rule row and its CIDRs in one transaction, so that a failure on the CIDRs can't leave the rule half updated.
- Vorherrschende Sprache
- Java
- Sterne
- 3.1k
- Forks
- 1.4k
- Ø Merge
- 7 T. 16 Std.
- Gemergte PRs (30 T.)
- 15
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/cloudstack
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new sizeEvtl. vergeben @bhouse-nexthop hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
apache/cloudstack#14645 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replacedEvtl. vergeben @bhouse-nexthop hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/cloudstack#14633 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)Evtl. vergeben @bhouse-nexthop hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/cloudstack#14631 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
apache/cloudstack#14625 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)Evtl. vergeben @willbennett-devops hat das vor 12 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
apache/cloudstack#14545 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/cloudstack
Ähnliche Issues
-
[FEATURE] Expose external refresh, node-level translog and warmer statsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenuntriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
-
Good First Issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
hiero-ledger/hiero-sdk-java#3059 ·
Maintainer antworten meist innerhalb von 1 Tag