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
2 changes: 1 addition & 1 deletion .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Coverage threshold gate for the audit-syslog-bridge module.
# Enforced by `make cover-go-check` via go-test-coverage/v2.
# Enforced in CI by Gameplane's shared go-component.yaml workflow (go-test-coverage/v2).
#
# The bridge is a small, pure-stdlib HTTP-JSON → RFC 5424 syslog relay. The
# tests cover the syslog framing, config validation, the HTTP handler (TCP/UDP
Expand Down
22 changes: 22 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# audit-syslog-bridge — AI assistant guide

This repository holds the optional HTTP-JSON to RFC 5424 syslog relay behind the API's audit webhook sink. It is a split component of [GameplanePanel/Gameplane](https://github.com/GameplanePanel/Gameplane), checked out there as the `audit-syslog-bridge/` submodule. What it does and its contracts: [`specs.md`](specs.md).

## How it fits into Gameplane

- **Own Go module**, not part of Gameplane's `go.work`. Build and test from this repository's root: `go build ./...` (inside a Gameplane checkout, prefix `GOWORK=off`).
- **CI** is `.github/workflows/ci.yaml`, a thin caller of Gameplane's shared [`go-component.yaml`](https://github.com/GameplanePanel/Gameplane/blob/master/.github/workflows/go-component.yaml), pinned by SHA: lint with Gameplane's root `.golangci.yml` and `.hadolint.yaml` (no copy here), race tests on amd64 and arm64 with the `.testcoverage.yml` gate, govulncheck, and an image build. Dependabot runs in this repository.
- **Images** `audit-syslog-bridge` (`Dockerfile`, built by `make image-audit-syslog`) are built and published from the Gameplane repository root: the Dockerfiles copy `audit-syslog-bridge/...` from that build context.
- **Callers live in Gameplane:** paths such as `operator/`, `api/`, `charts/`, `docs/` and `web/` in `specs.md` and code comments refer to that repository.
- **Shipping a change:** PR to `main` here → after it merges, bump the `audit-syslog-bridge` pointer in Gameplane (`git -C audit-syslog-bridge checkout <merged sha on main>`, `git add audit-syslog-bridge`) in a Gameplane PR. A user-visible change gets its `changelog/unreleased/` entry in that Gameplane PR.

## Rules

Gameplane's [`AGENTS.md`](https://github.com/GameplanePanel/Gameplane/blob/master/AGENTS.md) core rules apply here. The ones that matter most in this repository:

- **CI verifies:** locally only compile checks (`go build ./...`); never run test or lint suites locally.
- **Fix, don't silence:** no `//nolint` and no per-repository `.golangci.yml`; `_test.go` files are exempt from `errcheck`/`gosec`/`unparam` through the shared config.
- **Go errors:** wrap with `%w`.
- **Tests:** never delete or weaken a test without the maintainer's explicit sign-off; fix the code.
- **Git:** signed commits (`git commit -s`), conventional prefixes (`feat:`, `fix:`, `chore:`, `docs:` …), one branch per unit of work, never amend pushed commits; delete the branch after merge.
- **Docs:** keep `specs.md` in step with behaviour changes in the same PR.
1 change: 1 addition & 0 deletions CLAUDE.md
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# audit-syslog-bridge

> This repository is checked out as the `audit-syslog-bridge/` submodule of [GameplanePanel/Gameplane](https://github.com/GameplanePanel/Gameplane). Paths such as `docs/`, `operator/`, `api/`, `charts/` and `web/` below refer to that repository.

The **audit-syslog-bridge** [optional] is a tiny, generic **HTTP-JSON → syslog** relay. It accepts an HTTP `POST` whose
body is a single JSON document and re-emits that document as an
[RFC 5424](https://www.rfc-editor.org/rfc/rfc5424) syslog message to a
configured collector (TCP, TCP over TLS, or UDP).

It exists so Gameplane's [audit webhook sink](../docs/install.md#audit-log) can
It exists so Gameplane's [audit webhook sink](https://github.com/GameplanePanel/Gameplane/blob/master/docs/install.md#audit-log) can
reach a syslog/SIEM endpoint, but it is deliberately **schema-agnostic**: it
forwards the received body verbatim as the syslog `MSG`, so it works for any
JSON-webhook source, not just audit events. Nothing in it is Gameplane-specific.
Expand Down Expand Up @@ -77,7 +79,7 @@ same Secret as the API's webhook token). Without it the relay accepts any POST.

The chart deploys this automatically when you set
`api.audit.webhook.syslogBridge.enabled=true` and a collector address — see the
[install docs](../docs/install.md#audit-log). Standalone:
[install docs](https://github.com/GameplanePanel/Gameplane/blob/master/docs/install.md#audit-log). Standalone:

```sh
docker run -e SYSLOG_ADDR=syslog.example:514 \
Expand Down
10 changes: 6 additions & 4 deletions specs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# audit-syslog-bridge — Specification

> This repository is checked out as the `audit-syslog-bridge/` submodule of [GameplanePanel/Gameplane](https://github.com/GameplanePanel/Gameplane). Paths such as `docs/`, `operator/`, `api/`, `charts/` and `web/` below refer to that repository.

**Status:** pre-v1 (v0.4.1)
**Module / package:** `github.com/GameplanePanel/gameplane/audit-syslog-bridge`

Expand Down Expand Up @@ -53,7 +55,7 @@ Single flat package (`main`): `main.go` (relay + config + server logic), `bridge

## Dependencies

**Go 1.27** (workspace-linked to `go.work` alongside `operator/`, `api/`, `agent/`, etc.)
**Go 1.27**, own `go.mod` (not part of Gameplane's `go.work`)

**Imports:** stdlib only (`crypto/tls`, `net`, `net/http`, `log/slog`, `sync`, `time`, `context`, etc.). No external dependencies.

Expand All @@ -70,7 +72,7 @@ Single flat package (`main`): `main.go` (relay + config + server logic), `bridge

## References

- `audit-syslog-bridge/README.md` — behavior table, config env-vars, transport tradeoffs, run instructions
- `docs/security.md` — audit integrity, threat model, pre-auth privacy (login page anonymity is separate; the bridge sits behind auth)
- `docs/install.md#audit-log` — Helm values to enable syslog-bridge, auth-header Secret wiring
- [`README.md`](README.md) — behavior table, config env-vars, transport tradeoffs, run instructions
- [`docs/security.md`](https://github.com/GameplanePanel/Gameplane/blob/master/docs/security.md) — audit integrity, threat model, pre-auth privacy (login page anonymity is separate; the bridge sits behind auth)
- [`docs/install.md#audit-log`](https://github.com/GameplanePanel/Gameplane/blob/master/docs/install.md#audit-log) — Helm values to enable syslog-bridge, auth-header Secret wiring
- API audit webhook sink (`api/internal/audit/audit.go`) — `WebhookSink` calls `POST http://gameplane-audit-syslog-bridge.<namespace>.svc:8514/` with audit events
4 changes: 2 additions & 2 deletions system-deps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ component = "audit-syslog-bridge"
name = "go"
kind = "toolchain"
version = "go"
reason = "Compiles and tests the audit-syslog-bridge module (go.work:3-21; inventory 2.1)."
reason = "Compiles and tests the audit-syslog-bridge module."

[[dep]]
name = "golangci-lint"
kind = "cli"
version = "golangci_lint"
reason = "make lint-go runs golangci-lint in this module (Makefile:302-305; GO_MODULES at Makefile:43)."
reason = "golangci-lint runs on this module with Gameplane's root .golangci.yml (shared go-component.yaml workflow)."
Loading