Wv 228 add nf plugin security scan#912
Conversation
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
|
A bit more context how this PR is expected to work? (claude is great for this) |
|
How this differ from a regular container scan? |
When creating scan request for plugin i am setting containerplatform as null and accordingly command for scanning plugin is used |
Added summary |
|
One thing i'd like to avoid is to have a different endpoint for plugins, because it not scale with other content we may want handle in the future (modules, maven jar, etc). Ideally is could be used the same endpoint and dispatched internally depending the content type detected. However for sake of proving fast the impact of this approach, i'd say just to check the Make sense? |
Ok understood |
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
src/test/groovy/io/seqera/wave/service/scan/ScanStrategyTest.groovy
Outdated
Show resolved
Hide resolved
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
pditommaso
left a comment
There was a problem hiding this comment.
Made a few comments to address and we are ready to go
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
src/main/groovy/io/seqera/wave/service/scan/DockerScanStrategy.groovy
Outdated
Show resolved
Hide resolved
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
|
I've improved a bit the docker build 464083d |
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
|
Likely this is ready. However what's is not clear to me and it's a key point to be described (and tested) in which path in the plugins are unzipped? Above all is a local container storage path or EFS mounted path? Has it been tested for large plugin (> 50MB) ? |
|
I would say the usual EFS mounted work dir. Correct? wave/src/main/groovy/io/seqera/wave/service/scan/ScanStrategy.groovy Lines 61 to 62 in a42de97 |
pditommaso
left a comment
There was a problem hiding this comment.
Minor it could make sense to add an option --scan-cache-dir option align this setting
Line 43 in a42de97
with this option
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
|
Ok, done 👉 c1fc431 |
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>



Security Scanning for Nextflow Plugins in OCI Registries
Summary
This PR adds support for security scanning of Nextflow plugins hosted in OCI registries. The unified scanner can now detect and scan both traditional container images and Nextflow plugin artifacts, providing comprehensive vulnerability analysis across the entire Wave ecosystem.
Feature Overview
What it does
How it works
Detection Flow:
nextflow/plugin→ plugin scan)For Plugins:
trivy rootfs --scanners vuln)For Containers:
trivy image)Key Technical Choices
1. Unified Scanner Script
Implementation: Refactored
scanner/scan.shinto a unified script with--typeparameter--type container→ Container image scan--type plugin→ Nextflow plugin scanRationale:
2. ORAS for Plugin Downloads
Implementation: Integrated ORAS (OCI Registry As Storage) tool into scanner image
Rationale:
3. Filesystem Scanning for Plugins
Implementation: Plugins scanned using Trivy's
rootfsscanner mode with--scanners vulnflagRationale:
4. Explicit Cache Directory Configuration
Implementation: Added
--cache-diroption to configure Trivy's cache location explicitlyRationale:
Trivy.CACHE_MOUNT_PATHfor consistency across codebase5. Multi-Architecture Scanner Image
Implementation: Fixed Dockerfile to properly support both
amd64andarm64architectures using Docker'sTARGETARCHbuild argRationale:
6. Pattern-Based Scan Type Detection
Implementation: Detects plugin scans by checking if image name contains
nextflow/pluginRationale:
Architecture
Files Changed
Scanner Implementation
scanner/scan.sh- Unified bash script with plugin support and--cache-diroptionscanner/Dockerfile- Multi-arch build with ORAS integration andTARGETARCHsupportscanner/Makefile- Build configuration for multi-platform imagesApplication Code
ScanStrategy.groovy- AddedbuildScanCommand()with scan type detection and--cache-dirparameterKubeScanStrategy.groovy- Simplified to use unified command builderDockerScanStrategy.groovy- Simplified to use unified command builderTrivy.groovy- AddedCACHE_MOUNT_PATHconstantTests
ScanStrategyTest.groovy- Updated command expectations with--cache-dirBuildScanCommandTest.groovy- Updated command expectations with--cache-dirTesting
All tests passing:
Test coverage includes:
Deployment
Building the Scanner Image
This publishes:
public.cr.seqera.io/wave/scanner:v1-0.65.0-oras-1.3.0public.cr.seqera.io/wave/scanner:v1(latest)Configuration
The application automatically uses the scanner via existing configuration:
Example Usage
Container Scan:
Plugin Scan:
Benefits
🤖 Generated with Claude Code