About
Tool No. 43 of Pikkola
A content policy is a list of refusals, written in one header. It is the only defence a page has that still works when a script it did not expect has already reached the browser. This page writes that list, reads one you already sent, and says what the difference costs.
What it does
- Builder: a directive is a card and a source is a chip, so the policy is assembled from what a browser actually reads rather than typed from memory. Five presets cover a static site, a Next.js app, an analytics and fonts stack, a Stripe checkout and a report-only start.
- Auditor: a policy of any length is split into its directives, duplicates and dead tokens are named, and the settings that give the most away are listed with what each one costs and how to change it.
- Hash: the SHA-256 of an inline script or style, computed with the browser's own crypto, ready to be added to script-src or style-src in one click.
- Four outputs: a raw header, a meta tag, an nginx add_header line and a Cloudflare _headers block. The header name follows the Report-Only switch.
- The draft is kept in this browser's local storage, so a reload does not lose work.
What the grade means
It is this studio's own summary, not a standard. The weights are written into the page: a bare * in script-src costs 25, a missing base-uri costs 4, and each finding says what it took away, so the number can be argued with instead of trusted. Security header checkers on the web weigh the same facts differently, and a policy that scores A+ here may score A elsewhere for reasons that are in the text of both pages.
Two points are treated the way the specification treats them. 'unsafe-inline' next to a nonce, a hash or 'strict-dynamic' is ignored by browsers, so it is a note rather than a fault. A directive without a source is dropped by the browser, so an empty one is not a restriction.
What it deliberately does not do
- It does not send the policy, fetch the page it belongs to, or check whether the header is live. The 19th tool of this studio reads headers from a live host; this one works from text.
- It does not know which hosts your site really uses. The presets are a starting point and the report-only mode is how the missing ones are found.
- It does not promise that a graded policy stops every attack. A policy narrows what a script can do; it is not a substitute for escaping output, an HttpOnly cookie or a patched dependency.
- It does not store, transmit or analyse what you paste. No account, no analytics, no cookie, no font from another server.
Why it is free
Pikkola builds small tools that do one job and keeps them free, with no account and no advertising. A static page that computes in the browser costs almost nothing to serve, so there is no reason to charge for it.
Contact
A policy that is graded wrongly, a phrase that reads badly in Korean or Japanese, an output format that should be here and is not: [email protected]. Send the policy and what you expected to see.
소개
피콜라 43번째 도구
콘텐츠 보안 정책은 헤더 하나에 적은 거절의 목록입니다. 예상하지 못한 스크립트가 이미 브라우저에 닿은 뒤에도 남는 방어선은 이것 하나입니다. 이 페이지는 그 목록을 쓰고, 이미 보내고 있는 정책을 읽고, 차이가 무엇을 잃는 일인지 말합니다.
하는 일
- 빌더: 디렉티브는 카드, 출처는 칩입니다. 기억에 의존해 한 줄을 타이핑하는 대신 브라우저가 실제로 읽는 단위로 정책을 조립합니다. 정적 사이트, Next.js 앱, 분석과 폰트, 스트라이프 결제, 리포트 전용 시작점까지 다섯 프리셋이 있습니다.
- 감사기: 어떤 길이의 정책이든 디렉티브 단위로 나누고, 중복과 죽은 토큰을 집어내고, 가장 많은 것을 내주는 설정마다 무엇을 잃는지와 고치는 방법을 붙입니다.
- 해시: 인라인 스크립트나 스타일의 SHA-256을 브라우저 자체 암호 기능으로 계산해 script-src나 style-src에 한 번에 넣습니다.
- 출력 네 가지: 원본 헤더, 메타 태그, nginx add_header 한 줄, 클라우드플레어 _headers 블록. 리포트 전용 스위치를 켜면 헤더 이름도 따라 바뀝니다.
- 작업 중인 초안은 이 브라우저의 로컬 저장소에 남아 새로고침해도 사라지지 않습니다.
등급이 뜻하는 것
이 스튜디오 나름의 요약이고 표준이 아닙니다. 감점 기준을 페이지 안에 적어 두었습니다. script-src의 맨 *는 25점, 빠진 base-uri는 4점이고, 지적마다 몇 점을 가져갔는지 함께 적으므로 숫자를 믿는 대신 따져 볼 수 있습니다. 웹의 보안 헤더 검사기들은 같은 사실을 다르게 무게 잡고, 여기서 A+인 정책이 다른 곳에서 A가 되는 일은 양쪽 페이지에 이유가 적혀 있습니다.
두 가지는 명세가 다루는 방식 그대로 다룹니다. 논스나 해시, 'strict-dynamic' 옆의 'unsafe-inline'은 브라우저가 무시하므로 결함이 아니라 참고로 적습니다. 출처가 없는 디렉티브는 브라우저가 빼고 읽으므로 비어 있는 디렉티브는 제한이 아닙니다.
일부러 하지 않는 일
- 정책을 보내지도, 그 정책이 붙은 페이지를 가져오지도, 헤더가 실제로 살아 있는지 확인하지도 않습니다. 실제 호스트의 헤더를 읽는 것은 이 스튜디오의 19호기 몫이고, 여기는 글자로만 판단합니다.
- 사이트가 실제로 쓰는 호스트를 알지 못합니다. 프리셋은 시작점이고, 빠진 호스트는 리포트 전용 모드로 찾습니다.
- 등급이 나온 정책이 모든 공격을 막는다고 약속하지 않습니다. 정책은 스크립트가 할 수 있는 일을 좁힐 뿐이고, 출력 이스케이프나 HttpOnly 쿠키, 패치된 의존성을 대신하지 못합니다.
- 붙여 넣은 것을 저장하거나 전송하거나 분석하지 않습니다. 계정도, 분석도, 쿠키도, 다른 서버의 글꼴도 없습니다.
무료인 이유
피콜라는 한 가지 일을 하는 작은 도구를 만들고 계정도 광고도 없이 무료로 유지합니다. 브라우저에서 계산하는 정적 페이지는 서빙 비용이 거의 들지 않으니 값을 매길 이유가 없습니다.
연락
등급이 잘못 매겨진 정책, 한국어나 일본어에서 어색한 문장, 여기 있어야 할 것 같은데 없는 출력 형식은 [email protected]으로 보내 주세요. 정책과 기대한 결과를 함께 적어 주시면 확인이 빠릅니다.
概要
Pikkola 43 番目の道具
コンテンツポリシーは、ヘッダー一つに書いた拒否の一覧です。想定していないスクリプトがすでにブラウザに届いたあとでも残る防衛線はこれだけです。このページはその一覧を書き、すでに送っているポリシーを読み、違いが何を失うのかを伝えます。
すること
- ビルダー: ディレクティブがカード、取得元がチップです。記憶を頼りに一行を打つ代わりに、ブラウザが実際に読む単位でポリシーを組み立てます。静的サイト、Next.js アプリ、解析とフォント、Stripe 決済、レポートのみの開始点まで五つのプリセットがあります。
- 監査: どんな長さのポリシーもディレクティブに分け、重複と死んだ語を指摘し、最も多くを明け渡している設定ごとに何を失うかと直し方を添えます。
- ハッシュ: インラインスクリプトやスタイルの SHA-256 をブラウザ自身の暗号機能で計算し、script-src や style-src へ一度で入れます。
- 出力四つ: 生のヘッダー、メタタグ、nginx の add_header 一行、Cloudflare の _headers ブロック。レポートのみのスイッチにヘッダー名も従います。
- 作業中の下書きはこのブラウザのローカルストレージに残り、再読み込みでも消えません。
評価が意味すること
この工房なりの要約で、標準ではありません。減点の重みはページに書いてあります。script-src の裸の * は 25 点、欠けた base-uri は 4 点で、指摘ごとに何点を持って行ったかを添えるので、数字を信じる代わりに検討できます。ウェブのセキュリティヘッダー検査は同じ事実を違う重みで見ます。ここで A+ のポリシーが別の場所で A になる理由は、双方のページに書かれています。
二点は仕様の扱いどおりに扱います。ナンス、ハッシュ、'strict-dynamic' の隣の 'unsafe-inline' はブラウザが無視するので、欠陥ではなく参考です。取得元のないディレクティブはブラウザが外して読むので、空のディレクティブは制限ではありません。
意図してやらないこと
- ポリシーを送らず、そのポリシーが付いたページを取りに行かず、ヘッダーが生きているかも確かめません。実際のホストのヘッダーを読むのはこの工房の 19 番目の道具で、ここは文字だけで判断します。
- サイトが実際に使うホストを知りません。プリセットは開始点で、抜けたホストはレポートのみのモードで見つけます。
- 評価の付いたポリシーがすべての攻撃を止めるとは約束しません。ポリシーはスクリプトにできることを狭めるだけで、出力のエスケープや HttpOnly クッキー、更新された依存の代わりにはなりません。
- 貼り付けたものを保存も送信も解析もしません。アカウントも、解析も、クッキーも、別のサーバのフォントもありません。
無料の理由
Pikkola は一つの仕事をする小さな道具を作り、アカウントも広告もなく無料で保ちます。ブラウザで計算する静的なページは配信の費用がほとんどかからないので、値段を付ける理由がありません。
連絡
評価が違うポリシー、韓国語や日本語で読みにくい文、ここにあるべきなのに無い出力形式は [email protected] まで。ポリシーと期待した結果を添えてください。