PHPackages                             integer-net/magento2-sansec-watch - 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. integer-net/magento2-sansec-watch

ActiveMagento2-module

integer-net/magento2-sansec-watch
=================================

Sansec Watch integration for Magento 2

1.0.12(7mo ago)35161.2k↓11.4%3MITPHPPHP &gt;=8.1.0

Since Oct 4Pushed 7mo ago11 watchersCompare

[ Source](https://github.com/integer-net/magento2-sansec-watch)[ Packagist](https://packagist.org/packages/integer-net/magento2-sansec-watch)[ RSS](/packages/integer-net-magento2-sansec-watch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (21)Versions (15)Used By (0)

IntegerNet\_SansecWatch Module
==============================

[](#integernet_sansecwatch-module)

This module allows the integration CSP rules from Sansec Watch () into Magento without the need for file manipulations and a re-deployment

Setup
-----

[](#setup)

```
composer require integer-net/magento2-sansec-watch
bin/magento module:enable IntegerNet_SansecWatch
bin/magento setup:upgrade
```

Configuration
-------------

[](#configuration)

The configuration can be found under `Stores > Configuration > IntegerNet > Sansec Watch`Only the sansec watch project ID is needed, which can be found in the URL, if you navigate to  and select a project (e.g. `685769a2-38a4-4d06-a19a-67a528197f51`)

How it works
------------

[](#how-it-works)

The policies are fetched from the Sansec Watch API and saved into a database table (`integernet_sansecwatch_policies`) When Magento collects the CSP rules, it uses the `Magento\Csp\Model\CompositePolicyCollector` class and this module adds a collector to this class, which will read the policies from the database table and add them to the existing policies.

Once policies are fetched from Sansec Watch, the result will be hashed and further updates are only executed, if the newly fetched policies differ from the existing ones. (This is handled via the entry `integernet_sansecwatch` in the `flag` table)

### Full Page Cache (FPC)

[](#full-page-cache-fpc)

After policies are updated (either by an updated list from sansec watch or by force), the FPC will be, depending on the configuration either cleared, invalidated or ignored.

Usage
-----

[](#usage)

### Backend

[](#backend)

Directly below the configuration is a button, `Update Policies Now`, which will fetch and update the policies on demand. This will do a forced update, where rules are updated, even if the hashes of the old and new policies match.

### Command Line

[](#command-line)

An update can be triggered via `bin/magento integer-net:sansec-watch:update`This will by default only update the policies if the hashes of the old and new policies doesn't match.

A dry-run is possible by adding the `--dry-run` flag, which will only fetch and output the policies, but not update the database table.

If an update should be force (regardless of the hashes), the `--force` flag can be added.

### Cronjob

[](#cronjob)

The policies are also fetched via the cronjob `integernet_sansecwatch_update`, which will run every hour (cron expression: `0 * * * *`) This will also only update the database, if the hashes of the old and new policies do not match

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance62

Regular maintenance activity

Popularity45

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.9% 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 ~29 days

Recently: every ~72 days

Total

13

Last Release

237d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78e73cb79c6200c1d74eb632e79da9d227041735160b9795a1146537ba58f386?d=identicon)[integer-net](/maintainers/integer-net)

---

Top Contributors

[![renttek](https://avatars.githubusercontent.com/u/1931090?v=4)](https://github.com/renttek "renttek (63 commits)")[![danslo](https://avatars.githubusercontent.com/u/743661?v=4)](https://github.com/danslo "danslo (1 commits)")[![iranimij](https://avatars.githubusercontent.com/u/31434218?v=4)](https://github.com/iranimij "iranimij (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/integer-net-magento2-sansec-watch/health.svg)

```
[![Health](https://phpackages.com/badges/integer-net-magento2-sansec-watch/health.svg)](https://phpackages.com/packages/integer-net-magento2-sansec-watch)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[adyen/module-payment

Official Magento2 Plugin to connect to Payment Service Provider Adyen.

1663.0M10](/packages/adyen-module-payment)

PHPackages © 2026

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