Closed (fixed)
Project:
Security Kit
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jan 2016 at 15:35 UTC
Updated:
7 Sep 2018 at 11:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jweowu commentedApologies for the delayed response, and yes, I would be happy to add such support.
Please do go ahead with a patch.
Comment #3
progga commentedThanks for the go ahead signal. I am working on it now. I will use the following paths and URLs in the web test case file:
- report-csp-violation
- /report-csp-violation
- https://report-uri.io/report/DrupalSeckitTest
- //report-uri.io/report/DrupalSeckitTest
Just let me know if you want any other paths or URLs.
Comment #4
progga commentedBefore changing any code, I ran the existing tests. The tests took about an hour to run! Here is the output:
Comment #5
progga commentedPatch is ready for review.
Few points to note:
- I haven't run the coding standard checker as it was giving too many errors in the existing code. Hope it's okay.
- The two test errors mentioned in comment #4 still exists. It doesn't look like I have broken anything new.
- I am happy to provide a similar patch for the 8.x-1.x branch if necessary.
- The report-uri URL https://report-uri.io/report/DrupalSeckitTest used in the test file do exists. report-uri.io is a free service, so it is easy to test :)
Thanks,
Adnan
Comment #6
svenryen commentedThe patch from #5 didn't apply. Here's a patch that fixes the problem (with a different approach).
Comment #7
catalano commentedI thought this was included in release 1.7. According to this issue thread (https://www.drupal.org/project/seckit/issues/2091627) item #5 indicates that it was applied to release 1.7.
Comment #8
jweowu commentedNo, the changes in #2091627: CSP report-uri and policy-uri directives are relative to current URL rather than to base URL fixed a bug which caused the wrong URLs to be generated, but the configured values still had to be relative. This issue is to allow absolute URL values to be configured, so that an external domain can be used.
Comment #9
catalano commentedI see. Are they any patches available that are awaiting being built into a release?
Comment #10
mcdruid commentedLinking the D8 issue for the same thing.
Comment #11
mcdruid commentedIt looks like patch #6 was created from outside the seckit directory, and removes a lot of useful things like validation and tests.
I made a couple of small tweaks to the patch from #5 - mostly coding standards / consistency (partly with the D8 patch).
I think this looks good - my only niggle is that the tests it adds seem quite long-winded and repetitive. They could possibly be refactored to loop over an array of test data or something similar (see the D8 patch in the linked issue).
AFAICS the only test which fails though is "X-Content-Type-Options is disabled." which is being addressed in other issues.
Comment #13
mcdruid commentedCommitted without refactoring the tests; if anyone wants to do some work polishing them, patches welcome.
Thanks to all who contributed!