Skip to content

Instantly share code, notes, and snippets.

View alanta's full-sized avatar

Marnix van Valen alanta

View GitHub Profile
@alanta
alanta / azure-waf-rule-with-overrides.json
Created May 2, 2021 21:00
Disable specific built-in firewall rules that are causing excessive blocking on an Azure Application Gateway.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
"publicSitePolicy": "my-wafpolicy-for-public-sites",
"htmlOwaspRuleOverrides": [
{
"ruleGroupName": "REQUEST-932-APPLICATION-ATTACK-RCE",
"rules": [
@alanta
alanta / SwaggerExtensions.cs
Created February 6, 2023 09:15
Add HMAC support to Swagger
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Swashbuckle.AspNetCore.SwaggerUI;
public static void AddSwaggerHMACSupport(this IServiceCollection services)
{
const string HmacSecretHeaderName = "X-HMAC-Secret";
services.Configure<SwaggerUIOptions>(opts =>
{