pub async fn analyze(
    grype: &Vec<String>,
    syft: &Vec<String>,
    trivy: &Vec<String>,
    cyclone_dx: &Vec<String>,
    context: &String,
    out: &Option<String>
) -> Result<DeploymentScore, Error>
Expand description

The main entry point for the analysis process

Arguments

  • grype - The grype files that describe a single piece of software
  • trivy - The trivy files that describe a single piece of software
  • syft - The syft files that describe a single piece of software
  • cyclonedx - The cyclonedx files that describe a single piece of software. Often conflicts with trivy
  • context - The context file that describes the deployment
  • out - An optional output file to write the results to. If not specified, the results will be printed to stdout.

Returns

A Result containing the DeploymentScore or an Error if an error occurred.

Examples

use scayl::analyze;
let score = analyze(
    &vec!["/path/to/grype.json".to_string()],
    &vec!["/path/to/trivy.json".to_string()],
    &vec!["/path/to/syft.json".to_string()],
    &vec![],
    &Some("/path/to/context/file".to_string()),
    &None
).unwrap();