---
title: "Swimburger - Blog - Security"
description: "Swimburger.net is Niels Swimberghe's technical blog about .NET, cloud, and web development."
canonical: "https://swimburger.net/blog/security"
---

[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=1x1/media/jn2ohzgd/how-to-prevent-email-html-injection-in-c-and-net.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=1x1/media/jn2ohzgd/how-to-prevent-email-html-injection-in-c-and-net.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover,gravity=1x1/media/jn2ohzgd/how-to-prevent-email-html-injection-in-c-and-net.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover,gravity=1x1/media/jn2ohzgd/how-to-prevent-email-html-injection-in-c-and-net.png 500w" sizes="250px" width="250" height="250" alt="How to prevent Email HTML injection in C# and .NET" decoding="async" loading="lazy" style="background-color:#06033a"></picture>

## How to prevent email HTML injection in C# and .NET

4/1/2022 - .NET

Learn how bad actors can inject HTML into your emails in your C# .NET applications and how to mitigate it.



](/blog/dotnet/how-to-prevent-email-html-injection-in-csharp-and-dotnet)[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=1x0.5/media/0eklaput/don-t-let-your-users-get-pwned-via-email-html-injection-3.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=1x0.5/media/0eklaput/don-t-let-your-users-get-pwned-via-email-html-injection-3.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover,gravity=1x0.5/media/0eklaput/don-t-let-your-users-get-pwned-via-email-html-injection-3.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover,gravity=1x0.5/media/0eklaput/don-t-let-your-users-get-pwned-via-email-html-injection-3.png 500w" sizes="250px" width="250" height="250" alt="Hacker in front of a computer running applications in multiple terminals" decoding="async" loading="lazy" style="background-color:#06033a"></picture>

## Don't let your users get pwned via email HTML injection

3/23/2022 - Web

Learn how to prevent HTML injection into your emails and protect your users from bad actors!



](/blog/web/dont-let-your-users-get-pwned-via-email-html-injection)[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=0.4982464937912058x0.4984916607169275/media/ifzbm55o/dotnet-framework-square.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=0.4982464937912058x0.4984916607169275/media/ifzbm55o/dotnet-framework-square.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover,gravity=0.4982464937912058x0.4984916607169275/media/ifzbm55o/dotnet-framework-square.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover,gravity=0.4982464937912058x0.4984916607169275/media/ifzbm55o/dotnet-framework-square.png 500w" sizes="250px" width="250" height="250" alt=".NET Bot" decoding="async" loading="lazy" style="background-color:#fff"></picture>

## Harden Anti-Forgery Tokens with IAntiforgeryAdditionalDataProvider in ASP.NET Core

12/13/2020 - .NET

Using IAntiforgeryAdditionalDataProvider you can harden ASP.NET Core's anti-forgery token feature by adding additional data and validating the additional data.



](/blog/dotnet/harden-anti-forgery-tokens-with-iantiforgeryadditionaldataprovider-in-aspnet-core)[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover/media/1141/bulk-add-ip-access-restrictions-square.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover/media/1141/bulk-add-ip-access-restrictions-square.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover/media/1141/bulk-add-ip-access-restrictions-square.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover/media/1141/bulk-add-ip-access-restrictions-square.png 500w" sizes="250px" width="250" height="250" alt="Azure Logo holding a stop sign and PowerShell logo" decoding="async" loading="lazy" style="background-color:#2D2D2D"></picture>

## Bulk add IP Access Restrictions to Azure App Service using Az PowerShell

6/5/2019 - Azure

Azure App Services are publicly accessible via Azure's public DNS in the format of "\[NAME\].azurewebsites.net", but there are many reasons for not wanting it to be accessible via the DNS. This script uses the Az PowerShell module to bulk add IP Ranges into the Access Restriction feature in App Service.



](/blog/azure/bulk-add-ip-access-restrictions-to-azure-app-service-using-az-powershell)[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover/media/1144/bulk-add-cloudflares-square.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover/media/1144/bulk-add-cloudflares-square.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover/media/1144/bulk-add-cloudflares-square.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover/media/1144/bulk-add-cloudflares-square.png 500w" sizes="250px" width="250" height="250" alt="Azure logo holding stop sign, PowerShell logo, and Cloudflare logo" decoding="async" loading="lazy" style="background-color:#2D2D2D"></picture>

## Bulk add Cloudflare's IPs to Azure App Service Access Restrictions using Az PowerShell

6/5/2019 - Azure

Azure App Services are publicly accessible via Azure's public DNS, but when using Cloudflare you should lock this down to only allow Cloudflare to reach your service. This script will add all Cloudflare's IP ranges to your app service Access Restriction.



](/blog/azure/bulk-add-cloudflares-ips-to-azure-app-service-access-restrictions-using-az-powershell)[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover/media/1147/bulk-add-ip-access-restrictions-square.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover/media/1147/bulk-add-ip-access-restrictions-square.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover/media/1147/bulk-add-ip-access-restrictions-square.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover/media/1147/bulk-add-ip-access-restrictions-square.png 500w" sizes="250px" width="250" height="250" alt="Azure logo holding stop sign and PowerShell logo" decoding="async" loading="lazy" style="background-color:#2D2D2D"></picture>

## Bulk add Application Insights Availability Test IPs to Azure App Service Access Restrictions using Az PowerShell

6/5/2019 - Azure

Azure App Services are publicly accessible via Azure's public DNS, but using Access Restrictions you can lock this down. To ensure your App Insight Availability Tests still work, you can use this PowerShell script to bulk insert all the IP ranges.



](/blog/azure/bulk-add-application-insights-availability-test-ips-to-azure-app-service-access-restrictions-using-az-powershell)[

<picture><img class="blog-post-card__image" src="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=0.5015974440894568x0.5015974440894568/media/1111/cloudflare-thumbnail.png" srcset="https://swimburger.net/cdn-cgi/image/width=250,format=auto,quality=90,height=250,fit=cover,gravity=0.5015974440894568x0.5015974440894568/media/1111/cloudflare-thumbnail.png 250w, https://swimburger.net/cdn-cgi/image/width=375,format=auto,quality=90,height=375,fit=cover,gravity=0.5015974440894568x0.5015974440894568/media/1111/cloudflare-thumbnail.png 375w, https://swimburger.net/cdn-cgi/image/width=500,format=auto,quality=90,height=500,fit=cover,gravity=0.5015974440894568x0.5015974440894568/media/1111/cloudflare-thumbnail.png 500w" sizes="250px" width="250" height="250" alt="MS Paint drawn Cloudflare logo" decoding="async" loading="lazy" style="background-color:#fff"></picture>

## Setting up Cloudflare Full Universal SSL/TLS/HTTPS with an Azure App Services

1/27/2019 - Azure

Using Cloudflare's Universal SSL/TLS service, we can provide our website over a safe HTTPS connection. This post walks you through setting up the SSL/TLS encrypted connection from client to Cloudflare, to your Azure Web Application using the Full (strict) option and Cloudflare's origin certificates.



](/blog/azure/setting-up-cloudflare-full-universal-ssl-with-an-azure-app-services)
