diff --git a/CleanArchitecture.Api/CleanArchitecture.Api.csproj b/CleanArchitecture.Api/CleanArchitecture.Api.csproj index ccdc93f..8a3e45e 100644 --- a/CleanArchitecture.Api/CleanArchitecture.Api.csproj +++ b/CleanArchitecture.Api/CleanArchitecture.Api.csproj @@ -8,6 +8,7 @@ + diff --git a/CleanArchitecture.Api/Program.cs b/CleanArchitecture.Api/Program.cs index 83b8246..4c7772a 100644 --- a/CleanArchitecture.Api/Program.cs +++ b/CleanArchitecture.Api/Program.cs @@ -1,4 +1,5 @@ using System; +using Aikido.Zen.DotNetCore; using CleanArchitecture.Api.BackgroundServices; using CleanArchitecture.Api.Extensions; using CleanArchitecture.Application.Extensions; @@ -27,6 +28,11 @@ builder.Services.AddGrpc(); builder.Services.AddGrpcReflection(); builder.Services.AddEndpointsApiExplorer(); +if (builder.Environment.IsProduction()) +{ + builder.Services.AddZenFirewall(); +} + builder.Services .AddHealthChecks() .AddDbContextCheck() @@ -129,6 +135,11 @@ app.UseHttpsRedirection(); app.UseAuthentication(); app.UseAuthorization(); +if (builder.Environment.IsProduction()) +{ + app.UseZenFirewall(); +} + app.MapHealthChecks("/healthz", new HealthCheckOptions { ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse diff --git a/CleanArchitecture.Api/appsettings.json b/CleanArchitecture.Api/appsettings.json index eb84fec..cf53298 100644 --- a/CleanArchitecture.Api/appsettings.json +++ b/CleanArchitecture.Api/appsettings.json @@ -21,5 +21,8 @@ "Username": "admin", "Password": "DOIA9234JF", "Enabled": "True" + }, + "Aikido": { + "AikidoToken": "" } }