dmk / mkcleaner
Cleans files by removing any metadata with the help of mat2, exiftool and qpdf according to BSI guidelines.
Installs: 164
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- php: ^8.1 || ^8.2 || ^8.3
- typo3/cms-core: ^11.5 || ^12.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4
- php-parallel-lint/php-parallel-lint: ^1.3
- phpcompatibility/php-compatibility: ^9.3.5
- phpmd/phpmd: ^2.13
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.9
- rector/rector: ^1.0
- saschaegerer/phpstan-typo3: ^1.8
- sebastian/phpcpd: ^4.0 || ^5.0 || ^6.0
- ssch/typo3-rector: ^2.5
- typo3/testing-framework: ^6.0 | ^7.0
This package is auto-updated.
Last update: 2024-11-14 14:46:32 UTC
README
What does it do?
This extension cleans files by removing most of the metadata according to the BSI
guidelines. This is a important step when it comes
to security so no sensitive information is leaked.
This is done with mat2 (https://0xacab.org/jvoisin/mat2), exiftool (https://exiftool.org/) and qpdf (https://github.com/qpdf/qpdf)
in the moment. You need to install/provide those commands on the server CLI.
If some command is not available system-wide the path
can be configured with $GLOBALS['TYPO3_CONF_VARS']['SYS']['binSetup']
or
$GLOBALS['TYPO3_CONF_VARS']['SYS']['binPath']
.
Check the logs for errors after uploading files etc.
As soon as everything is setup almost every file that is added/replaced with the TYPO3 FAL API will be cleaned. Furthermore there is a scheduler job that can be used for an initial cleanup of desired folders.
Adding a custom cleaner
A custom cleaner can be added in ext_localconf.php
like this:
\DMK\Mkcleaner\Cleaner\Registry::registerCleaner(\Vendor\Package\Cleaner\CustomCleaner::class, 100);
Every cleaner needs to implement DMK\Mkcleaner\Cleaner\CleanerInterface
. Please take a look at the
existing cleaners.
Drawbacks
Please keep in mind that neither of the tools is perfect and might break files or leave metadata present. For example pdf files sometimes loose all links or svg files have changed content when mat2 would be used. Therefore pdf files are cleaned with exiftool and qpdf instead of mat2 and svg files are omitted completely. Please take care of having svg files without metadata yourself.
Changelog
v12.0.1: Optimized description v12.0.0: Compatibility for TYPO3 11.5 and 12.4 only v8.0.2: add some error handling v8.0.1: resolve symlinks v8.0.0: initial release