The Package adds E-Mail based reporting functionality to NuGet package Walter.Web.Firewall and allows for the logging of incidents via E-Mail by using a E-Mail buffer and sends the emails at configured intervals. The NuGet package is easily activated by dependency injection during service configuration services.AddFireWall(FireWallTrial.License, FireWallTrial.DomainKey , domainName: new Uri("https://www.your-domain.com", UriKind.Absolute) , options => { //your firewall settings }).UseSMTPReportingDatabase(options =>{ options.Archive = TimeSpan.FromDays(180); options.Server = "mail.server.com"; options.UserName = "noreply@your-domain.com"; options.Password = "pa$$w0rd1234"; options.Port = 8889; options.From = "noreply@your-domain.com"; options.IgnoreServerCertificateErrors = true; options.DefaultEmail = "webmaster@your-domain.com"; options.Archive = TimeSpan.FromDays(60); options.MailingList.AddRange(new[] { new EMailAddress("Security Admin","security@your-domain.com") { Frequency= TimeSpan.FromHours(1), Roles= EMailRoles.FireWallAdministrationViolations | EMailRoles.UnauthorizedPhysicalFilesViolation }, new EMailAddress("WAF","info@your-domain.com"){ Frequency= TimeSpan.FromHours(1), Roles= EMailRoles.ProductUpdates | EMailRoles.OwnAccountRelatedViolations } , }); }); More information on how to use this Add-On is available in this manual https://www.asp-waf.com/download/ASP-WAF-FireWall-Getting-Started.pdf as well as on-line at https://www.asp-waf.com/NuGet
$ dotnet add package Walter.Web.FireWall.SMTPLoggerThis package allows you to bundle and send emails containing detected violations.
The bellow sample show how to save emails that have been generated by the firewall when detecting incidents using the DatabaseConnections.FireWallMail constant. You can use a .json settings file or provide the values hardcoded in your startup.cs file
services.AddFireWall(FireWallTrial.License, FireWallTrial.DomainKey
, domainName: new Uri("https://www.your-domain.com", UriKind.Absolute)
, options =>
{
//your firewall options
})
.UseSMTPReportingDatabase(DatabaseConnections.FireWallMail, options =>
{
options.Archive = TimeSpan.FromDays(180);
options.Server = "mail.domain.com";
options.UserName = "noreply@domain.com";
options.Password = "#ksKKjsk";
options.Port = 25;
options.From = "noreply@domain.com";
options.IgnoreServerCertificateErrors = true;
options.DefaultEmail = "dev@domain.com";
options.MailingList.AddRange(new[] {
new EMailAddress("Security Admin","security@domain.com") {
Frequency= TimeSpan.FromHours(1),
Roles= EMailRoles.FireWallAdministrationViolations | EMailRoles.UnauthorizedPhysicalFilesViolation } ,
new EMailAddress("WAF","info@domain.com"){
Frequency= TimeSpan.FromHours(1),
Roles= EMailRoles.ProductUpdates | EMailRoles.OwnAccountRelatedViolations } ,
});
});
The above sample show that the emails are send to a default address as well as a specific mail box with a filter for what types of emails to get and the retention period.
The Frequency value allows you to specify how often emails are to be send and incidents are bundled within the specified time slots.