Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Seckit CSP Nonce

46 sites No security coverage Drupal 9–11
View on drupal.org

This module enhances website security by automatically adding unique "nonce" attributes to all inline JavaScript. It allows you to enforce strict Content Security Policy (CSP) rules to prevent cross-site scripting (XSS) attacks without resorting to less secure methods that would permit malicious code. This makes it easier to support essential scripts like those from Google Tag Manager while improving overall site security.

Introduction

SecKit CSP Nonce automatically adds Content Security Policy (CSP) nonce attributes to all inline JavaScript on your Drupal site, enabling you to enforce strict CSP policies without blocking legitimate scripts.
The Problem: Modern web security requires Content Security Policy headers to prevent Cross-Site Scripting (XSS) attacks. However, CSP blocks all inline JavaScript by default. While you can use 'unsafe-inline' to allow inline scripts, this defeats the entire purpose of CSP by allowing both legitimate scripts AND malicious injected code.
The Solution: This module automatically generates unique, cryptographically random nonce (number used once) values for each page request and adds them to all inline

tags. The nonce is also included in your site's CSP header, allowing legitimate inline scripts to execute while blocking any injected malicious code.

This module is perfect for site administrators who want to:

  • Improve security with strict CSP policies
  • Pass security audits and CSP evaluators
  • Support Google Tag Manager without unsafe-inline
  • Eliminate CSP violations in browser console
  • Comply with modern security best practices
No coding required - just install, configure, and your site becomes more secure!

Features

Core Functionality

  • Automatic Nonce Generation
  • Multiple Operation Modes
  • Comprehensive Script Coverage
  • Unlike other solutions, this module catches inline scripts from:
    • Drupal core and contrib modules
    • Theme templates (Twig files)
    • Raw markup and #markup render elements
    • Google Tag Manager container scripts
    • Third-party integrations and widgets
    • Custom inline JavaScript anywhere on the page
  • SecKit Integration (Optional)
  • Merge with SecKit: Adds nonce to SecKit's existing CSP policy (recommended)
  • Override SecKit: Replaces SecKit's CSP entirely (advanced usage)
  • Google Tag Manager Support
  • Advanced Configuration
  • Zero Code Changes Required
  • Production-Ready

When to Use This Module

Use this module when you need to: Enforce strict Content Security Policy on your site Pass security audits that flag unsafe-inline usage Use Google Tag Manager with proper CSP Eliminate "Refused to execute inline script" console errors Comply with security requirements for government, healthcare, or enterprise sites Support third-party scripts while maintaining security Improve your site's security rating on tools like Mozilla Observatory

Post-Installation

Will be updated soon.

Depends on

Dependencies of the latest stable release

  • system Drupal core >=9.0

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jan 2026
Latest release
3 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0 Stable 9–11 May 14, 2026
1.0.x-dev Dev 9–11 Jan 15, 2026