-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect "total" numbers in Security chapter (2024, 2022, ?) (#3912
) * Update iframe_attributes_usage description * Fix total_iframes in iframe_attributes_usage.sql * Fix total pages in meta_csp_disallowed_directives.sql * Clarify in 3 queries that the total is not global * Note clarification * Update contributor details * Add comments to 2022, 2021, 2020 queries * Fix linting issues * Adapt text with updated query results * Query for 2020 and 2021 (using crawl.pages) * Fix linting * Adapt articles of 2022, 2021 and 2020 * Apply number fixes * Apply fixes to translated chapters --------- Co-authored-by: Gertjan Franken <[email protected]>
- Loading branch information
1 parent
aaa187a
commit 4504d2d
Showing
21 changed files
with
164 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#standardSQL | ||
# Section: Content Inclusion - Iframe Sandbox/Permissions Policy | ||
# Question: How often are the allow and sandbox attributes used on iframes? Both per page (used in at least one iframe on a page) and over all iframe elements | ||
WITH total_iframe_count AS ( | ||
SELECT | ||
client, | ||
date, | ||
SUM(SAFE.INT64(custom_metrics.other.num_iframes)) AS total_iframes | ||
FROM | ||
`httparchive.crawl.pages` | ||
WHERE | ||
(date = '2020-08-01' OR date = '2021-07-01' OR date = '2022-06-01') AND | ||
is_root_page | ||
GROUP BY client, date | ||
) | ||
|
||
SELECT | ||
client, | ||
date, | ||
total_iframes, | ||
COUNTIF(allow IS NOT NULL) AS freq_allow, | ||
COUNTIF(allow IS NOT NULL) / total_iframes AS pct_allow_frames, | ||
COUNTIF(sandbox IS NOT NULL) AS freq_sandbox, | ||
COUNTIF(sandbox IS NOT NULL) / total_iframes AS pct_sandbox_frames, | ||
COUNTIF(allow IS NOT NULL AND sandbox IS NOT NULL) AS freq_both_frames, | ||
COUNTIF(allow IS NOT NULL AND sandbox IS NOT NULL) / total_iframes AS pct_both_frames, | ||
COUNT(DISTINCT url) AS total_urls, | ||
COUNT(DISTINCT IF(allow IS NOT NULL, url, NULL)) AS allow_freq_urls, | ||
COUNT(DISTINCT IF(allow IS NOT NULL, url, NULL)) / COUNT(DISTINCT url) AS allow_pct_urls, | ||
COUNT(DISTINCT IF(sandbox IS NOT NULL, url, NULL)) AS sandbox_freq_urls, | ||
COUNT(DISTINCT IF(sandbox IS NOT NULL, url, NULL)) / COUNT(DISTINCT url) AS sandbox_pct_urls | ||
FROM ( | ||
SELECT | ||
client, | ||
date, | ||
url, | ||
SAFE.STRING(iframeAttr.allow) AS allow, | ||
SAFE.STRING(iframeAttr.sandbox) AS sandbox | ||
FROM ( | ||
SELECT | ||
client, | ||
date, | ||
page AS url, | ||
JSON_EXTRACT_ARRAY(custom_metrics.security.`iframe-allow-sandbox`) AS iframeAttrs | ||
FROM | ||
`httparchive.crawl.pages` | ||
WHERE | ||
(date = '2020-08-01' OR date = '2021-07-01' OR date = '2022-06-01') AND | ||
is_root_page | ||
) LEFT JOIN UNNEST(iframeAttrs) AS iframeAttr | ||
) JOIN total_iframe_count USING (client, date) | ||
GROUP BY | ||
total_iframes, | ||
client, | ||
date | ||
ORDER BY | ||
date, | ||
client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.