security: redact Sentry request credentials (#411)
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and tests (pull_request) Successful in 19m42s
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Successful in 15m43s
Heimdall Gitea / Publish versioned installer release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 2s
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and tests (pull_request) Successful in 19m42s
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Successful in 15m43s
Heimdall Gitea / Publish versioned installer release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 2s
This commit is contained in:
1 parent
04b3279d1f
commit
05dbcbdc69
5 files changed
+289
-8
No files matched your search
@@ -17,6 +17,7 @@ using Heimdall.Api.Hubs;
|
||||
using Heimdall.Api;
|
||||
using Heimdall.Web.Services;
|
||||
using Heimdall.Web;
|
||||
using Heimdall.Web.Security;
|
||||
using Hangfire;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
@@ -822,18 +823,12 @@ public partial class Program
|
||||
options.SetBeforeSend(static (sentryEvent, _) =>
|
||||
{
|
||||
sentryEvent.ServerName = null;
|
||||
if (sentryEvent.Extra?.ContainsKey("password") == true)
|
||||
(sentryEvent.Extra as IDictionary<string, object?>)?.Remove("password");
|
||||
if (sentryEvent.Extra?.ContainsKey("token") == true)
|
||||
(sentryEvent.Extra as IDictionary<string, object?>)?.Remove("token");
|
||||
if (sentryEvent.Extra?.ContainsKey("secret") == true)
|
||||
(sentryEvent.Extra as IDictionary<string, object?>)?.Remove("secret");
|
||||
return sentryEvent;
|
||||
return SentryTelemetryPrivacy.Sanitize(sentryEvent);
|
||||
});
|
||||
options.SetBeforeBreadcrumb(breadcrumb
|
||||
=> breadcrumb.Category == "Microsoft.AspNetCore.RateLimiting"
|
||||
? null
|
||||
: breadcrumb);
|
||||
: SentryTelemetryPrivacy.SanitizeBreadcrumb(breadcrumb));
|
||||
}
|
||||
|
||||
internal static void ConfigureMiddleware(WebApplication app)
|
||||
|
||||
Reference in new issue
Block a user