Skip to content

ipedis/security-file-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

security-file-bundle

This bundle includes three libraries for the security of files.

Installation :

add on your composer.json the repository:

"repositories": [
{
"type": "vcs",
"url": "github:ipedis/security-file-bundle.git"
},
{
"type": "vcs",
"url": "github:ipedis/file-sanitizer.git"
},
{
"type": "vcs",
"url": "github:ipedis/validation-handler.git"
}
...

then

composer require "ipedis/security-file-bundle"

Usage :

file sanitizer :

Configuration of file sanitizer is on the security_file.yaml :

# config/packages/security_file.yaml
security_file:
  sanitizers:
    html_sanitizer:
      type: html
      config:
        ignored_step:
        custom_step:
    xml_sanitizer:
      type:  xml
      config:
        ignored_step:
        custom_step:
    ......

We can add many configuration . We use the camelCase of the name of the configuration to use it on service

ex: to use html_sanitizer on this configuration above :

class DummyHtml
{

    public function __construct(SanitizerInterface $htmlSanitizer)
    {}
    .....

Library documentation


bomb scanner :

To use Bomb scanner we can use BombScannerDecorator service.

By default, engine used on this service is zip. But we can modify it or add more engine with configuration in security_file:

# config/packages/security_file.yaml
security_file:
    ......
    scanner:
      engines:
        - zip
        - rar

Library documentation


validation handler :

Use service FileValidator

Library documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages