Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OpenSourceOM Core is the platform behind [opensourceom.org](https://opensourceom

Traditional scanners flood you with CVEs and misconfigurations. OpenSourceOM connects the dots — showing which findings sit on paths from the internet to your sensitive data and privileged identities.

> **Status:** Phase 3 has shipped. Phase 4 is open: `om scan workload` inventories Linux root volumes and boot images. Phase 5 (secret and malware findings on that storage) is open. Further rule packs stay open for contributors ([#10](https://github.com/OpenSourceOM/core/issues/10)). See the [roadmap](./docs/ROADMAP.md).
> **Status:** Phase 3 has shipped. Phase 4 is open: `om scan workload` inventories Linux root volumes, boot images, container layers, and function bundles. Shared filesystems are still open. Phase 5 (secret and malware findings on that storage) is open. Further rule packs stay open for contributors ([#10](https://github.com/OpenSourceOM/core/issues/10)). See the [roadmap](./docs/ROADMAP.md).

## Why this exists

Expand Down Expand Up @@ -105,6 +105,10 @@ export AWS_REGION=us-east-1
# sudo -E ./om scan workload gcp
# sudo -E ./om scan workload image gcp
./om scan k8s # requires kubeconfig
# ./om scan workload container
# ./om scan workload function aws
# ./om scan workload function azure
# ./om scan workload function gcp

# Or ingest a custom collector (stdout is a graph batch)
go build -o example-collector ./examples/collector
Expand Down Expand Up @@ -163,6 +167,10 @@ An API token is created only when an admin asks for one, from the console or wit
./om scan workload gcp # scanner VM; snapshots the production project
./om scan workload image gcp # scanner VM; image packages, applied to instances
./om scan k8s # requires kubeconfig or in-cluster credentials
./om scan workload container # image layers on pods from om scan k8s
./om scan workload function aws
./om scan workload function azure
./om scan workload function gcp
./om scan plugin -- ./my-collector
```

Expand All @@ -189,7 +197,7 @@ Full documentation: [opensourceom.org](https://opensourceom.org) (docs at [opens
| **1** | Attack path queries, CVE enrichment, web UI, Azure/GCP collectors |
| **2** | CSPM rules, blast radius, K8s connector, exports |
| **3** | Plugin SDK, Helm, embedded rule pack, demo graph, inventory-backed CVEs, crown-jewel datastores, attack-path findings, and cloud audit context (CloudTrail, Activity Log, Admin Activity). Shipped. |
| **4** | Package inventory from persistent workload storage. Linux root volumes and boot images ship with `om scan workload`. Container layers, function bundles, and shared filesystems are open. |
| **4** | Package inventory from persistent workload storage. Linux root volumes, boot images, container layers, and function bundles ship with `om scan workload`. Shared filesystems are open. |
| **5** | Secret and malware findings on storage Phase 4 already opens. Kind and path only. Open. |

Details: [docs/ROADMAP.md](./docs/ROADMAP.md)
Expand Down
6 changes: 4 additions & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SPDX-License-Identifier: Apache-2.0

Findings link to affected resources via `VIOLATES` edges. CSPM and CVE findings share the same `Finding` node type but use `finding_type` and `rule_id` / `cve_id` properties for provenance.

See [ADR 001](./adr/001-graph-schema-v0.md), [ADR 002](./adr/002-phase1-findings-ui.md), [ADR 003](./adr/003-phase2-cspm-rbac.md), [ADR 004](./adr/004-collector-plugin-sdk.md), [ADR 005](./adr/005-console-admins.md), [ADR 006](./adr/006-aws-root-volume-packages.md), [ADR 007](./adr/007-azure-gce-root-volume-packages.md), and [ADR 008](./adr/008-boot-image-packages.md).
See [ADR 001](./adr/001-graph-schema-v0.md), [ADR 002](./adr/002-phase1-findings-ui.md), [ADR 003](./adr/003-phase2-cspm-rbac.md), [ADR 004](./adr/004-collector-plugin-sdk.md), [ADR 005](./adr/005-console-admins.md), [ADR 006](./adr/006-aws-root-volume-packages.md), [ADR 007](./adr/007-azure-gce-root-volume-packages.md), [ADR 008](./adr/008-boot-image-packages.md), [ADR 009](./adr/009-scanner-account.md), [ADR 010](./adr/010-console-cloud-connect.md), and [ADR 011](./adr/011-container-function-packages.md).

## Technology choices

Expand Down Expand Up @@ -88,7 +88,9 @@ Further community rule packs (PCI and additional CIS mappings) stay open for con

Phase 4 writes `packages` (CPE 2.3 names and package URLs) from persistent workload storage onto the workload node that enrichment already matches. The sources, in order, are AWS Linux root volumes, Azure VM and GCE root volumes, boot images, container image layers and function bundles, and shared filesystems (EFS, Azure Files, Filestore). The scan is opt-in. `om scan aws`, `om scan azure`, and `om scan gcp` stay read-only API collectors.

`om scan workload aws` is the AWS root-volume scan. `om scan workload azure` and `om scan workload gcp` are the same walk for Azure OS disks and GCE boot disks. `om scan workload image aws`, `om scan workload image azure`, and `om scan workload image gcp` read each boot image once and add those package identifiers to instances launched from it. A package that exists only on an instance disk stays on that instance. Each command runs as root on a worker in a scanner account, subscription, or project. The production account grants snapshot and share. The worker mounts the copy and stores package identifiers only. A later API scan keeps `packages`. Windows, LVM, and non-root disks are skipped. Container layers, function bundles, and shared filesystems are still open. See [ADR 006](./adr/006-aws-root-volume-packages.md), [ADR 007](./adr/007-azure-gce-root-volume-packages.md), [ADR 008](./adr/008-boot-image-packages.md), and [ADR 009](./adr/009-scanner-account.md). The grants are in [deploy/connect](../deploy/connect/README.md).
`om scan workload aws` is the AWS root-volume scan. `om scan workload azure` and `om scan workload gcp` are the same walk for Azure OS disks and GCE boot disks. `om scan workload image aws`, `om scan workload image azure`, and `om scan workload image gcp` read each boot image once and add those package identifiers to instances launched from it. A package that exists only on an instance disk stays on that instance. Each of those commands runs as root on a worker in a scanner account, subscription, or project. The production account grants snapshot and share. The worker mounts the copy and stores package identifiers only. A later API scan keeps `packages`. Windows, LVM, and non-root disks are skipped. See [ADR 006](./adr/006-aws-root-volume-packages.md), [ADR 007](./adr/007-azure-gce-root-volume-packages.md), [ADR 008](./adr/008-boot-image-packages.md), and [ADR 009](./adr/009-scanner-account.md). The grants are in [deploy/connect](../deploy/connect/README.md).

`om scan workload container` reads container image layers already stored on Kubernetes workloads. `om scan workload function aws`, `om scan workload function azure`, and `om scan workload function gcp` read Lambda deployment packages, Azure Functions bundles, and Cloud Functions source. Those commands do not attach a volume. The graph stores package identifiers on the workload, beside an existing `images` list for a pod. A repository source, a zstd layer, and a foreign layer are skipped. Shared filesystems are still open. See [ADR 011](./adr/011-container-function-packages.md).

Phase 5 adds a finding for a secret pattern or a malware signature on storage that Phase 4 reader already opened. The finding stores the kind and the path. Object bodies and database rows are in neither phase.

Expand Down
6 changes: 4 additions & 2 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,22 @@ Phase 4 is open. Cloud collectors record the VM, its exposure, and its identity.

The phase ends when a package found in that storage is a CVE finding on the workload the graph already stores. A block volume is the first source. Boot images, container image layers, function bundles, and shared filesystems are the rest.

The scan is opt-in and separate from `om scan aws`, `om scan azure`, and `om scan gcp`. Those commands stay read-only. The workload scan runs a worker in a scanner account, subscription, or project, reads package metadata, and writes CPE 2.3 names and package URLs onto the existing workload. Snapshots and mounts are removed when the scan finishes, including when it fails. File contents stay off the graph.
The scan is opt-in and separate from `om scan aws`, `om scan azure`, and `om scan gcp`. Those commands stay read-only. Root-volume and boot-image scans run a worker in a scanner account, subscription, or project. Snapshots and mounts are removed when the scan finishes, including when it fails. Container layers and function bundles are read without a volume attach. Each scan writes CPE 2.3 names and package URLs onto the workload. File contents stay off the graph.

The path, in order:

- [x] **AWS Linux root volumes** — [#102](https://github.com/OpenSourceOM/core/issues/102)
- [x] **Azure VM and GCE root volumes** — the same walker, those snapshot APIs — [#103](https://github.com/OpenSourceOM/core/issues/103)
- [x] **Boot images** — an AMI and the Azure and GCE equivalents, scanned once and applied to instances launched from that image — [#104](https://github.com/OpenSourceOM/core/issues/104)
- [ ] **Container image layers and function bundles** — layers for images already stored on Kubernetes workloads, plus Lambda deployment packages and the Azure and GCP equivalents. No volume attach — [#105](https://github.com/OpenSourceOM/core/issues/105)
- [x] **Container image layers and function bundles** — layers for images already stored on Kubernetes workloads, plus Lambda deployment packages and the Azure and GCP equivalents. No volume attach — [#105](https://github.com/OpenSourceOM/core/issues/105)
- [ ] **Shared filesystems** — EFS, Azure Files, and Filestore, when the application is installed there and a root-volume scan would miss it — [#106](https://github.com/OpenSourceOM/core/issues/106)

`om scan workload aws` reads Linux root volumes in a production account from a worker in a scanner account. It assumes a snapshot role, shares the snapshot, copies it into the scanner account, and mounts that copy read-only. `om scan workload azure` and `om scan workload gcp` do the same from a scanner subscription or project. The grants are in `deploy/connect`. A later `om scan aws`, `om scan azure`, or `om scan gcp` leaves `packages` in place. Windows, LVM, and disks other than the root volume are skipped. See [ADR 009](./adr/009-scanner-account.md).

`om scan workload image aws` reads each AMI once, including an image no instance is running, and adds those package identifiers to every instance launched from it. `om scan workload image azure` and `om scan workload image gcp` do the same for Azure and GCE images. A package found only on an instance's own disk stays on that instance. Marketplace images the account cannot share are skipped. The volume or disk created for the read is deleted. The image's own snapshot is not.

`om scan workload container` reads each container image stored by `om scan k8s` once and adds those package identifiers to every Kubernetes workload that lists the image. The `images` list stays. Registry credentials stay in the operator environment. `om scan workload function aws`, `om scan workload function azure`, and `om scan workload function gcp` write a workload for each function and store package identifiers from its deployment package or container image. A repository source, a zstd layer, and a foreign layer are skipped. No snapshot or volume is attached. Bundle bytes and layer bytes are deleted after the walk. A later API scan leaves these packages in place. See [ADR 011](./adr/011-container-function-packages.md).

Object bodies and database rows stay out. They are customer data, not the installed software. A public bucket or database is already an exposure finding from the API scan.

## Phase 5 — Findings on inventoried storage
Expand Down
45 changes: 45 additions & 0 deletions docs/adr/011-container-function-packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
Copyright 2026 OpenSourceOM
SPDX-License-Identifier: Apache-2.0
-->

# ADR 011: Container and function package inventory

**Status:** Accepted
**Date:** 2026-12-02
**Phase:** 4

## Context

[ADR 006](./006-aws-root-volume-packages.md), [ADR 007](./007-azure-gce-root-volume-packages.md), and [ADR 008](./008-boot-image-packages.md) read a block volume. A container image and a function bundle are also persistent workload storage, and they do not need a snapshot. `om scan k8s` already stores image references on the pod. `om enrich cve` matches `packages` and does not need a new identifier shape. Lambda, Azure Functions, and Cloud Functions are not in the API inventory at all.

## Decision

`om scan workload container`, `om scan workload function aws`, `om scan workload function azure`, and `om scan workload function gcp` are subcommands of the same opt-in scan. `om scan aws`, `om scan azure`, `om scan gcp`, and `om scan k8s` stay read-only. The root-volume and boot-image commands stay as they are.

The container command fetches each image reference already stored on a Kubernetes workload, walks the layers in order, and adds the resulting CPE 2.3 names and package URLs to `packages` on every workload that lists that image. The `images` list stays. Identifiers already stored stay, including a package this image does not contain. Run `om scan k8s` first.

Each function command lists functions in the configured region, reads the deployment package or the function's container image, and writes a workload node for that function. A full run removes function workloads in that account and region that no longer exist. `--function` updates the named functions and leaves the others. A skipped function keeps packages already stored.

No command in this decision attaches a volume or needs to run as root. Layer bytes and bundle bytes are deleted after the walk. The graph, logs, and exports store package identifiers. They do not store file contents, a presigned URL, or function environment variables.

Registry and function credentials stay in the operator environment. A private registry uses an `auths` entry in the docker config. Credential helpers in that file are not run. An ECR registry uses the AWS credential chain. Public images need no credentials.

The walker reads dpkg, apk, and rpm databases, plus Maven jars, Python distributions, and npm `package.json` files. A zstd layer, a foreign layer, and a Cloud Functions repository source are skipped. `WEBSITE_RUN_FROM_PACKAGE` is read only when it is an http or https URL. App settings other than that URL are not stored. Listing Azure app settings uses the `config/appsettings/list` POST.

The new AWS actions are `lambda:ListFunctions` and `lambda:GetFunction`, plus `ecr:GetAuthorizationToken` when the image is in ECR. The new Azure actions are `Microsoft.Web/sites/read` and `Microsoft.Web/sites/config/read`. The new GCP permissions are `cloudfunctions.functions.list` and `storage.objects.get`. The API collectors do not gain these permissions.

Shared filesystems stay on a later Phase 4 issue. ECS services, Cloud Run services, Container Apps, and functions deployed only from a repository stay out. Secret and malware findings stay on Phase 5.

## Consequences

These commands can run from any machine that can reach the registry or the function API. They do not use the scanner-account snapshot role. The Helm chart does not schedule them.

`om enrich cve` is unchanged. It attaches a CVE only when one of these identifiers matches. A function workload is left in place by a later `om scan aws`, `om scan azure`, or `om scan gcp`.

## References

- [docs/ROADMAP.md](../ROADMAP.md)
- [ADR 006](./006-aws-root-volume-packages.md)
- [ADR 008](./008-boot-image-packages.md)
- [Issue #105](https://github.com/OpenSourceOM/core/issues/105)
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ require (
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.7
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.65.13
github.com/aws/aws-sdk-go-v2/service/ec2 v1.350.2
github.com/aws/aws-sdk-go-v2/service/ecr v1.67.0
github.com/aws/aws-sdk-go-v2/service/iam v1.64.6
github.com/aws/aws-sdk-go-v2/service/lambda v1.113.3
github.com/aws/aws-sdk-go-v2/service/rds v1.130.3
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.6
github.com/aws/aws-sdk-go-v2/service/sts v1.51.8
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.65.13 h1:0Eohou9DEK6s1JjZnhfT
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.65.13/go.mod h1:OqQeF9m+3Z8jvuUXrX1gid/ZHQXCwAxMH7U8eKskr1c=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.350.2 h1:JohP9To4S31937ChcN87LOGGHWcv/lQ8B96XKUbmV30=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.350.2/go.mod h1:JbB+shRXmk18Y4V+GnOzGWFkIjA8ZfGSgtPUgs4X+7E=
github.com/aws/aws-sdk-go-v2/service/ecr v1.67.0 h1:diXYaM5vgoy4xeHgY4Q0cAwCCwKx+cvFdjR23eKGXJk=
github.com/aws/aws-sdk-go-v2/service/ecr v1.67.0/go.mod h1:hbHHpYZ/29gAnar+fh7C0BpL/ELXMwxh2q7ZqXSZePI=
github.com/aws/aws-sdk-go-v2/service/iam v1.64.6 h1:6tqE3gHbHFEvARPvlLHgRK1dXoD96ecolfPEurpYXyc=
github.com/aws/aws-sdk-go-v2/service/iam v1.64.6/go.mod h1:lV0r+RVSkXRA6WhiaxW55qn8n60ObMwQShxaqrs9UeY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.27 h1:2jIfOe8ZuoStxOkRtVU45zxgvt/qeIRChhm2USOS6g8=
Expand All @@ -88,6 +90,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.14 h1:+uYcwTJB
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.14/go.mod h1:POa4UPRV0vUNxPl2brT7/TmPHsFZvKP86DT0eTxV9C4=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.8 h1:RS1Wt+K0r4X0ci9Vf4JYTUfHzsQihYA2LgGJeEneKpk=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.8/go.mod h1:adMnTy5kyoUW86jhXnGSVc/mvMQI4GZd1qYWMeaS8M8=
github.com/aws/aws-sdk-go-v2/service/lambda v1.113.3 h1:oSHldse7GDHpdq81XeAJnhIbsdDKP9bMIt00G8W6uXI=
github.com/aws/aws-sdk-go-v2/service/lambda v1.113.3/go.mod h1:Y//K046w4uhiR3o77beo/y52Jv2uEY13iJ+3+jicLO8=
github.com/aws/aws-sdk-go-v2/service/rds v1.130.3 h1:/r/iLO6C3fZt8h10+YT4ID2R//JD6q7k9P/7f8AsN+A=
github.com/aws/aws-sdk-go-v2/service/rds v1.130.3/go.mod h1:kINuLzcAGKKdpwsN4A24D3y0gAVJDrN4/dGfkJeq9JE=
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.6 h1:to7+Vr3rLkpYRwVKJ5QRriI0eE306vrVN/6TnVHgxvY=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/scan_workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var scanWorkloadCmd = &cobra.Command{
Short: "Inventory packages on workload storage",
Long: `Inventory packages on workload storage.

Root volumes are "om scan workload aws", "om scan workload azure", and "om scan workload gcp". Boot images are "om scan workload image aws", "om scan workload image azure", and "om scan workload image gcp". Each runs as root on a worker in a scanner account, subscription, or project. It assumes a role in the account being scanned, shares a snapshot, and mounts the copy on the worker. om scan aws, om scan azure, and om scan gcp stay read-only. The grants are in deploy/connect.`,
Root volumes are "om scan workload aws", "om scan workload azure", and "om scan workload gcp". Boot images are "om scan workload image aws", "om scan workload image azure", and "om scan workload image gcp". Each of those runs as root on a worker in a scanner account, subscription, or project. It assumes a role in the account being scanned, shares a snapshot, and mounts the copy on the worker. Container layers are "om scan workload container". Function bundles are "om scan workload function aws", "om scan workload function azure", and "om scan workload function gcp". Those do not attach a volume. om scan aws, om scan azure, and om scan gcp stay read-only. The grants for the volume scans are in deploy/connect.`,
}

func init() {
Expand Down
Loading