Repository navigation
C#: Document custom redaction barriers - #23201
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The review evidence identifies no active issues, and the change is limited to documenting custom redaction barrier modeling and its relevant CodeQL guidance.
No open issues 🎉
What changed in this PR
Documents how C# users can model custom redaction methods as barriers for cs/exposure-of-sensitive-information, preventing alerts on redacted values while preserving alerts for raw sensitive data.
Changes:
- Adds a YAML
barrierModelexample targeting thefile-content-storebarrier kind. - Explains the
ReturnValueaccess path and links to the C# library-model customization documentation.
| File | Description |
|---|---|
| csharp/ql/src/Security Features/CWE-359/ExposureOfPrivateInformation.qhelp | Documents custom redaction barrier modeling and provides a relevant CodeQL documentation link. |
Review effort: Lite (adaptive)
|
QHelp previews: csharp/ql/src/Security Features/CWE-359/ExposureOfPrivateInformation.qhelpExposure of private informationPrivate information that is stored in an external location may be more vulnerable because that location may not be protected by the same access controls as other parts of the system. Examples include log files, cookies and plain text storage on disk. RecommendationEnsure that private information is only stored in secure data locations. Custom methods that redact private information can be modeled as barriers for this query using the ExampleThe following example shows some private data - an address - being passed to a HTTP handler. This private information is then stored in a log file. This log file on disk may be accessible to users that do not normally have access to this private data. using System.Text;
using System.Web;
using System.Web.Security;
public class PrivateInformationHandler : IHttpHandler
{
public void ProcessRequest(HttpContext ctx)
{
string address = ctx.Request.QueryString["Address1"];
logger.Info("User has address: " + address);
}
}References
|
Document that custom C# redaction methods can be modeled as barriers for
cs/exposure-of-sensitive-informationusing thefile-content-storekind. The query help links to the public C# model customization documentation for details on defining these models.Rendered the revised query help with
codeql generate query-help --format=markdown --warnings=errorand checked the resulting recommendation and reference link. Verified that the linked documentation returns HTTP 200 and covers barrier models.git diff --checkpasses.Fixes #23160.