2022-01-21 18:45:44 +01:00
|
|
|
#
|
|
|
|
# spec file for package velociraptor
|
|
|
|
#
|
|
|
|
# Copyright (c) 2021 SUSE LLC
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
%define projname velociraptor
|
2022-08-19 20:30:12 +02:00
|
|
|
%define vendor_version 0.6.4.2~git56.47b4adb4
|
|
|
|
%define vmlinux_h_version 5.18.9-2-default
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
Name: velociraptor
|
2022-08-19 20:30:12 +02:00
|
|
|
Version: 0.6.4.2~git59.5ebb49db
|
2022-01-21 18:45:44 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Endpoint visibility and collection tool
|
2022-08-19 20:30:12 +02:00
|
|
|
Group: System/Monitoring
|
2022-01-21 18:45:44 +01:00
|
|
|
License: AGPL-3.0-only
|
|
|
|
URL: https://github.com/Velocidex/velociraptor
|
|
|
|
Source: %{projname}-%{version}.tar.xz
|
2022-02-18 02:36:48 +01:00
|
|
|
Source1: vendor-golang-%{vendor_version}.tar.xz
|
2022-03-15 15:14:34 +01:00
|
|
|
Source2: vendor-golang-kafka-humio-gateway-%{vendor_version}.tar.xz
|
|
|
|
Source3: vendor-nodejs-%{vendor_version}.tar.xz
|
|
|
|
Source4: %{name}.service
|
|
|
|
Source5: %{name}-server.config.placeholder
|
|
|
|
Source6: %{name}-client.service
|
|
|
|
Source7: %{name}-client.config.placeholder
|
2022-08-19 20:30:12 +02:00
|
|
|
Source8: vmlinux.h-%{vmlinux_h_version}.tar.xz
|
2022-01-21 18:45:44 +01:00
|
|
|
Patch1: velociraptor-golang-mage-vendoring.diff
|
2022-03-18 17:16:16 +01:00
|
|
|
Patch2: velociraptor-skip-git-submodule-import-for-OBS-build.patch
|
|
|
|
Patch3: velociraptor-makefile-add-bpf-rules-to-linux_bare.patch
|
2022-05-05 20:38:36 +02:00
|
|
|
Patch4: make-libbpfgo-vendorable.patch
|
2022-01-21 18:45:44 +01:00
|
|
|
BuildRequires: golang-packaging
|
|
|
|
BuildRequires: systemd-rpm-macros
|
2022-02-18 02:36:48 +01:00
|
|
|
BuildRequires: systemd-devel
|
2022-08-19 20:30:12 +02:00
|
|
|
# We actually only require >= 1.17
|
|
|
|
BuildRequires: golang(API) = 1.17
|
2022-01-21 18:45:44 +01:00
|
|
|
BuildRequires: fileb0x
|
|
|
|
BuildRequires: mage
|
|
|
|
BuildRequires: libtsan0
|
|
|
|
BuildRequires: nodejs16
|
|
|
|
BuildRequires: npm16
|
2022-03-18 17:16:16 +01:00
|
|
|
BuildRequires: clang13
|
|
|
|
BuildRequires: llvm13
|
|
|
|
BuildRequires: bpftool
|
|
|
|
BuildRequires: libelf-devel
|
2022-01-21 18:45:44 +01:00
|
|
|
Conflicts: velociraptor-client
|
|
|
|
|
|
|
|
%description
|
|
|
|
Velociraptor is a tool for collecting host based state information
|
|
|
|
using The Velociraptor Query Language (VQL) queries.
|
|
|
|
|
|
|
|
To learn more about Velociraptor, read the documentation on:
|
|
|
|
|
|
|
|
https://docs.velociraptor.app/
|
|
|
|
|
|
|
|
This package contains the endpoint agent and full console GUI.
|
|
|
|
For just the endpoint agent, please install the 'velociraptor-client' package.
|
|
|
|
|
2022-03-15 15:14:34 +01:00
|
|
|
%package kafka-humio-gateway
|
|
|
|
Summary: Gateway between Kafka and Humio for Velociraptor Artifacts
|
2022-08-19 20:30:12 +02:00
|
|
|
Version: 0.6.4.2~git59.5ebb49db
|
2022-03-15 15:14:34 +01:00
|
|
|
|
|
|
|
%description kafka-humio-gateway
|
|
|
|
This tool is used to consume events generated by the Kafka Velociraptor plugin
|
|
|
|
and post them to a Humio cluster.
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%prep
|
2022-08-19 20:30:12 +02:00
|
|
|
%setup -q -a 1 -a 2 -a 3 -a 8 -n %{projname}-%{version}
|
2022-01-21 18:45:44 +01:00
|
|
|
%autopatch -p1
|
|
|
|
|
2022-05-05 20:38:36 +02:00
|
|
|
# Without this, the libbpfgo tests want to vendor the external version
|
|
|
|
rm -rf third_party/libbpfgo/selftest third_party/libbpfgo/helpers/example_tracelisten_test.go
|
2022-03-18 17:16:16 +01:00
|
|
|
|
2022-01-21 18:45:44 +01:00
|
|
|
# Set the version to something more specific than <next-tag>-dev
|
|
|
|
sed -ie "s/\(VERSION *= \).*/\1 \"%{version}\"/" constants/constants.go
|
|
|
|
|
2022-08-19 20:30:12 +02:00
|
|
|
mkdir -p third_party/libbpfgo/output
|
|
|
|
cp vmlinux.h-%{vmlinux_h_version}/vmlinux-%{_arch}.h \
|
|
|
|
third_party/libbpfgo/output/vmlinux.h
|
|
|
|
|
2022-01-21 18:45:44 +01:00
|
|
|
# These just clutter the GUI and we don't have Windows clients
|
2022-02-07 19:30:48 +01:00
|
|
|
# Note: There are dependencies on these that need to be resolved before
|
|
|
|
# removing them outright.
|
2022-05-05 20:38:36 +02:00
|
|
|
# rm -rf artifacts/definitions/Windows
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
(cd gui/velociraptor ; npm run build)
|
2022-03-18 17:16:16 +01:00
|
|
|
PATH=$PATH:/usr/sbin make linux
|
2022-01-21 18:45:44 +01:00
|
|
|
|
2022-08-19 20:30:12 +02:00
|
|
|
(cd contrib/kafka-humio-gateway; go build -o %{name}-kafka-humio-gateway)
|
2022-03-15 15:14:34 +01:00
|
|
|
|
2022-01-21 18:45:44 +01:00
|
|
|
%install
|
|
|
|
mkdir -p %buildroot/%{_bindir}
|
2022-02-02 19:59:59 +01:00
|
|
|
mkdir -p %buildroot/%{_sysconfdir}/velociraptor
|
|
|
|
mkdir -p %buildroot/%{_unitdir}
|
2022-02-18 02:36:48 +01:00
|
|
|
mkdir -p %buildroot/%{_sharedstatedir}/velociraptor/data
|
|
|
|
mkdir -p %buildroot/%{_sharedstatedir}/velociraptor/logs
|
|
|
|
mkdir -p %buildroot/%{_sharedstatedir}/velociraptor-client
|
2022-08-19 20:30:12 +02:00
|
|
|
mkdir -p %buildroot/%{_datadir}/%{name}-kafka-humio-gateway
|
|
|
|
install -m 0755 output/velociraptor-v%{version}-linux-* %buildroot/%{_bindir}/velociraptor
|
|
|
|
install -m 0755 contrib/kafka-humio-gateway/%{name}-kafka-humio-gateway %buildroot/%{_bindir}
|
|
|
|
install -m 0644 contrib/kafka-humio-gateway/sample-config.yml %buildroot/%{_datadir}/%{name}-kafka-humio-gateway/sample-config.yml
|
2022-03-15 15:14:34 +01:00
|
|
|
install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
install -m 0600 %{SOURCE5} %{buildroot}%{_sysconfdir}/velociraptor/server.config
|
|
|
|
install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}-client.service
|
|
|
|
install -m 0600 %{SOURCE7} %{buildroot}%{_sysconfdir}/velociraptor/client.config
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%files
|
2022-08-19 20:30:12 +02:00
|
|
|
%defattr(-, root, root)
|
2022-01-21 18:45:44 +01:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2022-02-02 19:59:59 +01:00
|
|
|
%dir %{_sysconfdir}/velociraptor
|
2022-01-21 18:45:44 +01:00
|
|
|
%{_bindir}/velociraptor
|
2022-02-02 19:59:59 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/velociraptor/server.config
|
2022-02-08 18:50:07 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/velociraptor/client.config
|
2022-02-02 19:59:59 +01:00
|
|
|
%{_unitdir}/%{name}.service
|
2022-02-08 18:50:07 +01:00
|
|
|
%{_unitdir}/%{name}-client.service
|
2022-02-18 02:36:48 +01:00
|
|
|
%dir %{_sharedstatedir}/velociraptor
|
|
|
|
%dir %{_sharedstatedir}/velociraptor/data
|
|
|
|
%dir %{_sharedstatedir}/velociraptor/logs
|
|
|
|
%dir %{_sharedstatedir}/velociraptor-client
|
2022-02-02 19:59:59 +01:00
|
|
|
|
2022-03-15 15:14:34 +01:00
|
|
|
%files kafka-humio-gateway
|
2022-08-19 20:30:12 +02:00
|
|
|
%defattr(-, root, root)
|
2022-03-15 15:14:34 +01:00
|
|
|
%license LICENSE
|
|
|
|
%doc contrib/kafka-humio-gateway/README.md
|
2022-08-19 20:30:12 +02:00
|
|
|
%{_bindir}/%{name}-kafka-humio-gateway
|
|
|
|
%dir %{_datadir}/%{name}-kafka-humio-gateway
|
|
|
|
%{_datadir}/%{name}-kafka-humio-gateway/sample-config.yml
|
2022-03-15 15:14:34 +01:00
|
|
|
|
2022-02-02 19:59:59 +01:00
|
|
|
%pre
|
|
|
|
%service_add_pre %{name}.service
|
2022-02-08 18:50:07 +01:00
|
|
|
%service_add_pre %{name}-client.service
|
2022-02-02 19:59:59 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
%service_add_post %{name}.service
|
2022-02-08 18:50:07 +01:00
|
|
|
%service_add_post %{name}-client.service
|
2022-02-02 19:59:59 +01:00
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun %{name}.service
|
2022-02-08 18:50:07 +01:00
|
|
|
%service_del_preun %{name}-client.service
|
2022-02-02 19:59:59 +01:00
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun %{name}.service
|
2022-02-08 18:50:07 +01:00
|
|
|
%service_del_postun %{name}-client.service
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%changelog
|