Skip to content

Commit f7a3825

Browse files
committed
PURE LINUX
1 parent 5d181ef commit f7a3825

36 files changed

Lines changed: 41 additions & 1774 deletions

.github/workflows/ci.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ jobs:
4949
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
5050
CGO_ENABLED=1 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-mesh .
5151
52-
- name: cross-compile spectral-mesh (Windows, macOS, no CGO)
53-
run: |
54-
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
55-
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
56-
LDFLAGS="-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}"
57-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
58-
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
59-
6052
- name: go build spectral-edge (no CGO)
6153
run: |
6254
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
@@ -98,14 +90,6 @@ jobs:
9890
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
9991
CGO_ENABLED=1 go build -ldflags "-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}" -o spectral-mesh .
10092
101-
- name: cross-compile spectral-mesh (Windows, macOS, no CGO)
102-
run: |
103-
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)
104-
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
105-
LDFLAGS="-X main.Version=ci -X main.GitCommit=${COMMIT} -X main.BuildTime=${TS}"
106-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
107-
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /dev/null .
108-
10993
- name: go build spectral-edge (no CGO)
11094
run: |
11195
COMMIT=$(echo "${GITHUB_SHA}" | cut -c1-7)

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
*.tfstate.*
55
/spectral-edge
66
/spectral-mesh
7-
hook/darwin/*.dylib
87
docs/.pdf-venv/

CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
## Unreleased
44

5+
- **spectral-mesh (Linux only):** Removed Windows and macOS sensor entrypoints, **`hook/darwin`** / **`hook/windows`**, **`internal/capture/winssl`**, **`internal/capture/esmmap`**, **`internal/capture/platformhint`**, **`cmd/spectral-ssl-wrap`**, **`packaging/macos`**, and **`metrics_other.go`**. **`cli.go`** now holds all mesh flags (including **`-k8s-enrich`**). CI and **`make ci`** no longer cross-compile the root package for **`GOOS=windows`** / **`darwin`**. Optional cleartext bridges (**`-capture-ingest-addr`**, stdin JSONL, hook socket) remain on Linux for tests and auxiliary feeds.
56
- **Repository layout:** **Helm** charts (`helm/spectral-mesh`, `helm/spectral-edge`), **cloud Terraform** (`deploy/aws`, `deploy/gcp`, `deploy/azure`), **OpenShift** manifests (`openshift/`), and Kubernetes-focused docs (**`DEPLOY_*`**, **`ENTERPRISE_SELF_HOSTED`**, **`K8S_ALERT_ENRICHMENT`**, **`MESH_RUNBOOK`**) moved to the companion repository **[Spectral-Cloud](https://github.com/spectral-mesh/Spectral-Cloud)**. This repository remains the **Spectral Mesh** application and BPF source; cross-links in **`README.md`** and **`docs/`** point at **Spectral-Cloud** for installs.
67
- **Observability:** New scripts **`scripts/simulate_mesh_ingest.sh`**, **`simulate_mesh_grafana.sh`**, **`simulate_capture_demo.sh`**, **`simulate_edge_scan.sh`**; fix **`simulate_mesh_ingest.sh`** under **`set -u`** when **`INGEST_TOKEN`** is unset (avoid empty **`extra[@]`** expansion). Grafana dashboards **`monitoring/grafana/dashboards/spectral-mesh.json`** (cleartext/ingest wording + metric semantics row) and **`spectral-edge.json`** (**Job**/**Instance** variables, **HTTP 429** rate on throughput panel, simulation note). **`monitoring/README.md`** documents the script matrix.
78
- **Docs:** Refresh **Windows/macOS** descriptions across **`README.md`**, **`docs/EDGE_VS_MESH.md`**, **`docs/EDGE.md`**, **`docs/POLICY_MESH_AND_EDGE.md`**, **Spectral-Cloud `docs/ENTERPRISE_SELF_HOSTED.md`**, **`docs/SAAS_ARCHITECTURE.md`**, **`docs/INFOSEC_SUMMARY.md`**, **`docs/BACKGROUND_OF_INVENTION.md`**, and **`docs/INVENTION_DISCLOSURE_OUTLINE_US.md`** to match **ingest**, **hookwire**, optional **hooks**, and **edge** vs host rolling-buffer behavior (replacing outdated “capture stub” wording).
8-
- **Windows OpenSSL discovery:** **`-windows-openssl-discovery-interval`** polls module lists via Toolhelp32 and logs **`windows_openssl_module_mapped`** (`internal/capture/winssl`).
9-
- **macOS Endpoint Security (opt-in build):** **`-darwin-es-mmap-watch`** with **`go build -tags spectral_es`** (CGO) subscribes to **`ES_EVENT_TYPE_NOTIFY_MMAP`** and logs **`es_openssl_mmap`** when mapped paths look like OpenSSL (`internal/capture/esmmap`, **`internal/capture/platformhint`**). Default macOS binaries omit ES linkage; use an SDK-equipped toolchain to link **EndpointSecurity.framework**.
10-
- **OpenSSL TLS hook path:** **`-capture-hook-socket unix:…` or `tcp:…`** accepts a binary **`hookwire`** frame stream into **`HandleChunk`**. **macOS:** `hook/darwin/spectral_ssl_hook.dylib` (**`make hook-darwin`**) interposes **`SSL_write`**; **`cmd/spectral-ssl-wrap`** sets **`DYLD_INSERT_LIBRARIES`** and execs a child. **Windows:** **`hook/windows/CMakeLists.txt`** builds **`spectral_openssl_hook.dll`** (MinHook via **FetchContent**) + **`spectral_inject.exe`** (`LoadLibraryW` injection); shared TCP sender in **`hook_send_tcp.c`**. **Packaging:** **`packaging/macos/entitlements/EndpointSecurityClient.plist`** and **`packaging/macos/SYSTEM_EXTENSION_SIGNING.md`** for ES / System Extension signing.
11-
- **Capture ingest bridge:** **`-capture-ingest-addr`** (localhost HTTP **`POST /v1/ingest/chunk`**) and **`-capture-stdin-jsonl`** feed **`sensorcore.HandleChunkWithMeta`** on **Linux, Windows, and macOS**; optional **`subject_*`** identity fields in JSON. **`cmd/spectral-capture-demo`** posts split chunks for cross-platform **`policy_alert`** demos without kernel hooks.
12-
- **Multi-platform `spectral-mesh` source:** **`main_linux.go`**, **`main_windows.go`**, **`main_darwin.go`** with shared **`internal/sensorcore`** (`Processor.HandleChunk`, alert limiter). **Linux** retains full eBPF + uprobes; **Windows/macOS** share the same policy path with **pluggable** cleartext feeds (ingest, stdin JSONL, hook socket, native hooks); kernel enforcement remains **Linux-only** until separate platform integration. **`cli.go`**, **`metrics_other.go`**, **`spectral_bpf_generate.go`**; **`internal/rollbuf`** gains OS-specific PID listing for prune. **CI** / **`make ci`**: cross-compile **windows/amd64** and **darwin/arm64** with **`CGO_ENABLED=0`**. **`policy_alert`** adds **`enforcement_mode`**.
9+
- **Capture ingest bridge:** **`-capture-ingest-addr`** (localhost HTTP **`POST /v1/ingest/chunk`**) and **`-capture-stdin-jsonl`** feed **`sensorcore.HandleChunkWithMeta`** on **Linux**; optional **`subject_*`** identity fields in JSON. **`cmd/spectral-capture-demo`** posts split chunks for **`policy_alert`** demos without kernel hooks.
10+
- **OpenSSL TLS hook socket:** **`-capture-hook-socket unix:…` or `tcp:…`** accepts a binary **`hookwire`** frame stream into **`HandleChunk`** (see **`internal/capture/hookwire`**).
1311
- **Enterprise self-hosted:** Spectral-Cloud [`docs/ENTERPRISE_SELF_HOSTED.md`](https://github.com/spectral-mesh/Spectral-Cloud/blob/main/docs/ENTERPRISE_SELF_HOSTED.md), [`docs/INFOSEC_SUMMARY.md`](docs/INFOSEC_SUMMARY.md), Spectral-Cloud [`docs/MESH_RUNBOOK.md`](https://github.com/spectral-mesh/Spectral-Cloud/blob/main/docs/MESH_RUNBOOK.md); Helm **[`README.md`](https://github.com/spectral-mesh/Spectral-Cloud/blob/main/helm/spectral-mesh/README.md)** / **[`README.md`](https://github.com/spectral-mesh/Spectral-Cloud/blob/main/helm/spectral-edge/README.md)** and **[`values-enterprise.yaml`](https://github.com/spectral-mesh/Spectral-Cloud/blob/main/helm/spectral-edge/values-enterprise.yaml)**; root **[`SECURITY.md`](SECURITY.md)**; **`spectral-edge` GitHub Releases** ship a **CycloneDX** Go dependency SBOM (`spectral-edge-<tag>-sbom.cdx.json`). Chart **`version`** / **`appVersion`** bumped to **0.2.0**; **`spectral-edge`** default **PodDisruptionBudget** enabled.
1412
- **Network edge:** `cmd/spectral-edge` — HTTP server that scans request bodies with the same policy as the host sensor; **`POST /v1/scan`**, optional **`-upstream`** reverse proxy, **`policy_alert`** with **`sensor_kind: edge`**. Shared **`internal/policyengine`** (refactor from in-tree policy state). See **`docs/EDGE.md`**. **`make edge`** / CI builds with **`CGO_ENABLED=0`**.
1513
- Build metadata: **`-version`**, **`GET /version`**, **`sensor_active`** fields (`version`, `git_commit`, `build_time` via Makefile `LDFLAGS`).

Makefile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ BUILD_TIME ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
55
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
66
LDFLAGS := -X main.Version=$(VERSION) -X main.GitCommit=$(GIT_COMMIT) -X main.BuildTime=$(BUILD_TIME)
77

8-
# bpf2go passes $BPF2GO_CFLAGS to clang. On Linux, libbpf headers are usually in /usr/include (e.g. apt install libbpf-dev).
9-
# macOS: Homebrew’s libbpf formula is Linux-only — use `make generate-docker` or run generate on a Linux machine/VM.
8+
# bpf2go passes $BPF2GO_CFLAGS to clang. libbpf headers are usually in /usr/include (e.g. apt install libbpf-dev).
9+
# Use `make generate-docker` if your host lacks a Linux-capable clang/libbpf for bpf2go.
1010

1111
# Override if your libbpf headers live elsewhere (e.g. custom prefix).
1212
BPF2GO_CFLAGS ?=
1313

1414
# Ubuntu 24.04: clang 18 + libbpf-dev (bookworm’s clang 14 breaks BPF_UPROBE here). GOTOOLCHAIN=auto pulls Go from go.mod.
1515
GO_GEN_IMAGE ?= ubuntu:24.04
1616

17-
.PHONY: all generate generate-docker build edge edge-docker hook-darwin test bench ci clean
18-
19-
# macOS OpenSSL interpose dylib (see README, hook/darwin/).
20-
hook-darwin:
21-
./scripts/build_darwin_ssl_hook.sh
17+
.PHONY: all generate generate-docker build edge edge-docker test bench ci clean
2218

2319
all: generate build
2420

@@ -65,11 +61,8 @@ ci:
6561
go test ./... -short -count=1
6662
BPF2GO_CFLAGS="$(BPF2GO_CFLAGS)" go generate ./...
6763
CGO_ENABLED=1 go build -ldflags "$(LDFLAGS)" -o /dev/null .
68-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o /dev/null .
69-
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o /dev/null .
7064
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o /dev/null ./cmd/spectral-edge
7165
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o /dev/null ./cmd/spectral-capture-demo
72-
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o /dev/null ./cmd/spectral-ssl-wrap
7366

7467
clean:
7568
rm -f $(TARGET) spectral-edge spectral_x86_bpfel.go spectral_x86_bpfel.o spectral_arm64_bpfel.go spectral_arm64_bpfel.o

0 commit comments

Comments
 (0)