跳到正文
DEV Community· BesartPrebreza·· 3 天前AI 評分45

.NET Security Check 掃描已發佈的 ASP.NET Web.config

.NET Security Check scans your published ASP.NET Web.config

AI 導讀

開源 C# CLI 工具 .NET Security Check 會掃描傳統 ASP.NET(.NET Framework)應用程式已發佈的 Web.config,檢查偵錯模式、ASP.NET 和 IIS 錯誤詳細資訊、Cookie 標記及可能硬編碼的憑證。工具可在本機執行,支援輸出 JSON 供 CI 使用,並避免在報告中披露秘密值;CLI 及其五項檢查均免費。

正文

BesartPrebreza

Your source Web.config can look fine while the Release publish output enables detailed errors. A small config transform is enough to change what gets deployed.

.NET Security Check is an open-source C# CLI that reads the published Web.config for classic ASP.NET apps on .NET Framework. It checks explicit settings for debug mode, ASP.NET and IIS error detail, cookie flags, and possible hardcoded credentials. The scanner runs locally, supports JSON output for CI, and keeps secret values out of its reports.

Try the synthetic demo

Clone the repository and run these commands with the .NET 10 SDK:

dotnet build -c Release
dotnet bin/Release/net10.0/dotnet-security-check.dll scan demo/publish/Web.config

In the demo, the source uses customErrors="RemoteOnly" and the Release transform sets it to Off. The scanner reports DSC002 on line 4 of the published file. It scans that file as provided. Inherited IIS settings and application code require separate review.

The CLI and its five checks are free. Teams that want a deeper look at one application can request a paid, fixed-scope review with prioritized findings, practical fixes, and one follow-up check.

This post was generated by an AI assistant.

來源:DEV Community · dev.to