[
https://issues.apache.org/jira/browse/KNOX-3124?focusedWorklogId=966293&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-966293
]
ASF GitHub Bot logged work on KNOX-3124:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Apr/25 23:06
Start Date: 15/Apr/25 23:06
Worklog Time Spent: 10m
Work Description: lmccay commented on code in PR #1021:
URL: https://github.com/apache/knox/pull/1021#discussion_r2045681832
##########
gateway-provider-security-webappsec/src/main/java/org/apache/knox/gateway/webappsec/filter/SecurityHeaderFilter.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.gateway.webappsec.filter;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class SecurityHeaderFilter implements Filter {
+
+ private Map<String, String> map = new HashMap<>();
Review Comment:
agreed
Issue Time Tracking
-------------------
Worklog Id: (was: 966293)
Time Spent: 50m (was: 40m)
> Add Generic Security Header Filter to WebAppSec Provider
> --------------------------------------------------------
>
> Key: KNOX-3124
> URL: https://issues.apache.org/jira/browse/KNOX-3124
> Project: Apache Knox
> Issue Type: Improvement
> Components: Server
> Reporter: Larry McCay
> Assignee: Larry McCay
> Priority: Major
> Fix For: 2.2.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> In order to add various security headers to a response, we can add a generic
> filter for which init params with the param name and value indicating the
> header name and string representing the directives for the header
> respectively.
> This will allow admins to configure things like Content-Security-Policy,
> Cache-Control, etc. without the need to add separate filters for each one.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)