alopresto commented on a change in pull request #3273: NIFI-5968 - Added the 
X-XSS-Protection and Strict-Transport-Security …
URL: https://github.com/apache/nifi/pull/3273#discussion_r251664991
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
 ##########
 @@ -602,6 +599,28 @@ private WebAppContext loadWar(final File warFile, final 
String contextPath, fina
         return webappContext;
     }
 
+    private void addHTTPHeaders(WebAppContext webappContext) {
+        // Add a filter to set the X-Frame-Options header
+        FilterHolder xfoFilter = new FilterHolder(new XFrameOptionsFilter());
+        xfoFilter.setName(XFrameOptionsFilter.class.getSimpleName());
+        webappContext.addFilter(xfoFilter, "/*", 
EnumSet.allOf(DispatcherType.class));
+
+        // Add a filter to set the Content Security Policy frame-ancestors 
directive
+        FilterHolder cspFilter = new FilterHolder(new 
ContentSecurityPolicyFilter());
+        cspFilter.setName(ContentSecurityPolicyFilter.class.getSimpleName());
+        webappContext.addFilter(cspFilter, "/*", 
EnumSet.allOf(DispatcherType.class));
+
+        // Add a filter to set the HSTS header
 
 Review comment:
   Talked to @mcgilman and we believe the performance impact of using multiple 
filters will be negligible. Don't worry about this. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to