A tool to run Trivy scans and export results to Google Sheets
Project description
Trivy to Google Sheets
trivy-to-google-sheets is a Python package that automates running Trivy scans on container images and exporting the results to a Google Sheet. It also automatically shares the generated sheet with specified emails and can be used as a command-line tool.
Features
Run a Trivy scan on a Docker container image.
- Export Trivy scan results directly to Google Sheets.
- Automatically create a new Google Sheet if it doesn't exist.
- Share the created Google Sheet with multiple users via email.
- Use the package via CLI for quick access.
Installation
Install the package from PyPI:
pip install trivy-to-google-sheets
Usage
Environment Variables
Before running the script or using the CLI tool, ensure the following environment variables are set:
GOOGLE_SHEETS_CREDS: Path to your Google service account credentials JSON file.WORKSHEET_NAME: (Optional) Name of the Google Sheet worksheet (tab) where the data will be inserted. Default -default-trivy-nameSPREADSHEET_NAME: (Optional) Name of the Google Sheet - Default -trivy-vulnerabilities-spreadsheetSHARE_EMAILS: Comma-separated list of emails to share the Google Sheet with.
Example
export GOOGLE_SHEETS_CREDS=/path/to/credentials.json
export WORKSHEET_NAME="vulnerability-scan"
export SHARE_EMAILS="email1@example.com,email2@example.com"
Running the Script Programmatically
You can run the script directly in Python by initializing the TrivyToGoogleSheets class:
from trivy_to_google_sheets import TrivyToGoogleSheets
# Initialize the process
trivy_gsheet = TrivyToGoogleSheets(image_name="your-container-image")
trivy_gsheet.run()
Using as a Command-Line Tool
After installing the package, you can use the trivy-to-google-sheets command directly in your terminal.
trivy-to-google-sheets your-container-image
Google Setup
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file trivy_to_google_sheets-0.3.0.tar.gz.
File metadata
- Download URL: trivy_to_google_sheets-0.3.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f13561c90b576d3c327d7b49f3e523dc64aac27726b5ec06d3610161479521ea
|
|
| MD5 |
0d54decc3b888b5adf123888902511cf
|
|
| BLAKE2b-256 |
2b98b029fa61a2e5cec8ba10df448d43c4f11da4117874ead59fde34060769ad
|