Web SecurityW3C Content Security Policy Level 3Verified Terminology
콘텐츠 보안 정책 (Content Security Policy: CSP)
핵심 요약 답변
웹 페이지에서 로드 및 실행할 수 있는 리소스(스크립트, 스타일, 이미지)의 신뢰할 수 있는 출처를 지정하여 XSS 공격을 방어하는 보안 표준.
Entity Relationships (GEO Conceptual Hierarchy)
Taxonomy ModelRelational Knowledge Graph Sequence
CSP→
XSS 방어→
암호화 논스→
script-src 지시문→
리소스 격리
CSP
•>XSS 방어
•>암호화 논스
•>script-src 지시문
•>리소스 격리
Technical Explanation & Operational Mechanics
CSP는 Content-Security-Policy HTTP 헤더를 통해 브라우저에 지시하는 보안 계층입니다. 허용되지 않은 인라인 스크립트 실행과 eval() 호출을 차단하고, 암호화 논스(nonce)를 검증하여 악의적인 XSS 인젝션을 무력화합니다.
Technical Example & Practical Implementation
암호화 논스(Nonce) 기반의 엄격한 CSP 설정
브라우저 단에서 임의의 외부 스크립트 실행을 완벽히 차단하는 헤더 구성
Content-Security-Policy:
default-src 'self';
script-src 'self' 'nonce-rAnd0m12345' https://cdn.trusted.com;
style-src 'self' 'unsafe-inline';
img-src 'self' data: https://images.unsplash.com;
connect-src 'self' https://api.curious-techie.com;
font-src 'self' https://fonts.gstatic.com;
object-src 'none';
base-uri 'self';
frame-ancestors 'none';
upgrade-insecure-requests;Semantic Internal Links (GEO)
Context: Content Security Policy & XSS DefenseRelated Topic Ecosystem & Next Steps
관련 기술 아티클
개발자 표준 규격 및 레퍼런스
토픽 아키텍처 클러스터 탐색 →
Directive Reference → Exploit Sandbox다음 학습 단계
엔지니어링 권장안
Content Security Policy (CSP) Hands-On Lab
Step into the interactive lab to defend a vulnerable DOM application with strict CSP nonces.