TMAegis
sharepoint 관련 규칙 더 보기

TMA-SHAREPOINT-7.3

Ensure compilation or scripting of database pages via the PageParserPaths elements is not allowed

높음레벨 1자동sharepoint

설명

Allowing compilation or scripting of database pages via the "PageParserPaths" elements can lead to disclosure of compilation error messages containing server info and source code exposed to the user. Reads every local web application web.config (all zones) and prints the number of PageParserPath entries under SharePoint/SafeMode/PageParserPaths (expected 0). Run on each Web Front End; a missing web.config fails the audit. Run on a SharePoint farm server as a farm administrator; the audit loads the Microsoft.SharePoint.PowerShell snap-in and fails if it cannot.

점검 방법

감사 방식: 셸 명령

shell
$ErrorActionPreference = 'Stop'; if (-not (Get-Command Get-SPFarm -ErrorAction SilentlyContinue)) { Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop }; if (-not (Get-Command Get-SPFarm -ErrorAction SilentlyContinue)) { throw 'SharePoint cmdlets are not available' }; $cfgs = @(Get-SPWebApplication -ErrorAction Stop | ForEach-Object { $_.IisSettings.Values } | ForEach-Object { Join-Path $_.Path.FullName 'web.config' } | Sort-Object -Unique); if ($cfgs.Count -eq 0) { throw 'no web application web.config found' }; $bad = @($cfgs | ForEach-Object { [xml]$x = Get-Content -LiteralPath $_ -Raw -ErrorAction Stop; @($x.SelectNodes('/configuration/SharePoint/SafeMode/PageParserPaths/PageParserPath')) } | Where-Object { $null -ne $_ }); $bad.Count
예상 출력
0

조치 방법

조치 방식: 가이드 또는 인프라 패치

Remove every <PageParserPath .../> element from <PageParserPaths> in each web application's web.config (leave the element empty), then recycle the application pool.

속성

운영 체제
모두
태그
sharepointweb-config
참고 자료
CIS Microsoft SharePoint 2019 Benchmark v1.0.0 - 7.3 Ensure compilation or scripting of database pages via the PageParserPaths elements is not allowed

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target sharepoint