Skip to content

Commit 8aaf6bf

Browse files
author
Entlein
committed
build(stub+go.mod): unblock kubescape#808 standalone build
Three matthyx blockers (2026-05-27): (1) tamper_alert.go:28 β€” imports pkg/signature and pkg/signature/profiles which ship in node-agent#809 (not yet merged). Adds minimum-surface stubs (pkg/signature/stub.go, pkg/signature/profiles/stub.go) so the PR compiles standalone. With IsSigned returning false, the tamper path short-circuits and never invokes Verify β€” the no-op stub is behavior- safe: signed-profile detection is dormant until kubescape#809 lands and replaces these files with the real implementation. (2) projection_apply.go:265 β€” NetworkNeighbor.IPAddresses missing. (3) mock.go:202 β€” same IPAddresses issue. Both (2) and (3) resolved by replacing kubescape/storage with k8sstormcenter/storage's upstream-pr/sbob-network tip 46f37d32 (sibling of kubescape/storage#324). Removed when kubescape#324 merges and a release ships IPAddresses.
1 parent 40960d5 commit 8aaf6bf

4 files changed

Lines changed: 49 additions & 0 deletions

File tree

β€Žgo.modβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,5 @@ replace github.com/inspektor-gadget/inspektor-gadget => github.com/matthyx/inspe
470470
replace github.com/cilium/ebpf => github.com/matthyx/ebpf v0.0.0-20260421101317-8a32d06def6c
471471

472472
replace github.com/anchore/syft => github.com/kubescape/syft v1.32.0-ks.2
473+
474+
replace github.com/kubescape/storage => github.com/k8sstormcenter/storage v0.0.240-0.20260527173728-46f37d32b969

β€Žgo.sumβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
853853
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
854854
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
855855
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
856+
github.com/k8sstormcenter/storage v0.0.240-0.20260527173728-46f37d32b969 h1:ZEifelzzPQ/n6D9p/znxd18GadIajfwxANrJQDtpx34=
857+
github.com/k8sstormcenter/storage v0.0.240-0.20260527173728-46f37d32b969/go.mod h1:FpV6tCrYXlp2kKWza4yr7zf2Y1q7IGgx871ndN7SMNo=
856858
github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953 h1:WdAeg/imY2JFPc/9CST4bZ80nNJbiBFCAdSZCSgrS5Y=
857859
github.com/kastenhq/goversion v0.0.0-20230811215019-93b2f8823953/go.mod h1:6o+UrvuZWc4UTyBhQf0LGjW9Ld7qJxLz/OqvSOWWlEc=
858860
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Package profiles is a build-time stub of the full profile-adapter
2+
// package landing in kubescape/node-agent#809. Returns nil adapters β€”
3+
// upstream IsSigned short-circuits and the tamper path is dormant
4+
// until #809 lands and replaces this file.
5+
package profiles
6+
7+
import (
8+
"github.com/kubescape/node-agent/pkg/signature"
9+
"github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1"
10+
)
11+
12+
func NewApplicationProfileAdapter(_ *v1beta1.ApplicationProfile) signature.Signable {
13+
return nil
14+
}
15+
16+
func NewNetworkNeighborhoodAdapter(_ *v1beta1.NetworkNeighborhood) signature.Signable {
17+
return nil
18+
}

β€Žpkg/signature/stub.goβ€Ž

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Package signature is a build-time stub of the full signature package
2+
// landing in kubescape/node-agent#809. Exposes the minimum surface the
3+
// tamper-detection path in this PR (#808) imports β€” IsSigned,
4+
// VerifyObjectAllowUntrusted, SignObjectDisableKeyless, and the
5+
// ErrSignatureMismatch sentinel β€” so the PR compiles standalone.
6+
//
7+
// All operations no-op: IsSigned returns false (tamper path treats
8+
// every profile as unsigned and skips verification), Verify and Sign
9+
// return nil. Replace with the real implementation from #809 when that
10+
// PR lands; this file is intended to be deleted, not maintained.
11+
package signature
12+
13+
import "errors"
14+
15+
// ErrSignatureMismatch is the sentinel the tamper-detection path
16+
// errors.Is-checks. Must remain non-nil with this exact message β€”
17+
// tamper_alert_test.go pins both invariants.
18+
var ErrSignatureMismatch = errors.New("signature verification failed")
19+
20+
// Signable is the marker interface adapters in pkg/signature/profiles
21+
// satisfy. Empty in the stub; the real package decorates it with
22+
// signature-payload accessors.
23+
type Signable interface{}
24+
25+
func IsSigned(_ Signable) bool { return false }
26+
func VerifyObjectAllowUntrusted(_ Signable) error { return nil }
27+
func SignObjectDisableKeyless(_ Signable) error { return nil }

0 commit comments

Comments
Β (0)