Repository navigation
Closed
Description
Our CSP filter works on blocked_uri and source_file:
Lines 10 to 34 in 1bd6764
| pub fn matches<It, S>(event: &Event, disallowed_sources: It) -> bool | |
| where | |
| It: IntoIterator<Item = S>, | |
| S: AsRef<str>, | |
| { | |
| if event.ty.value() != Some(&EventType::Csp) { | |
| return false; | |
| } | |
| // parse the sources for easy processing | |
| let disallowed_sources: Vec<SchemeDomainPort> = disallowed_sources | |
| .into_iter() | |
| .map(|origin| -> SchemeDomainPort { origin.as_ref().into() }) | |
| .collect(); | |
| if let Some(csp) = event.csp.value() { | |
| if matches_any_origin(csp.blocked_uri.as_str(), &disallowed_sources) { | |
| return true; | |
| } | |
| if matches_any_origin(csp.source_file.as_str(), &disallowed_sources) { | |
| return true; | |
| } | |
| } | |
| false | |
| } |
A customer has requested to add document_uri to filter, which can improve the CSP filters UX. One option is to allow users to choose which CSP fields they want to use with the filters.
Originally requested in: https://getsentry.atlassian.net/browse/FEEDBACK-1070
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
jjbayer commentedon Apr 19, 2023
Makes sense to me, will add it to our backlog.
feat(filter): Add document_uri csp filter (#2059)