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

Added first version of CSP plugin. #93

Merged
merged 36 commits into from
Aug 28, 2020

Conversation

mattiasgrenfeldt
Copy link
Contributor

It supports creating custom CSP policies. The interceptor contains two policies, one for enforcement and one for reporting. A default policy based on https://csp.withgoogle.com/docs/strict-csp.html is also provided.

Fixes #74

safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Show resolved Hide resolved
@mattiasgrenfeldt
Copy link
Contributor Author

I implemented the feedback I got from Rob during the sync. PTAL

safehttp/mux.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/interceptor.go Outdated Show resolved Hide resolved
safehttp/mux.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/mux.go Outdated Show resolved Hide resolved
safehttp/mux.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
@mattiasgrenfeldt mattiasgrenfeldt force-pushed the grenfeldt-csp-plugin-first-version branch from b73021b to df8bc5a Compare August 20, 2020 12:34
@mattiasgrenfeldt
Copy link
Contributor Author

Rebasing on top of master so that tests don't fail anymore

safehttp/mux_test.go Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/mux_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Show resolved Hide resolved
safehttp/plugins/csp/csp_test.go Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
safehttp/plugins/csp/csp.go Outdated Show resolved Hide resolved
@empijei empijei merged commit 5c6aabe into master Aug 28, 2020
@mattiasgrenfeldt mattiasgrenfeldt deleted the grenfeldt-csp-plugin-first-version branch August 28, 2020 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add basic CSP functionality
4 participants