PHPackages                             sterc/csp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. sterc/csp

ActiveLibrary[Security](/categories/security)

sterc/csp
=========

MODX 3 extra to manage CSP headers

2.0.0(1y ago)15081MITPHPPHP &gt;=8.1

Since Jun 21Pushed 1y ago7 watchersCompare

[ Source](https://github.com/Sterc/csp)[ Packagist](https://packagist.org/packages/sterc/csp)[ RSS](/packages/sterc-csp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Sterc Content Security Policy
-----------------------------

[](#sterc-content-security-policy)

The New Skeleton Structure
==========================

[](#the-new-skeleton-structure)

### Dependencies

[](#dependencies)

This package requires [mmxDatabase](https://packagist.org/packages/mmx/database) to work with MODX database using Eloquent models.

The `mmx/database` dependency will be downloaded automatically by Composer, you need only install it inside MODX.

### Prepare

[](#prepare)

This package can be installed only with Composer.

If you are still not using Composer with MODX 3, just download the `composer.json` of your version:

```
cd /to/modx/root/
wget https://raw.githubusercontent.com/modxcms/revolution/v3.0.4-pl/composer.json
```

Then run `composer update` and you are ready to install this package.

### Install

[](#install)

```
composer require sterc/csp
composer exec mmx-database install # optional, if you haven't used Eloquent for MODX 3 before
composer exec sterc-csp install
```

After installation, module appears in the menu.

There was an issue with the symlink used to link the assets/components/sterc-csp folder to its actual location inside the vendor folder. However, it all worked after sterc-scp/assets files were copied to the location inside webroot/assets/components/ folder.

```
cp -r ./webroot/core/vendor/sterc/csp/assets/* to ./webroot/assets/components/sterc-csp/
```

It appears issues is specific for MS Windows machines.

### Update

[](#update)

```
composer update mmx/forms
composer exec mmx-forms install
```

### Remove

[](#remove)

Almost the same commands but in reversed order:

```
composer exec sterc-csp remove
composer exec mmx-database remove # only if you don't want to use Eloquent for MODX 3 anymore
composer remove sterc/csp

```

Custom tables will be deleted along with all other package entities.

The Old Project Skeleton
========================

[](#the-old-project-skeleton)

The old project skeleton has a different structure with webroot and private root folders

In order to install package on older skeleton, additional change is required:

In a file: `private/core/vendor/sterc/csp/core/src/App.php`This line should be added at line 25:

```
$this->modx->services->add('mmxDatabase', new \MMX\Database\App($modx));
```

This is to load mmxDatabase, without this it is not possible to install or use CSP package.

The rest of the installation is the same as with the new skeleton.

There was an issue with frontend call and redirection:

This is a VUE application that loads in modx manager page. The url path was prefixed with /en/.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~219 days

Total

3

Last Release

624d ago

Major Versions

1.0.1 → 2.0.02024-09-02

PHP version history (2 changes)1.0.0PHP &gt;=7.4

2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7454f8586d720a511fac1785b93d56ba3414608b6fd5d0e71dc46547afae9272?d=identicon)[joeke](/maintainers/joeke)

---

Top Contributors

[![joeke](https://avatars.githubusercontent.com/u/2332231?v=4)](https://github.com/joeke "joeke (5 commits)")[![bezumkin](https://avatars.githubusercontent.com/u/1257284?v=4)](https://github.com/bezumkin "bezumkin (3 commits)")[![svrhovac](https://avatars.githubusercontent.com/u/769695?v=4)](https://github.com/svrhovac "svrhovac (1 commits)")

### Embed Badge

![Health badge](/badges/sterc-csp/health.svg)

```
[![Health](https://phpackages.com/badges/sterc-csp/health.svg)](https://phpackages.com/packages/sterc-csp)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

87117.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[paragonie/hidden-string

Encapsulate strings in an object to hide them from stack traces

7410.6M39](/packages/paragonie-hidden-string)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
