AWS Builder Center
Securing the Software Supply Chain for AI Applications with Open-Source Tools

Securing the Software Supply Chain for AI Applications with Open-Source Tools

Learn how to secure the software supply chain of AI applications using open-source tools such as Syft, Grype, and OpenSearch.

Builder | Cloud Architect | Cloud Security | Kubernetes Security

Securing the Software Supply Chain for AI Applications

AI applications, like traditional software applications, rely heavily on third-party libraries, frameworks, operating-system packages, and container images.
This reliance is an essential part of modern software development. Reusing existing components allows teams to build applications faster instead of reinventing common functionality every time.
The tradeoff is that every external component becomes part of the application’s software supply chain. A vulnerability in any dependency can introduce risk into the application that consumes it.
AI applications typically run inside containers, virtual machines, or directly on physical servers. Each of these environments includes an operating system composed of numerous packages and libraries. Those operating-system components are also part of the software supply chain and must be assessed alongside the application’s direct dependencies.

Core Tenets of Software Supply Chain Security

At a high level, a software supply chain security process should include the following steps:
  1. Identify every component used by the application, including application libraries, frameworks, operating-system packages, and other dependencies.
  1. Analyze each component for known vulnerabilities by comparing it against trusted vulnerability databases and security advisories.
  1. Store the vulnerability findings in a system where they can be searched, reviewed, tracked, and reported.
  1. Process vulnerabilities in two stages:
  • Address critical release-blocking vulnerabilities before the application is deployed.
  • Establish a remediation process for vulnerabilities that do not immediately block the release.
  1. Run this process continuously as part of the software development lifecycle.
Software supply chain security should not be treated as a one-time assessment. New vulnerabilities are discovered regularly, even in components that were considered secure when they were initially deployed.

An AI Software Supply Chain Security Pipeline

Once these core principles are established, they can be implemented through an automated CI/CD pipeline.
The following is one approach using open-source tooling:
Repository → Code Push → Build Container Image → Generate SBOM with Syft → Perform SCA with Grype → Store Results in OpenSearch → Pass or Fail the Pipeline
There are many valid tools and architectures for implementing this process. The approach described here reflects the tooling I commonly use when helping customers build software supply chain security pipelines.
In practice, this model works well because it is automated, repeatable, and capable of scaling across multiple applications and development teams.

Generate an SBOM with Syft

A Software Bill of Materials, or SBOM, addresses the first core requirement: identifying the components that make up an application.
An SBOM provides an inventory of the application’s dependencies, including:
  • Application libraries
  • Language-specific packages
  • Operating-system packages
  • Frameworks
  • Runtime components
  • Other software included in the application artifact
In this pipeline, Syft is used to generate an SBOM from the AI application’s container image.
Syft is an open-source command-line tool that can create SBOMs from container images, directories, archives, and filesystems.
Generating the SBOM from the final container image is particularly valuable because the image represents the artifact that will actually be deployed. It includes both the application dependencies and the operating-system packages installed within the image.
Scanning only the source-code repository may miss packages introduced during the image build process. Scanning the final image provides a more complete view of the deployed software supply chain.

Perform Software Composition Analysis with Grype

Once the SBOM has been generated, the next step is Software Composition Analysis, commonly known as SCA.
SCA tools analyze the identified components and compare them against vulnerability databases and vendor security advisories.
In this pipeline, Grype analyzes the SBOM produced by Syft.
Grype is an open-source vulnerability scanner that can analyze:
  • Container images
  • Filesystems
  • Directories
  • Individual software packages
  • Existing SBOM files
Grype correlates the identified packages with vulnerability information from multiple sources, including operating-system vendors and public security-advisory databases.
The output is a structured vulnerability report containing information such as:
  • The affected package
  • The installed package version
  • The identified vulnerability
  • Vulnerability severity
  • A fixed version, when available
  • The source of the vulnerability advisory
This report becomes the foundation for both automated release decisions and longer-term vulnerability management.

Store Scan Results in OpenSearch

The third core requirement is to store the vulnerability findings in a system where they can be queried and reviewed.
In this architecture, the Grype scan results are ingested into OpenSearch.
OpenSearch is an open-source search and analytics platform that supports full-text search, structured queries, aggregations, and data visualization.
Storing software vulnerability findings in OpenSearch provides several benefits.
First, the findings become centrally searchable. Security and engineering teams can query vulnerabilities by application, package, severity, image, environment, or vulnerability identifier.
Second, OpenSearch Dashboards can be used to create visualizations such as:
  • Vulnerabilities by severity
  • Applications with the highest number of findings
  • Most frequently affected packages
  • Vulnerabilities with the highest exploitation probability
  • Newly discovered vulnerabilities over time
  • Fixed versus unresolved findings
  • Critical vulnerabilities by application or environment
Third, storing historical results makes it possible to track trends and measure whether the organization’s vulnerability posture is improving or deteriorating over time.
OpenSearch therefore serves as both a vulnerability data store and a reporting layer.

Make a Pipeline Pass or Fail Decision

After the vulnerability results have been generated and stored, the CI/CD pipeline can determine whether the application should proceed to the next stage.
For example, the pipeline may fail when it identifies:
  • A critical vulnerability
  • A vulnerability with a known exploit
  • A vulnerability above a defined exploitation-probability threshold
  • A vulnerability affecting an internet-facing application
  • A vulnerability that violates an internal security policy
The exact release criteria will vary between organizations. There is no universal policy that works for every application or development team.
A team deploying an internal development tool may accept a different level of risk than a team deploying a public AI application that processes sensitive customer information.
The important point is that the pipeline now has structured, machine-readable data on which to base the decision.
Because the results are stored in OpenSearch, the pipeline can query the findings programmatically and apply the organization’s release policy automatically.

Handle Non-Blocking Vulnerabilities

Not every vulnerability should necessarily stop a release.
Blocking every deployment that contains any known vulnerability can quickly make the development process unusable, particularly when applications contain hundreds or thousands of dependencies. Software supply chains, in their infinite generosity, rarely offer teams the luxury of having zero findings.
Instead, vulnerabilities should be prioritized based on factors such as:
  • Severity
  • Exploitability
  • Availability of a fix
  • Exposure of the affected application
  • Whether the vulnerable code path is actually used
  • Sensitivity of the data processed by the application
  • Existing compensating controls
Critical release blockers should be handled immediately. Lower-priority findings should enter a defined remediation workflow with an owner, due date, and documented risk decision.

Run the Process Continuously

A secure container image today may become vulnerable tomorrow when a new vulnerability is disclosed.
For that reason, this process should run:
  • Whenever application code changes
  • Whenever the container image is rebuilt
  • Whenever dependencies are updated
  • On a recurring schedule against deployed images
  • When significant new vulnerabilities are announced
CI/CD scanning protects new releases, but recurring scanning is still necessary to detect vulnerabilities discovered after deployment.

Conclusion

AI applications introduce new security concerns involving models, prompts, agents, vector databases, and model interfaces. However, they remain software applications built on traditional infrastructure and extensive third-party dependencies.
Their libraries, frameworks, container images, operating systems, and packages must all be treated as part of the application’s attack surface.
By combining Syft, Grype, and OpenSearch, teams can create an open-source software supply chain security pipeline that:
  • Identifies application and operating-system dependencies
  • Detects known vulnerabilities
  • Stores findings centrally
  • Supports dashboards and historical analysis
  • Automates release decisions
  • Enables ongoing vulnerability remediation
This provides a repeatable and scalable foundation for protecting the software supply chain of AI applications.

The End Result

Here is a sample output generated by following process described in this post. We got a beautiful dashboard and ability to query the vulnerabilities using OpenSearch's web interface and also by running SQL queries
Dashboard

Searchable and filterable data

SQL Queries Option

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article