struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (WW-5084) Content Security Policy support
Date Fri, 21 Aug 2020 16:11:00 GMT

     [ https://issues.apache.org/jira/browse/WW-5084?focusedWorklogId=473326&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-473326
]

ASF GitHub Bot logged work on WW-5084:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Aug/20 16:10
            Start Date: 21/Aug/20 16:10
    Worklog Time Spent: 10m 
      Work Description: aleksandr-m commented on a change in pull request #430:
URL: https://github.com/apache/struts/pull/430#discussion_r474792742



##########
File path: core/src/main/java/org/apache/struts2/action/DefaultCspReportAction.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.struts2.action;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+/**
+ * The default implementation of {@link CspReportAction} that simply logs the JSON object
+ * that contains the details of the CSP violation.
+ *
+ * @see CspReportAction
+ */
+public class DefaultCspReportAction extends CspReportAction {
+
+    protected static final Logger LOG = LogManager.getLogger(DefaultCspReportAction.class);
+
+    @Override
+    void processReport(String jsonCspReport) {

Review comment:
       Can you add any test case for it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 473326)
    Time Spent: 4h 20m  (was: 4h 10m)

> Content Security Policy support
> -------------------------------
>
>                 Key: WW-5084
>                 URL: https://issues.apache.org/jira/browse/WW-5084
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Core Interceptors, Core Tags
>    Affects Versions: 2.6
>            Reporter: Santiago Diaz
>            Priority: Major
>             Fix For: 2.6
>
>          Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> We'd like to add built-in Content Security Policy support to Struts2 to provide a major
security mechanism that developers can use to protect against common Cross-Site Scripting
vulnerabilities. Developers will have the ability to enable CSP in report-only or enforcement
mode.
> We will provide an out of the box tag that can be used by developers to use/import scripts
in their web applications, so that these will automatically get nonces that are compatible
with their Content Security policies.
> Finally, we will provide a built-in handler for CSP violation reports that will be used
to collect and provide textual explanations of these reports. This endpoint will be used by
developers to debug CSP violations and locate pieces of code that need to be refactored to
support strong policies.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message