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. [Utility &amp; Helpers](/categories/utility)
4. /
5. integer-net/magento2-sansec-watch

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

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

Sansec Watch integration for Magento 2

1.1.1(1mo ago)40206.6k↓31.2%3[1 issues](https://github.com/integer-net/magento2-sansec-watch/issues)MITPHPPHP &gt;=8.1.0

Since Oct 4Pushed 2w 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 today

READMEChangelogDependencies (42)Versions (20)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

57

—

FairBetter than 98% of packages

Maintenance93

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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 ~41 days

Recently: every ~115 days

Total

16

Last Release

17d ago

Major Versions

1.1.1 → 2.0.0-beta2026-06-16

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

2.0.0-betaPHP &gt;=8.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2962722?v=4)[integer\_net GmbH](/maintainers/integer-net)[@integer-net](https://github.com/integer-net)

---

Top Contributors

[![renttek](https://avatars.githubusercontent.com/u/1931090?v=4)](https://github.com/renttek "renttek (66 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.5k5.9M736](/packages/sylius-sylius)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[contao/core-bundle

Contao Open Source CMS

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

FIDO2/Webauthn Support For PHP

12310.5M135](/packages/web-auth-webauthn-lib)[symfony/ai-platform

PHP library for interacting with AI platform provider.

521.4M289](/packages/symfony-ai-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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