Skip to content

Test/improvecomponenttest - #747

Closed
entlein wants to merge 67 commits into
kubescape:mainfrom
k8sstormcenter:test/improvecomponenttest
Closed

entlein wants to merge 67 commits into
kubescape:mainfrom
k8sstormcenter:test/improvecomponenttest

Conversation

@entlein

@entlein entlein commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Overview

entlein and others added 30 commits January 30, 2026 20:32
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: Duck <70207455+entlein@users.noreply.github.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
testing if nodeagent ci runs against fork
* Strip unused SBOM fields to reduce object size by ~52%

Signed-off-by: Ben <ben@armosec.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* use fixed StripSBOM from storage v0.0.247

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* bump github.com/goradd/maps v1.3.0

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Refactor DatasourceEvent methods to handle missing fields gracefully and improve logging

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Simplify StructEvent methods by removing event type checks and improving consistency

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Remove kskubemanager dependency and replace with kubemanager in tracer_factory

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Improve logging for DatasourceEvent field access errors, fix error_raw type

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Pass alert platform to RuleFailureCreator

Update github.com/armosec/armoapi-go to v0.0.678.

Pass AlertSourcePlatform to the constructor instead of hardcoding
AlertSourcePlatformK8s. Set the value to AlertSourcePlatformK8sAgent.

* Remove LocalManager.host parameter from gadget execution to fix host detection

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* fix http body parsing to respect Content-Length

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* Support for chunked
Signed-off-by: Ben <ben@armosec.io>

* Support for chunked also in response
Signed-off-by: Ben <ben@armosec.io>

* Don't log warning for missing proc enrichment in SyscallEventType DatasourceEvent methods

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* add NormalizePath to ensure IG paths are always full

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

# Conflicts:
#	pkg/utils/datasource_event.go
#	pkg/utils/struct_event.go

* dont merge workflows

Signed-off-by: croedig <croedig@users.noreply.github.com>

* Bump go.opentelemetry.io/otel/sdk from 1.39.0 to 1.40.0

Bumps [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) from 1.39.0 to 1.40.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.39.0...v1.40.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/sdk
  dependency-version: 1.40.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* testing the component tests

* Refactor DatasourceEvent methods to suppress invalid field length warnings

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* add buf_len field to HTTP gadget to fix ring buffer data bleed

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* add buf_len to TestHttpFields expected fields

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* add GetValidBuf edge case tests for buf_len handling

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* node-agent test auto trigger

Signed-off-by: croedig <croedig@users.noreply.github.com>

* node-agent test auto trigger

Signed-off-by: croedig <croedig@users.noreply.github.com>

* node-agent component tests need to wait for node-agent image to be built

Signed-off-by: croedig <croedig@users.noreply.github.com>

* go mod again...

Signed-off-by: croedig <croedig@users.noreply.github.com>

* go mod again...

Signed-off-by: croedig <croedig@users.noreply.github.com>

* go-- behave

Signed-off-by: croedig <croedig@users.noreply.github.com>

* still broken dependencies

Signed-off-by: croedig <croedig@users.noreply.github.com>

* aligning the component tests with CRDs and helm charts

Signed-off-by: croedig <croedig@users.noreply.github.com>

* there was a go module missing

* driving me nuts

* brute force

Signed-off-by: croedig <croedig@users.noreply.github.com>

* fixing the version clashes

* maybe we will get this whole go mod replace thing working in this century

---------

Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Yakir Oren <yakiroren@gmail.com>
Signed-off-by: croedig <croedig@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Ben <ben@armosec.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Co-authored-by: Yakir Oren <yakiroren@gmail.com>
Co-authored-by: croedig <croedig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…nt tests

Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Implement generic signing and verification framework for ApplicationProfiles
and SeccompProfiles using ECDSA P-256 signatures compatible with cosign.

Key features:
- SignableProfile interface for extensible profile type support
- Keyless signing support using OIDC identity providers
- Key-based signing for offline/air-gapped environments
- Signature storage in profile metadata.annotations
- CLI tool (sign-profile) for signing and verifying profiles
- Automatic verification in ApplicationProfileCache on profile load

Core implementation:
- pkg/signature/ package with ECDSA P-256 signing/verification
- Profile adapters for ApplicationProfile and SeccompProfile
- EnableProfileVerification config flag (default: false)
- On verification failure: skip profile with warning (don't crash)

Files:
- pkg/signature/annotations.go, interface.go, sign.go, verify.go
- pkg/signature/cosign_adapter.go, signer.go, verifier.go
- pkg/signature/profiles/applicationprofile_adapter.go
- pkg/signature/profiles/seccompprofile_adapter.go
- cmd/sign-profile/main.go
- pkg/config/config.go - add EnableProfileVerification flag
- pkg/objectcache/applicationprofilecache/ - integrate verification at load time
- docs/signing/README.md - comprehensive documentation

Tests:
- 15 signature package tests covering signing, verification, tampering detection
- 5 adapter tests for ApplicationProfile and SeccompProfile adapters
- All tests passing

Co-authored-by: Cerebras Agent <193945191+isaact-cerebras@users.noreply.github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Co-authored-by: Cerebras Agent <193945191+isaact-cerebras@users.noreply.github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
entlein and others added 25 commits March 11, 2026 20:41
* first step towards constanze working to understanding all the component tests

Signed-off-by: entlein <einentlein@gmail.com>

* fix malicious app test by local dns resolution

Signed-off-by: entlein <einentlein@gmail.com>

* revert tests

Signed-off-by: entlein <einentlein@gmail.com>

* testing user defined profile

Signed-off-by: entlein <einentlein@gmail.com>

* adding a latest tag to the build image workflow

Signed-off-by: entlein <einentlein@gmail.com>

* quick turnaround: run componenttest on latest

Signed-off-by: entlein <einentlein@gmail.com>

* adding absolute path tests to test 27

Signed-off-by: entlein <einentlein@gmail.com>

* tests with correct storage tg

Signed-off-by: entlein <einentlein@gmail.com>

* adding absolute path tests to test 27

Signed-off-by: entlein <einentlein@gmail.com>

* adding test failure summary

Signed-off-by: entlein <einentlein@gmail.com>

* nginx test

Signed-off-by: entlein <einentlein@gmail.com>

---------

Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
* Strip unused SBOM fields to reduce object size by ~52%

Signed-off-by: Ben <ben@armosec.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* use fixed StripSBOM from storage v0.0.247

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* bump github.com/goradd/maps v1.3.0

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Refactor DatasourceEvent methods to handle missing fields gracefully and improve logging

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Simplify StructEvent methods by removing event type checks and improving consistency

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Remove kskubemanager dependency and replace with kubemanager in tracer_factory

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Improve logging for DatasourceEvent field access errors, fix error_raw type

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Pass alert platform to RuleFailureCreator

Update github.com/armosec/armoapi-go to v0.0.678.

Pass AlertSourcePlatform to the constructor instead of hardcoding
AlertSourcePlatformK8s. Set the value to AlertSourcePlatformK8sAgent.

* Remove LocalManager.host parameter from gadget execution to fix host detection

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* fix http body parsing to respect Content-Length

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* Support for chunked
Signed-off-by: Ben <ben@armosec.io>

* Support for chunked also in response
Signed-off-by: Ben <ben@armosec.io>

* Don't log warning for missing proc enrichment in SyscallEventType DatasourceEvent methods

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Bump go.opentelemetry.io/otel/sdk from 1.39.0 to 1.40.0

Bumps [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) from 1.39.0 to 1.40.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-go@v1.39.0...v1.40.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/sdk
  dependency-version: 1.40.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Refactor DatasourceEvent methods to suppress invalid field length warnings

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Add ContainerID to virtual host container

Ensure ready channel is closed only once

Co-authored-by: Cerebras Agent <193945191+isaact-cerebras@users.noreply.github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Skip containers with empty image name

Return early when ContainerImageName is empty and log debug details
including namespace, pod, container name, and container ID.

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* add buf_len field to HTTP gadget to fix ring buffer data bleed

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* add buf_len to TestHttpFields expected fields

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* add GetValidBuf edge case tests for buf_len handling

Signed-off-by: Yakir Oren <yakiroren@gmail.com>

* Set ContainerID for Host context before NodeName

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Skip shared data wait for host containers in RuleManager

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Refactor: Introduce IsHostContainer utility function and update checks in RuleManager and ContainerWatcher

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Skip processing for host containers in ContainerCallback methods

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Skip processing for host containers in network stream events

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Use utils.HostContainerID for host container identification

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Add AlertSourcePlatform to runtime alerts in http_exporter

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Add AlertSourcePlatform parameter to InitExporters and update related functions

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Skip processing profile metadata for host containers in creator.go

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Ensure ready channel is closed and container entry is removed on errors and timeouts in lifecycle.go

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Update armoapi-go dependency to v0.0.682 and refactor related imports

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* Fix: Normalize host container ID to nodeName in network stream handling

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

---------

Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Yakir Oren <yakiroren@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: entlein <einentlein@gmail.com>
Co-authored-by: Ben <ben@armosec.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Co-authored-by: Yakir Oren <yakiroren@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cerebras Agent <193945191+isaact-cerebras@users.noreply.github.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
…omalies

Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d95f08e-360c-474a-841d-15d62d38f38f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants