├── pkg
├── event
│ ├── event.go
│ ├── call
│ │ ├── mincore_test.go
│ │ ├── seccomp_test.go
│ │ ├── setsockopt.go
│ │ ├── getsockopt.go
│ │ ├── close_test.go
│ │ ├── setuid_test.go
│ │ ├── exit_test.go
│ │ ├── alarm_test.go
│ │ ├── brk_test.go
│ │ ├── rmdir_test.go
│ │ ├── acct_test.go
│ │ ├── chdir_test.go
│ │ ├── chroot_test.go
│ │ ├── kill_test.go
│ │ ├── brk.go
│ │ ├── close.go
│ │ ├── exit.go
│ │ ├── getcwd_test.go
│ │ ├── setuid.go
│ │ ├── creat_test.go
│ │ ├── rename_test.go
│ │ ├── futex_text.go
│ │ ├── pivot_root_test.go
│ │ ├── alarm.go
│ │ ├── link_test.go
│ │ ├── fstat_test.go
│ │ ├── acct.go
│ │ ├── chdir.go
│ │ ├── rmdir.go
│ │ ├── symlink_test.go
│ │ ├── umount2_test.go
│ │ ├── unlink_test.go
│ │ ├── chroot.go
│ │ ├── setns_test.go
│ │ ├── unlink.go
│ │ ├── execve_test.go
│ │ ├── init_module_test.go
│ │ ├── mkdir_test.go
│ │ ├── listen_test.go
│ │ ├── access_test.go
│ │ ├── ftruncate_test.go
│ │ ├── ptrace_test.go
│ │ ├── read_test.go
│ │ ├── syslog_test.go
│ │ ├── mount_test.go
│ │ ├── kill.go
│ │ ├── timerfd_create_test.go
│ │ ├── write_test.go
│ │ ├── mprotect_test.go
│ │ ├── faccessat_test.go
│ │ ├── clone_test.go
│ │ ├── socket_test.go
│ │ ├── getcwd.go
│ │ ├── open_test.go
│ │ ├── openat_test.go
│ │ ├── connect.go
│ │ ├── readlinkat_test.go
│ │ ├── nanosleep_test.go
│ │ ├── nanosleep.go
│ │ ├── link.go
│ │ ├── listen.go
│ │ ├── ftruncate.go
│ │ ├── fstat.go
│ │ ├── bind.go
│ │ ├── creat.go
│ │ ├── rename.go
│ │ ├── access.go
│ │ ├── inotify_add_watch_test.go
│ │ ├── symlink.go
│ │ ├── getpeername.go
│ │ ├── getsockname.go
│ │ ├── prlimit64_test.go
│ │ ├── statfs.go
│ │ ├── umount2.go
│ │ ├── mkdir.go
│ │ ├── recvfrom_test.go
│ │ ├── sockopt_test.go
│ │ ├── stat.go
│ │ ├── pivot_root.go
│ │ ├── timerfd_create.go
│ │ ├── futex.go
│ │ ├── bind_test.go
│ │ ├── connect_test.go
│ │ ├── setsockopt_test.go
│ │ ├── syslog.go
│ │ ├── getsockopt_test.go
│ │ ├── mincore.go
│ │ ├── getpeername_test.go
│ │ ├── seccomp.go
│ │ ├── getsockname_test.go
│ │ ├── init_module.go
│ │ ├── openat.go
│ │ ├── sendto_test.go
│ │ ├── execve.go
│ │ ├── open.go
│ │ ├── setns.go
│ │ ├── read.go
│ │ ├── write.go
│ │ ├── readlink.go
│ │ ├── faccessat.go
│ │ ├── timerfd_settime.go
│ │ ├── stat_test.go
│ │ ├── statfs_test.go
│ │ ├── timerfd_settime_test.go
│ │ ├── accept_test.go
│ │ ├── sendto.go
│ │ ├── readlinkat.go
│ │ ├── clone.go
│ │ ├── recvfrom.go
│ │ ├── mprotect.go
│ │ ├── function.go
│ │ └── accept.go
│ ├── reader
│ │ ├── reader.go
│ │ ├── reader_test.go
│ │ └── kernel.go
│ └── types.go
├── types
│ ├── flags.go
│ ├── buffer.go
│ ├── fd.go
│ ├── dirfd.go
│ ├── xmode.go
│ ├── c.go
│ ├── umountflags.go
│ ├── container.go
│ ├── cloneflags.go
│ ├── msgflags.go
│ ├── clocktypes.go
│ ├── sockaddr.go
│ └── fileflags.go
├── kernel
│ ├── fixtures
│ │ ├── dummy_probe.o
│ │ ├── Makefile
│ │ └── dummy_probe.c
│ ├── doc.go
│ ├── assets
│ │ └── loader.go
│ ├── probe_test.go
│ ├── ross
│ │ └── bob.go
│ ├── metrics
│ │ ├── handler.go
│ │ └── metrics.go
│ └── offsets.go
├── topology
│ ├── consts.go
│ ├── hash.go
│ ├── kubernetes_test.go
│ ├── ns.go
│ ├── doc.go
│ └── hub_test.go
└── syscalls
│ └── syscalls_test.go
├── chart
├── templates
│ ├── NOTES.txt
│ ├── server-service-account.yaml
│ ├── controller-service-account.yaml
│ ├── server-cluster-role.yaml
│ ├── server-cluster-rolebinding.yaml
│ ├── controller-cluster-rolebinding.yaml
│ ├── controller-rolebinding.yaml
│ ├── controller-role.yaml
│ ├── server-service.yaml
│ ├── controller-cluster-role.yaml
│ ├── controller-deployment.yaml
│ ├── server-daemonset.yaml
│ └── _helpers.tpl
├── Chart.yaml
├── .helmignore
└── values.yaml
├── config
├── prometheus
│ ├── kustomization.yaml
│ └── monitor.yaml
├── certmanager
│ ├── kustomization.yaml
│ ├── kustomizeconfig.yaml
│ └── certificate.yaml
├── webhook
│ ├── kustomization.yaml
│ ├── service.yaml
│ └── kustomizeconfig.yaml
├── crd
│ ├── kustomization.yaml
│ ├── patches
│ │ ├── cainjection_in_traces.yaml
│ │ └── webhook_in_traces.yaml
│ └── kustomizeconfig.yaml
├── manager
│ ├── kustomization.yaml
│ └── manager.yaml
├── rbac
│ ├── auth_proxy_client_clusterrole.yaml
│ ├── role_binding.yaml
│ ├── auth_proxy_role_binding.yaml
│ ├── leader_election_role_binding.yaml
│ ├── auth_proxy_role.yaml
│ ├── auth_proxy_service.yaml
│ ├── kustomization.yaml
│ ├── trace_viewer_role.yaml
│ ├── trace_editor_role.yaml
│ ├── leader_election_role.yaml
│ └── role.yaml
├── default
│ ├── kustomization.yaml
│ ├── manager_webhook_patch.yaml
│ ├── webhookcainjection_patch.yaml
│ └── manager_auth_proxy_patch.yaml
└── samples
│ └── tools_v1alpha1_trace.yaml
├── media
├── logo.png
├── charts-ss.png
├── swoll-top.png
├── swoll-banner.png
└── running-a-trace.gif
├── internal
├── bpf
│ ├── entrypoint.sh
│ ├── Dockerfile
│ ├── asm_goto_workaround.h
│ └── Makefile
├── Makefile
├── deploy
│ ├── manifests
│ │ ├── service.yaml
│ │ ├── rbac.yaml
│ │ └── probe.yaml
│ └── config.yaml
└── pkg
│ └── alert
│ ├── parser.go
│ ├── alert.go
│ ├── prometheus.go
│ └── parser_test.go
├── main.go
├── examples
├── kubernetes-basic
│ ├── Dockerfile
│ ├── Makefile
│ ├── README.md
│ ├── deploy.yaml
│ └── main.go
├── kubernetes-hub
│ ├── Dockerfile
│ ├── Makefile
│ └── deploy.yaml
└── basic-trace
│ └── main.go
├── .whitesource
├── hack
├── tools
│ ├── tools.go
│ └── pretty_logs.go
└── boilerplate.go.txt
├── .gitignore
├── Dockerfile
├── .github
└── workflows
│ ├── create-release.yaml
│ ├── lint-and-test.yaml
│ └── push-image.yaml
├── cmd
├── loader.go
├── offsetter.go
├── prometheus.go
└── root.go
├── go.mod
├── api
└── v1alpha1
│ └── groupversion_info.go
└── .goreleaser.yml
/pkg/event/event.go:
--------------------------------------------------------------------------------
1 | package event
2 |
--------------------------------------------------------------------------------
/pkg/types/flags.go:
--------------------------------------------------------------------------------
1 | package types
2 |
--------------------------------------------------------------------------------
/chart/templates/NOTES.txt:
--------------------------------------------------------------------------------
1 | swoll stuff
2 |
--------------------------------------------------------------------------------
/pkg/event/call/mincore_test.go:
--------------------------------------------------------------------------------
1 | package call
2 |
--------------------------------------------------------------------------------
/config/prometheus/kustomization.yaml:
--------------------------------------------------------------------------------
1 | resources:
2 | - monitor.yaml
3 |
--------------------------------------------------------------------------------
/media/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/criticalstack/swoll/HEAD/media/logo.png
--------------------------------------------------------------------------------
/internal/bpf/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -eu
2 |
3 | cd /bpf
4 | KERNELDIR=/kernel make
5 |
--------------------------------------------------------------------------------
/media/charts-ss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/criticalstack/swoll/HEAD/media/charts-ss.png
--------------------------------------------------------------------------------
/media/swoll-top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/criticalstack/swoll/HEAD/media/swoll-top.png
--------------------------------------------------------------------------------
/media/swoll-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/criticalstack/swoll/HEAD/media/swoll-banner.png
--------------------------------------------------------------------------------
/media/running-a-trace.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/criticalstack/swoll/HEAD/media/running-a-trace.gif
--------------------------------------------------------------------------------
/pkg/event/call/seccomp_test.go:
--------------------------------------------------------------------------------
1 | package call
2 |
3 | import "testing"
4 |
5 | func TestSeccomp(t *testing.T) {
6 | }
7 |
--------------------------------------------------------------------------------
/pkg/kernel/fixtures/dummy_probe.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/criticalstack/swoll/HEAD/pkg/kernel/fixtures/dummy_probe.o
--------------------------------------------------------------------------------
/config/certmanager/kustomization.yaml:
--------------------------------------------------------------------------------
1 | resources:
2 | - certificate.yaml
3 |
4 | configurations:
5 | - kustomizeconfig.yaml
6 |
--------------------------------------------------------------------------------
/pkg/kernel/doc.go:
--------------------------------------------------------------------------------
1 | // The kernel package contains APIs to create and communicate with the running BPF.
2 | package kernel
3 |
--------------------------------------------------------------------------------
/config/webhook/kustomization.yaml:
--------------------------------------------------------------------------------
1 | resources:
2 | - manifests.yaml
3 | - service.yaml
4 |
5 | configurations:
6 | - kustomizeconfig.yaml
7 |
--------------------------------------------------------------------------------
/internal/Makefile:
--------------------------------------------------------------------------------
1 | all: bpf
2 |
3 | bpf:
4 | $(MAKE) -C bpf/
5 |
6 | clean:
7 | $(MAKE) -C bpf/ clean
8 |
9 | .PHONY: all bpf
10 |
--------------------------------------------------------------------------------
/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/criticalstack/swoll/cmd"
5 | )
6 |
7 | func main() {
8 | cmd.Execute()
9 | }
10 |
--------------------------------------------------------------------------------
/examples/kubernetes-basic/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine:latest
2 | WORKDIR /root/
3 | RUN apk add --no-cache binutils
4 | COPY kube-trace ./
5 | CMD ["./kube-trace"]
6 |
--------------------------------------------------------------------------------
/examples/kubernetes-hub/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine:latest
2 | WORKDIR /root/
3 | RUN apk add --no-cache binutils
4 | COPY kubernetes-hub ./
5 | CMD ["./kubernetes-hub"]
6 |
--------------------------------------------------------------------------------
/config/crd/kustomization.yaml:
--------------------------------------------------------------------------------
1 | resources:
2 | - bases/tools.swoll.criticalstack.com_traces.yaml
3 |
4 | patchesStrategicMerge:
5 |
6 | configurations:
7 | - kustomizeconfig.yaml
8 |
--------------------------------------------------------------------------------
/pkg/types/buffer.go:
--------------------------------------------------------------------------------
1 | package types
2 |
3 | type Buffer []byte
4 |
5 | /*
6 | // this was dumb..
7 | func (b Buffer) String() string {
8 | return "\n" + hex.Dump(b)
9 | }
10 | */
11 |
--------------------------------------------------------------------------------
/config/manager/kustomization.yaml:
--------------------------------------------------------------------------------
1 | resources:
2 | - manager.yaml
3 | apiVersion: kustomize.config.k8s.io/v1beta1
4 | kind: Kustomization
5 | images:
6 | - name: controller
7 | newName: controller
8 | newTag: latest
9 |
--------------------------------------------------------------------------------
/config/rbac/auth_proxy_client_clusterrole.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: rbac.authorization.k8s.io/v1beta1
2 | kind: ClusterRole
3 | metadata:
4 | name: metrics-reader
5 | rules:
6 | - nonResourceURLs: ["/metrics"]
7 | verbs: ["get"]
8 |
--------------------------------------------------------------------------------
/config/default/kustomization.yaml:
--------------------------------------------------------------------------------
1 | namespace: swoll
2 | namePrefix: swoll-
3 |
4 | bases:
5 | - ../crd
6 | - ../rbac
7 | - ../manager
8 |
9 | patchesStrategicMerge:
10 | - manager_auth_proxy_patch.yaml
11 |
12 | vars:
13 |
--------------------------------------------------------------------------------
/pkg/topology/consts.go:
--------------------------------------------------------------------------------
1 | package topology
2 |
3 | const (
4 | // The prefix for where job-specific events are sent
5 | swJobStream = "job"
6 | // The prefix for where non-job-specific events (pathed) are sent
7 | swNsStream = "ns"
8 | )
9 |
--------------------------------------------------------------------------------
/chart/Chart.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v2
2 | name: swoll
3 | description: an experimental suite of applications and APIs for monitoring kernel-level activity on a live Kubernetes cluster
4 | type: application
5 | version: 0.1.0
6 | appVersion: 1.16.0
7 |
--------------------------------------------------------------------------------
/config/webhook/service.yaml:
--------------------------------------------------------------------------------
1 |
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: webhook-service
6 | namespace: system
7 | spec:
8 | ports:
9 | - port: 443
10 | targetPort: 9443
11 | selector:
12 | control-plane: controller-manager
13 |
--------------------------------------------------------------------------------
/chart/templates/server-service-account.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.server.enabled -}}
2 | {{- if .Values.server.serviceAccount.create }}
3 | apiVersion: v1
4 | kind: ServiceAccount
5 | metadata:
6 | name: {{ template "swoll-server.serviceAccountName" . }}
7 | {{- end }}
8 | {{- end -}}
9 |
--------------------------------------------------------------------------------
/.whitesource:
--------------------------------------------------------------------------------
1 | {
2 | "scanSettings": {
3 | "baseBranches": []
4 | },
5 | "checkRunSettings": {
6 | "vulnerableCheckRunConclusionLevel": "failure",
7 | "displayMode": "diff"
8 | },
9 | "issueSettings": {
10 | "minSeverityLevel": "MEDIUM"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/types/fd.go:
--------------------------------------------------------------------------------
1 | package types
2 |
3 | // used to mark a file-descriptor as an INPUT type, such as:
4 | // bind(, ...)
5 | type InputFD int
6 |
7 | // used to mark a file-descriptor as an OUTPUT type, such as:
8 | //