Skip to content
Analyzer

Analyzer

Internal
Configurable

Xenguard Analyzer container Xenguard Analyzer container

An Analyzer is a self-contained piece of software that analyzes a given software artifact and generates a report. For example, it can generate a software bill of material (SBOM) or extract licence terms for a given artifact.

Process Model

The Proxy module is configured with a list of analyzers that it contacts everytime it receives a request from user. It first creates a PURL for the requested package, fetches its manifest (e.g., pom.xml) and then prepares a request for all registered analyzers. An analyzer accepts requests over a Connect RPC interface with a simple request:

message AnalyzeRequest {
  xenguard.purl.v1.PackageUrl purl = 1;
  optional bytes payload = 2;
}

The analyzer requests are fired in parallel and the proxy only continues when all results are received.

The analyzer response is a JSON document that the Proxy module passes to the Auth module to check for policy compliance.

Caution

Policy decisions based on an analyzer’s output can cause misbehavior in the Proxy, e.g., if a malicious analyzer provides false data. It is up to the operator to decide which analyzers are considered trustworty.

Each analyzer provides JSON schema of the results so respective policies can be defined. Proxy also uses the schema to validate the received data.

Reference Implementation

Anyone can implement and provide an analyzer.

Xenguard comes with a simple analyzer that creates an SBOM for a given package (see source code). This implementation can be used as a reference model for other implementations.

The most important architectural decision in the reference model is to run analyzers in containers to provide sandboxing. The assumption is that downloading a software package can pose a security threat to the host system. Every request that reaches our analyzer starts a new container, provides the package manifest using a shared volume, and finally reads the reults from another shared volumen. The containers use our own images based in Red Hat Hardened Images.