Retrieving Results from Sidecar Container Scans¶
This document explains how to retrieve and process scan results from the sidecar container scanning approach.
Overview¶
When using the sidecar container approach, scan results are generated within the scanner container. There are several methods for retrieving these results for analysis and reporting.
Result Storage Locations¶
Scan results are typically stored in a predetermined location within the sidecar container. By default, this might be configured as /opt/scan-results
or a similar path defined in your deployment configuration.
The scanner generates results in JSON format, which is already in Heimdall Data Format (HDF) when using InSpec/CINC Auditor.
Methods for Retrieving Results¶
1. Volume Mounts¶
The most straightforward method is to mount a volume that both the scanner container and an external process can access:
Then mount this volume to your scanner container:
2. Using kubectl cp¶
You can copy files from the scanner container using kubectl cp
:
Example:
Processing Results with SAF CLI¶
The Security Automation Framework (SAF) CLI is a powerful tool for processing and analyzing security scan results.
Working with InSpec/CINC Auditor Results¶
InSpec/CINC Auditor JSON results are already in Heimdall Data Format (HDF), so no conversion is needed for use with SAF CLI.
Threshold Evaluation¶
Validate results against defined thresholds:
Viewing Results¶
View a summary of scan results directly from the command line:
Launch Heimdall Lite for visual analysis:
Creating Threshold Files¶
Generate a threshold template based on your results:
Integration with CI/CD¶
For CI/CD integration, you can:
- Extract results using volume mounts or kubectl cp
- Use SAF CLI to validate against thresholds
- Fail the pipeline if thresholds aren't met
Example CI/CD script:
Next Steps¶
- Pod Configuration - Learn how to configure pods with sidecars
- Implementation Details - Understand how the sidecar scanning works