After an update of a SAS GRID server to SAS Version 9 TS1M7, we are facing the problem that the Content Security Policy for the SAS web server was updated to no longer allow any outside sources, such as JavaScript libraries commonly used in web development.
As access to these sources is necessary for our web application to continue to function, we placed a .htaccess file in the root of our project's htdocs folder that should allow access. Testing this approach was working fine in a windows based environment that uses Apache instead of SAS web server. The production environment is Unix. Here is the contents of our .htaccess file:
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' unsafe-inline' https:; style-src 'unsafe-inline' https:; connect-src 'self';"
Access to outside sources continues to be denied, and we discovered that the httpd.conf file used by SAS server is set such that .htaccess files are ignored. Therefore we updated httpd.conf as below to allow the use of .htaccess files on the SAS web server:
<Directory "web-server-root/htdocs">
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
</Directory>
We tried the above with and without double quotes. The SAS web server continues to ignore the .htaccess file (we did some further testing to confirm that by using a simple Redirect).
Questions:
- Is there another way in the SAS web server administration to set the Content Security Policy?
- How can we configure SAS web server to allow .htaccess a very common feature used with web servers that should be available to users?
Please note that with the previous SAS install, we never encountered any of these problems.
Thank you for your feedback!
Beate