HTML 위생 검사 살펴보기
HTML 필드와 번역된 HTML 필드에서 HTML 마크업을 삭제하여 불필요한 코드를 제거하고 교차 사이트 스크립팅 공격과 같은 보안 문제로부터 보호합니다.
HTML 정리를 사용하여 인스턴스 내의 HTML 콘텐츠에 잠재적으로 유해한 콘텐츠가 포함되어 있지 않도록 합니다. HTML 정리는 인스턴스를 손상시키는 데 사용될 수 있는 HTML 태그(예: <![CDATA[<script>]]>) <link>또는 <embed> 인스턴스에서 원치 않는 스크립트를 실행하거나 사용자를 원치 않는 콘텐츠로 안내하는 데 사용될 수 있는 태그를 제거하는 방식으로 작동합니다. 콘텐츠의 서식을 제어하는 안전한 태그는 유지됩니다. 관리자는 제거되거나 보존되는 콘텐츠를 사용자 지정할 수 있습니다. 또한 위생을 모든 콘텐츠에 적용할지 또는 지정한 필드에만 적용할지를 제어할 수 있습니다.
HTML 위생 검사는 항상 유지하려는 마크업에 대한 기본 제공 포함 목록을 확인하여 작동합니다. 새니타이저는 관리자가 내장 포함 목록을 수정하는 데 사용할 수 있는 HTMLSanitizerConfig 스크립트 포함을 제공합니다. 제외 목록에 항목을 추가하여 HTML 마크업을 제거할 수도 있습니다. 제외 목록의 내용이 포함 목록을 재정의합니다.
포함 및 제외 목록에 추가할 수 있는 항목 유형은 다음과 같습니다.
- 전역 속성
- 모든 HTML 요소
주:
기본적으로
href 및 src 와 같은 URL 속성은 다음 프로토콜만 지원합니다.httphttpsmailto데이터
예:
<a href="https://community.servicenow.com/community"> ServiceNow 커뮤니티 </a>
주:
HTML 위생 검사 사용을 제어하는 속성에 대한 glide.html.sanitize_all_fields 자세한 내용은 인스턴스 보안 강화 설정을 참조하십시오 HTML 위생 검사 사용 [Security Center 1.3에서 업데이트됨] .
urlAttributes 및 프로토콜 구성
HTMLSanitizer 스크립트 포함에서 urlAttributes 및 해당 프로토콜을 구성할 수 있습니다. 예:
HTML_WHITELIST : {
urlAttributes: { "protocols" : [ "file", "notes" ] },
- -
- -
}이 예에서는 메모가 포함 목록에 있기 때문에 이 URL은 삭제되지 않습니다.
<a title=“Lotus” href=“Notes://ABC/X575C90019DE33/ABC594DCB76D86EB4925653E0011C4C1/ZZ90B7E2D33964749257EEA003456FD”>Lotus</a></p> 기본 포함 목록
주:
기본 포함 목록은 시스템 목록이며 인스턴스에서 사용자가 액세스할 수 없습니다.
BUILTIN_HTML_WHITELIST :{
globalAttributes:{ attribute:["id","class","lang","title","style"],
attributeValuePattern:{}},
label:{ attribute:["for"]},
font:{ attribute:["color","face","size"]},
a:{ attribute:["href","nohref","name","shape"]},
img:{ attribute:["src","name","alt","border","hspace","vspace","align","height","width"},
table:{ attribute:["border","cellpadding","cellspacing","bgcolor","background","align","no resize","height","width","summary","frame","rules"]},
th:{ attribute:["background","bgcolor","abbr","axis","headers","scope","nowrap","height","width","align","valign","char off","char","colspan","rowspan"]},
td:{ attribute:["background","bgcolor","abbr","axis","headers","scope","nowrap","height","width","align","valign","char off","char","colspan","rowspan"]},
tr:{ attribute:["background","height","width","align","valign","char off","char"]},
thead:{attribute:["align","valign","char off","char"]},
tbody:{attribute:["align","valign","char off","char"]},
tfoot:{attribute:["align","valign","char off","char"]},
colgroup:{attribute:["align","valign","char off","char","span","width"]},
col:{attribute:["align","valign","char off","char","span","width"]},
p:{attribute:["align"]},
style:{attributeValuePattern:{"type":"text/css"}}
canvas:{ attribute:["height","width"]},
details:{ attribute:["open"]},
summary:{ attribute:["open","valign","char off","char"]},
button:{ attribute:["disabled","accesskey","type"]},
form:{},
input:{ attribute:["size","maxlength","checked","alt","src","type","disabled","readonly","accesskey","border","usemap"]},
select:{ attribute:["disabled","multiple","size"]},
textarea:{ attribute:["rows","cols","disabled","readonly","accesskey"]},
option:{ attribute:["disabled","label","selected"]},
div:{ attribute:["align"]},
ol:{ attribute:["start","type","square"]},
ul:{ attribute:["type","square","itemscope","itemtype","itemref"]},
li:{ attribute:["value","fb__id","itemprop"]},
span:{ attribute:["color","size","data-mce-bogus","itemprop","face"]},
br:{ attribute:["clear"]},
h3:{ attribute:["itemprop"]},
html:{ attribute:["xmlns","lang","xml:lang"]},
link:{ attribute:["rel","type","href","charset"]},
meta:{ attribute:["name","content","scheme","charset","http-equiv"]},
pre:{ attribute:["xml:space"]},
noscript:{}, h1:{}, h2:{}, h4:{}, h5:{}, h6:{},
i:{}, b:{}, u:{}, strong:{}, em:{}, small:{}, big:{},
pre:{}, code:{}, cite:{}, samp:{}, sub:{}, sup:{},
strike:{}, center:{}, blockquote:{}, hr:{}, map:{},
dd:{}, dt:{}, dl:{}, fieldset:{}, legend:{}, figure:{}, tt:{},
body:{}, caption:{}, head:{}, title:{}, shape:{},},