SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
sfwebui: Update secure from 0.2.1 to 0.3.0 (#1226)
bcolesb7a6cf8cdf8b
diff --git a/requirements.txt b/requirements.txtindex 7b3cd2a9..461eb139 100644--- a/requirements.txt+++ b/requirements.txt@@ -15,7 +15,7 @@ phonenumbers>=8.12.9pygexf>=0.2.2PyPDF2>=1.26.0python-whois>=0.7.1-secure>=0.2.1,<0.3.0+secure>=0.3.0,<0.4.0pyOpenSSL>=17.5.0python-docx>=0.8.10python-pptx>=0.6.18diff --git a/sfwebui.py b/sfwebui.pyindex 375cf6ca..5249c0f6 100644--- a/sfwebui.py+++ b/sfwebui.py@@ -15,6 +15,7 @@ import jsonimport loggingimport multiprocessing as mpimport random+import secureimport timefrom copy import deepcopyfrom io import StringIO@@ -24,7 +25,6 @@ import cherrypyfrom cherrypy import _cperrorfrom mako.lookup import TemplateLookupfrom mako.template import Template-from secure import SecureHeadersfrom spiderfoot import SpiderFootDbfrom spiderfoot import SpiderFootHelpers@@ -82,15 +82,27 @@ class SpiderFootWebUi:'request.error_response': self.error_page})- secure_headers = SecureHeaders(- server="server",- cache=False,- csp="default-src 'self' ; script-src 'self' 'unsafe-inline' blob: ; style-src 'self' 'unsafe-inline' ; img-src 'self' data:"+ csp = (+ secure.ContentSecurityPolicy()+ .default_src("'self'")+ .script_src("'self'", "'unsafe-inline'", "blob:")+ .style_src("'self'", "'unsafe-inline'")+ .base_uri("'self'")+ .connect_src("'self'", "data:")+ .frame_src("'self'", 'data:')+ .img_src("'self'", "data:")+ )++ secure_headers = secure.Secure(+ server=secure.Server().set("server"),+ cache=secure.CacheControl().must_revalidate(),+ csp=csp,+ referrer=secure.ReferrerPolicy().no_referrer(),)cherrypy.config.update({"tools.response_headers.on": True,- "tools.response_headers.headers": secure_headers.cherrypy()+ "tools.response_headers.headers": secure_headers.framework.cherrypy()})def error_page(self):