Download the PHP package integer-net/magento2-sansec-watch without Composer

On this page you can find all versions of the php package integer-net/magento2-sansec-watch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-sansec-watch

IntegerNet_SansecWatch Module

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

Setup

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 https://sansec.watch/d/account/list and select a project (e.g. 685769a2-38a4-4d06-a19a-67a528197f51)

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)

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

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

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

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


All versions of magento2-sansec-watch with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3.0
beberlei/assert Version ^3.3
cuyz/valinor Version ^2.4.0
magento/framework Version >=100.0.0
magento/module-csp Version *
symfony/clock Version ^6.4 || ^7.0 || ^8.0
symfony/http-client Version ^5.0 || ^6.0 || ^7.0 || ^8.0
symfony/uid Version ^6.2 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package integer-net/magento2-sansec-watch contains the following files

Loading the files please wait ...