From 2321fe8eb470bb9c297ab13e24d9e5478a33b651 Mon Sep 17 00:00:00 2001 From: Scott Theleman Date: Thu, 13 Aug 2026 15:30:36 -0400 Subject: [PATCH 1/3] NMS-20180: Narrow anonymous menu-asset access to /ui-components/assets/** The unpacked dist-menu artifact also ships an index.html (the Vite build input) at /ui-components/, which nothing links to and which should not be anonymously reachable; only assets/** needs the ROLE_ANONYMOUS rule from NMS-20174. Document the deliberate login-page preload in bootstrap.jsp, and pin the NMS-20174 access/quiet fixes with WebappIT smoke tests: anonymous asset access with correct content types, index.html requiring authentication, and login.jsp never executing the menu bundle. --- .../applicationContext-spring-security.xml | 7 ++- .../src/main/webapp/includes/bootstrap.jsp | 12 +++- .../java/org/opennms/smoketest/WebappIT.java | 63 +++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/opennms-webapp/src/main/webapp/WEB-INF/applicationContext-spring-security.xml b/opennms-webapp/src/main/webapp/WEB-INF/applicationContext-spring-security.xml index c32e660b1d7d..cae6c0778751 100644 --- a/opennms-webapp/src/main/webapp/WEB-INF/applicationContext-spring-security.xml +++ b/opennms-webapp/src/main/webapp/WEB-INF/applicationContext-spring-security.xml @@ -347,8 +347,11 @@ - + asset URL, breaking the menu on all JSP pages after login (NMS-20174). Deliberately limited + to assets/**: the unpacked dist-menu artifact also ships an index.html (the Vite build + input) at /ui-components/, which nothing links to and which must not be anonymously + reachable (NMS-20180). --> + diff --git a/opennms-webapp/src/main/webapp/includes/bootstrap.jsp b/opennms-webapp/src/main/webapp/includes/bootstrap.jsp index 84cee97c54ee..0a5f2bf0e5ac 100644 --- a/opennms-webapp/src/main/webapp/includes/bootstrap.jsp +++ b/opennms-webapp/src/main/webapp/includes/bootstrap.jsp @@ -242,7 +242,17 @@ <%-- Start fetching/compiling the menu bundle now rather than when the parser - reaches its