PHPackages                             nswdpc/silverstripe-asset-scan - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. nswdpc/silverstripe-asset-scan

ActiveSilverstripe-vendormodule[File &amp; Storage](/categories/file-storage)

nswdpc/silverstripe-asset-scan
==============================

Provides an asset store and a scanning backend for Silverstripe assets

v1.2.0(10mo ago)01.7k[1 PRs](https://github.com/nswdpc/silverstripe-asset-scan/pulls)BSD-3-ClausePHP

Since Apr 11Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/nswdpc/silverstripe-asset-scan)[ Packagist](https://packagist.org/packages/nswdpc/silverstripe-asset-scan)[ RSS](/packages/nswdpc-silverstripe-asset-scan/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (11)Used By (0)

Asset scanner for Silverstripe
==============================

[](#asset-scanner-for-silverstripe)

Passes the stream representing an asset to a backend that can perform scanning. If the scan fails, information is logged for further review and the request to store the asset fails.

This works with assets being stored via:

- Uploads
- File::setFrom\* operations

The module ships with a ClamAV backend where clamd can be contacted via a unix socket or TCP socket. The system allows for custom scanning backends to be created and configured.

Requirements
------------

[](#requirements)

To use clamd, you need to have that installed, configured and working.

Installation
------------

[](#installation)

```
composer require nswdpc/silverstripe-asset-scan
```

To use the replacement asset store, add configuration to your project.

The name of the configuration block is up to you.

```
---
Name: 'app-scanning-assetstore'
After:
  - '#assetscore'
---
SilverStripe\Core\Injector\Injector:
  SilverStripe\Assets\Storage\AssetStore:
    class: 'NSWDPC\AssetScan\ScanningFlysystemAssetStore'
```

After configuration flush, the project will be configured to use the asset store provided by this module. It will inherit the properties defined in `#assetscore` configuration.

To use the ClamAVBackend, you must set the socket address value:

```
---
Name: 'app-asset-scan-handling'
After:
  - '#nswdpc-asset-scan-handling'
---
NSWDPC\AssetScan\ClamAVBackend:
  # specify a unix socket location
  address: 'unix:///some/path/to/clamd.sock'
```

You can also set a limit to avoid large files being passed to the backend:

```
NSWDPC\AssetScan\ClamAVBackend:
  # null: all scanned
  # 0: not passed to backend
  # files over this size are not passed to the backend
  bypass_over_size_bytes: 10485760
```

Further configuration
---------------------

[](#further-configuration)

You can configure the maximum chunk size, for use with backends that do chunked scans.

```
---
Name: 'app-asset-scan-handling'
After:
  - '#nswdpc-asset-scan-handling'
---
NSWDPC\AssetScan\Backend:
  # increase chunk size to 20M, value is in bytes
  max_chunk_size: 20971520
```

### Roll your own backend

[](#roll-your-own-backend)

You can use your own scanning backend via Injector, for instance to extend the ClamAVBackend class or have a completely different backend. It must be a subclass of `\NSWDPC\AssetScan\Backend`:

```
---
Name: 'app-asset-scan-handling'
After:
  - '#nswdpc-asset-scan-handling'
---
SilverStripe\Core\Injector\Injector:
  NSWDPC\AssetScan\Backend:
    # set default backend
    class: 'My\App\CustomScanBackend'
```

License
-------

[](#license)

[BSD-3-Clause](./LICENSE.md)

Maintainers
-----------

[](#maintainers)

- [dpcdigital@NSWDPC:~$](https://dpc.nsw.gov.au)

Bugtracker
----------

[](#bugtracker)

We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.

Please review the [code of conduct](./code-of-conduct.md) prior to opening a new issue.

Security
--------

[](#security)

If you have found a security issue with this module, please email digital\[@\]dpc.nsw.gov.au in the first instance, detailing your findings.

Development and contribution
----------------------------

[](#development-and-contribution)

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

Please review the [code of conduct](./code-of-conduct.md) prior to completing a pull request.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance54

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~64 days

Recently: every ~112 days

Total

8

Last Release

313d ago

Major Versions

v0.1.2 → v1.0.0-rc12024-04-11

v1.2.0 → v2.0.0-rc12025-07-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/1caefd99092b4a43254e48c40347224f671032ec1ffc3a457e06a7e9ab6e7c02?d=identicon)[nswdpc](/maintainers/nswdpc)

---

Top Contributors

[![JamesDPC](https://avatars.githubusercontent.com/u/69664712?v=4)](https://github.com/JamesDPC "JamesDPC (25 commits)")

---

Tags

silverstripeuploadassetsclamavclamfile scan

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nswdpc-silverstripe-asset-scan/health.svg)

```
[![Health](https://phpackages.com/badges/nswdpc-silverstripe-asset-scan/health.svg)](https://phpackages.com/packages/nswdpc-silverstripe-asset-scan)
```

###  Alternatives

[unclecheese/silverstripe-kickassets

Provides an alternative file management interface for SilverStripe CMS with drag-and-drop, multi-selection, and several other desktop-like UI conventions.

4728.3k1](/packages/unclecheese-silverstripe-kickassets)[unclecheese/kickassets

Provides an alternative file management interface for SilverStripe CMS with drag-and-drop, multi-selection, and several other desktop-like UI conventions.

484.0k](/packages/unclecheese-kickassets)[unclecheese/dropzone

An HTML5 upload field for the CMS and frontend forms.

46130.7k6](/packages/unclecheese-dropzone)[silverstripe/selectupload

Enables files to be uploaded into a user-designated folder

2779.1k1](/packages/silverstripe-selectupload)[axllent/silverstripe-scaled-uploads

Automatically scale down and rotate uploaded images for Silverstripe

2580.3k8](/packages/axllent-silverstripe-scaled-uploads)[axllent/silverstripe-image-optimiser

Automatically optimise all uploaded &amp; resampled images in Silverstripe

1118.4k2](/packages/axllent-silverstripe-image-optimiser)

PHPackages © 2026

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