Violations
The Violations tab of Security > CSP lists the reports that browsers send after a policy is deployed.
What a report is
Section titled “What a report is”When a page asks for something that the policy does not allow, the browser of the visitor sends a report to the report service of Quant. In report-only mode the browser sends the report and loads the resource. In enforcing mode the browser sends the report and blocks the resource.
Each row is one violation: the directive (for example script-src), the blocked address, the page, and a count of the reports. Reports for the same thing add to the count of one row.
Read the list
Section titled “Read the list”- Status filters the list: Active, Resolved, Dismissed or all.
- Sort orders the list: Most recent or Most frequent.
- View on a row shows the detail: directive, blocked address, page, source file and line, count, first seen and last seen. It also shows what Approve adds to the policy.
For each active violation, ask one question: does the site load this on purpose?
| Answer | Action |
|---|---|
| Yes. The site needs it | Approve |
| No. It is not part of the site, and it is a single event | Dismiss |
| No. A browser tool adds it, and it comes back again and again | Dismiss and ignore |
| You do not know | Leave it active. Find the page and the script that makes the request first |
Approve
Section titled “Approve”Approve adds the source of the violation to the policy and makes a new policy version. The new version is not live until you deploy it.
- You can select several violations and approve them together.
- A violation that needs a value that weakens the policy, for example
'unsafe-inline', is approved on its own. The dialog Approve a value that weakens the policy? asks you to confirm. - Some violations cannot be approved. The detail says “This violation cannot be approved.” Edit the policy, or dismiss the violation.
Dismiss
Section titled “Dismiss”Dismiss stops alerts for one violation. The violation moves to Dismissed. Use Reactivate to make a dismissed violation active again.
Remove resolved and Remove dismissed delete those rows from the list.
Reports that the site does not cause
Section titled “Reports that the site does not cause”Many reports do not show a problem with the site. They come from software in the browser of the visitor.
A browser extension or a tool can change a page after the browser loads it. A translate tool is a common example: it adds its own scripts, styles and images to the page, from its own hosts, to show the translated text. An advertisement blocker, a password manager, a shopping tool or antivirus software can do the same. The policy of the site does not list those hosts, so the browser makes a report for each one.
These reports mean that the policy works. Your site did not load those resources, and no attacker put them there. The visitor added them. Do not approve them: an approval permits those hosts for every visitor, and the site does not need them.
Quant handles these reports in two ways:
- Automatic. Quant drops a report whose address starts with
chrome-extension,moz-extensionorsafari-extension. These reports never show in the list. - Ignore rules. A tool such as a translate tool is not an extension by address. It loads files from normal web hosts, and each one makes a report. For these, use Dismiss and ignore.
Dismiss and ignore
Section titled “Dismiss and ignore”- On the row of the violation, select Dismiss and ignore.
- Read the dialog Ignore reports like this one?. It names the type and the host that the rule matches.
- Confirm.
Quant then drops every new report for that host and type. No violation and no alert is made. Active violations that match are dismissed. A new rule takes effect within 60 seconds.
Ignore rules
Section titled “Ignore rules”The card Ignored reports lists the ignore rules of the site, each with its type and host. Remove a rule there. A removed rule also takes effect within 60 seconds. A site can have 100 ignore rules.
How to tell noise from a real violation
Section titled “How to tell noise from a real violation”| Sign | Likely cause |
|---|---|
| The blocked host belongs to a translate service, an extension vendor or security software | A browser tool |
| The count is low, and the reports come from few pages with no pattern | A browser tool |
| The blocked host is a vendor that your site uses (analytics, fonts, a tag manager, a video player) | The site. Approve it |
| The reports started after a release or a tag manager change | The site. Approve it, or remove the new tag |
| Many visitors report the same blocked address on the same page | The site, or an injected script. Find the script before you decide |
