security-headers

Configure security headers for ASP.NET Core Razor Pages applications.

10|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill security-headers-agibuild
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-headers
Source: https://github.com/AGIBuild/Agibuild.Fulora/tree/main/.cursor/skills/security-headers
Command: npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill security-headers-agibuild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers implement robust security headers in ASP.NET Core applications, protecting against common web vulnerabilities like XSS, clickjacking, and man-in-the-middle attacks.

Core Features & Use Cases

  • Comprehensive Header Configuration: Implements and configures essential security headers including Content Security Policy (CSP), HTTP Strict Transport Security (HSTS), X-Frame-Options, and more.
  • Best Practice Enforcement: Provides patterns for both built-in and custom middleware to ensure secure header implementation.
  • Use Case: When deploying an ASP.NET Core Razor Pages application, use this Skill to ensure all necessary security headers are correctly configured to mitigate common web threats.

Quick Start

Apply the security-headers skill to configure Content Security Policy and HSTS for an ASP.NET Core application.

Frequently Asked Questions about security-headers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Content Security Policy and HSTS in an ASP.NET Core Razor Pages application?

To configure Content Security Policy and HSTS in ASP.NET Core, apply custom middleware or built-in extensions to inject the necessary HTTP response headers. This enforces strict transport security and mitigates cross-site scripting risks for your Razor Pages application.

What security headers do I need to protect my ASP.NET Core app from clickjacking and XSS?

Essential security headers to protect against clickjacking and XSS include Content Security Policy, X-Frame-Options, and HTTP Strict Transport Security. Implementing these headers in ASP.NET Core establishes browser trust policies that block malicious frame embedding and unauthorized script execution.

How do I implement nonce-based CSP for an ASP.NET Core application?

Implementing nonce-based CSP in ASP.NET Core involves generating a cryptographic nonce per request and attaching it to script tags within your Razor Pages. The custom middleware patterns provided inject this nonce into the Content Security Policy header to safely allow inline scripts.

Can I manage security header configuration for ASP.NET Core using appsettings.json?

Yes, you can manage security header configuration using appsettings.json in ASP.NET Core. This approach allows you to externally define and adjust header values like CSP directives and HSTS expiration without modifying the core middleware codebase.

Does the security headers implementation support .NET 8 and nullable reference types?

The security headers implementation fully supports .NET 8 and nullable reference types. This ensures compile-time null safety and compatibility with modern ASP.NET Core Razor Pages applications utilizing the latest framework features.

When should I use custom middleware instead of built-in extensions for adding security headers in ASP.NET Core?

Use custom middleware for adding security headers in ASP.NET Core when you require granular control over header injection or need to implement dynamic policies like nonce-based CSP. Built-in extensions handle standard static headers like HSTS more efficiently.