mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 06:03:12 +08:00
fix(logging): [PM-28877] Remove Config for PII Logging (#6885)
* fix(logging): [PM-28877] Remove Config for PII Logging - Removed all references to logging being set to true even in dev environment. * fix(logging): [PM-28877] Remove Config for PII Logging - Fixed up with a better understanding of the original ask. * fix(logging): [PM-28877] Remove Config for PII Logging - Removed all show pii.
This commit is contained in:
committed by
GitHub
parent
bfefd27a38
commit
f29fd4d9c2
@@ -8,7 +8,6 @@ using Bit.Core.Utilities;
|
|||||||
using Bit.SharedWeb.Utilities;
|
using Bit.SharedWeb.Utilities;
|
||||||
using Bit.Sso.Utilities;
|
using Bit.Sso.Utilities;
|
||||||
using Duende.IdentityServer.Services;
|
using Duende.IdentityServer.Services;
|
||||||
using Microsoft.IdentityModel.Logging;
|
|
||||||
using Stripe;
|
using Stripe;
|
||||||
|
|
||||||
namespace Bit.Sso;
|
namespace Bit.Sso;
|
||||||
@@ -91,20 +90,15 @@ public class Startup
|
|||||||
|
|
||||||
public void Configure(
|
public void Configure(
|
||||||
IApplicationBuilder app,
|
IApplicationBuilder app,
|
||||||
IWebHostEnvironment env,
|
IWebHostEnvironment environment,
|
||||||
IHostApplicationLifetime appLifetime,
|
IHostApplicationLifetime appLifetime,
|
||||||
GlobalSettings globalSettings,
|
GlobalSettings globalSettings,
|
||||||
ILogger<Startup> logger)
|
ILogger<Startup> logger)
|
||||||
{
|
{
|
||||||
if (env.IsDevelopment() || globalSettings.SelfHosted)
|
|
||||||
{
|
|
||||||
IdentityModelEventSource.ShowPII = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add general security headers
|
// Add general security headers
|
||||||
app.UseMiddleware<SecurityHeadersMiddleware>();
|
app.UseMiddleware<SecurityHeadersMiddleware>();
|
||||||
|
|
||||||
if (!env.IsDevelopment())
|
if (!environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
var uri = new Uri(globalSettings.BaseServiceUri.Sso);
|
var uri = new Uri(globalSettings.BaseServiceUri.Sso);
|
||||||
app.Use(async (ctx, next) =>
|
app.Use(async (ctx, next) =>
|
||||||
@@ -120,7 +114,7 @@ public class Startup
|
|||||||
app.UseForwardedHeaders(globalSettings);
|
app.UseForwardedHeaders(globalSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
if (environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
app.UseCookiePolicy();
|
app.UseCookiePolicy();
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ using Bit.Api.Tools.Models.Request;
|
|||||||
using Bit.Api.Vault.Models.Request;
|
using Bit.Api.Vault.Models.Request;
|
||||||
using Bit.Core.Auth.Entities;
|
using Bit.Core.Auth.Entities;
|
||||||
using Bit.SharedWeb.Health;
|
using Bit.SharedWeb.Health;
|
||||||
using Microsoft.IdentityModel.Logging;
|
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Bit.SharedWeb.Utilities;
|
using Bit.SharedWeb.Utilities;
|
||||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||||
@@ -238,8 +237,6 @@ public class Startup
|
|||||||
GlobalSettings globalSettings,
|
GlobalSettings globalSettings,
|
||||||
ILogger<Startup> logger)
|
ILogger<Startup> logger)
|
||||||
{
|
{
|
||||||
IdentityModelEventSource.ShowPII = true;
|
|
||||||
|
|
||||||
// Add general security headers
|
// Add general security headers
|
||||||
app.UseMiddleware<SecurityHeadersMiddleware>();
|
app.UseMiddleware<SecurityHeadersMiddleware>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Bit.SharedWeb.Utilities;
|
using Bit.SharedWeb.Utilities;
|
||||||
using Microsoft.IdentityModel.Logging;
|
|
||||||
|
|
||||||
namespace Bit.EventsProcessor;
|
namespace Bit.EventsProcessor;
|
||||||
|
|
||||||
@@ -40,7 +39,6 @@ public class Startup
|
|||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
IdentityModelEventSource.ShowPII = true;
|
|
||||||
// Add general security headers
|
// Add general security headers
|
||||||
app.UseMiddleware<SecurityHeadersMiddleware>();
|
app.UseMiddleware<SecurityHeadersMiddleware>();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ using Bit.SharedWeb.Swagger;
|
|||||||
using Bit.SharedWeb.Utilities;
|
using Bit.SharedWeb.Utilities;
|
||||||
using Duende.IdentityServer.Services;
|
using Duende.IdentityServer.Services;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using Microsoft.IdentityModel.Logging;
|
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
namespace Bit.Identity;
|
namespace Bit.Identity;
|
||||||
@@ -170,16 +169,14 @@ public class Startup
|
|||||||
|
|
||||||
public void Configure(
|
public void Configure(
|
||||||
IApplicationBuilder app,
|
IApplicationBuilder app,
|
||||||
IWebHostEnvironment env,
|
IWebHostEnvironment environment,
|
||||||
GlobalSettings globalSettings,
|
GlobalSettings globalSettings,
|
||||||
ILogger<Startup> logger)
|
ILogger<Startup> logger)
|
||||||
{
|
{
|
||||||
IdentityModelEventSource.ShowPII = true;
|
|
||||||
|
|
||||||
// Add general security headers
|
// Add general security headers
|
||||||
app.UseMiddleware<SecurityHeadersMiddleware>();
|
app.UseMiddleware<SecurityHeadersMiddleware>();
|
||||||
|
|
||||||
if (!env.IsDevelopment())
|
if (!environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
var uri = new Uri(globalSettings.BaseServiceUri.Identity);
|
var uri = new Uri(globalSettings.BaseServiceUri.Identity);
|
||||||
app.Use(async (ctx, next) =>
|
app.Use(async (ctx, next) =>
|
||||||
@@ -196,7 +193,7 @@ public class Startup
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Default Middleware
|
// Default Middleware
|
||||||
app.UseDefaultMiddleware(env, globalSettings);
|
app.UseDefaultMiddleware(environment, globalSettings);
|
||||||
|
|
||||||
if (!globalSettings.SelfHosted)
|
if (!globalSettings.SelfHosted)
|
||||||
{
|
{
|
||||||
@@ -204,7 +201,7 @@ public class Startup
|
|||||||
app.UseMiddleware<CustomIpRateLimitMiddleware>();
|
app.UseMiddleware<CustomIpRateLimitMiddleware>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
if (environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Bit.Core.Utilities;
|
|||||||
using Bit.SharedWeb.Utilities;
|
using Bit.SharedWeb.Utilities;
|
||||||
using Duende.IdentityModel;
|
using Duende.IdentityModel;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using Microsoft.IdentityModel.Logging;
|
|
||||||
|
|
||||||
namespace Bit.Notifications;
|
namespace Bit.Notifications;
|
||||||
|
|
||||||
@@ -84,8 +83,6 @@ public class Startup
|
|||||||
IWebHostEnvironment env,
|
IWebHostEnvironment env,
|
||||||
GlobalSettings globalSettings)
|
GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
IdentityModelEventSource.ShowPII = true;
|
|
||||||
|
|
||||||
// Add general security headers
|
// Add general security headers
|
||||||
app.UseMiddleware<SecurityHeadersMiddleware>();
|
app.UseMiddleware<SecurityHeadersMiddleware>();
|
||||||
|
|
||||||
|
|||||||
@@ -472,11 +472,6 @@ public static class ServiceCollectionExtensions
|
|||||||
addAuthorization.Invoke(config);
|
addAuthorization.Invoke(config);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment.IsDevelopment())
|
|
||||||
{
|
|
||||||
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddCustomDataProtectionServices(
|
public static void AddCustomDataProtectionServices(
|
||||||
@@ -666,7 +661,6 @@ public static class ServiceCollectionExtensions
|
|||||||
Constants.BrowserExtensions.OperaId
|
Constants.BrowserExtensions.OperaId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user