Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the CSP headers if they are set as an env variable at startup #15

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

danakim
Copy link
Collaborator

@danakim danakim commented Nov 2, 2023

@quartje - I have tested this with the following command:

docker run -p 8080:80 -e HTTPD_CSP="default-src; object-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src 'self'; connect-src 'self'; img-src 'self' data:; form-action 'self'; base-uri 'none'" apache2:test and it works, it adds the line to the config.

I think this is similar to what Ansible will add.

@danakim danakim requested a review from quartje November 2, 2023 13:20
@danakim
Copy link
Collaborator Author

danakim commented Nov 3, 2023

@quartje - please test :)

@danakim
Copy link
Collaborator Author

danakim commented Nov 3, 2023

@quartje - took the opportunity in this PR and I also fixed the logging, to make sure the logs go to stdout. The issue was that even if I configured the default log destination to be stdout and stderr, In the virtual host config the destination was still the log file. I had to overwrite the default vhost config as well to make sure we log to stdout. Please test this as well.

@quartje quartje merged commit a8af825 into main Nov 6, 2023
2 checks passed
@quartje quartje deleted the add-csp-headers branch November 6, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants