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-12-07 04:37:22 +01:00
|
|
|
%define vendor_version 0.6.7.4~git41.678ed56
|
2022-11-14 16:01:41 +01:00
|
|
|
%define vmlinux_h_version 5.14.21150400.22-150400-default
|
2022-01-21 18:45:44 +01:00
|
|
|
|
2023-01-19 02:05:43 +01:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
%bcond_without bpf
|
|
|
|
%else
|
|
|
|
%bcond_with bpf
|
|
|
|
%endif
|
|
|
|
|
2022-01-21 18:45:44 +01:00
|
|
|
Name: velociraptor-client
|
2023-01-19 06:02:41 +01:00
|
|
|
Version: 0.6.7.4~git53.0e85855
|
2022-01-21 18:45:44 +01:00
|
|
|
Release: 0
|
2022-02-02 08:01:30 +01:00
|
|
|
Summary: Endpoint visibility and collection tool (endpoint only)
|
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-02-02 19:59:59 +01:00
|
|
|
Source2: %{name}.service
|
|
|
|
Source3: %{name}.config.placeholder
|
2022-08-19 20:30:12 +02:00
|
|
|
Source4: vmlinux.h-%{vmlinux_h_version}.tar.xz
|
2023-01-18 15:41:54 +01:00
|
|
|
Source5: update-vendoring.sh
|
2023-01-19 16:27:12 +01:00
|
|
|
Source6: sysconfig.%{name}
|
2022-02-02 08:01:30 +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
|
2022-01-21 18:45:44 +01:00
|
|
|
BuildRequires: golang-packaging
|
|
|
|
BuildRequires: systemd-rpm-macros
|
2023-01-19 16:27:12 +01:00
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
2023-01-19 02:05:43 +01:00
|
|
|
BuildRequires: golang(API) >= 1.19
|
2022-02-02 08:01:30 +01:00
|
|
|
BuildRequires: fileb0x
|
|
|
|
BuildRequires: mage
|
2022-11-12 02:51:37 +01:00
|
|
|
%ifarch x86_64
|
2022-02-02 08:01:30 +01:00
|
|
|
BuildRequires: libtsan0
|
2022-11-12 02:51:37 +01:00
|
|
|
%endif
|
2023-01-19 02:05:43 +01:00
|
|
|
%if %{with bpf}
|
2023-01-19 16:27:12 +01:00
|
|
|
# clang15 causes libbpfo to crash immediately
|
|
|
|
BuildRequires: clang13
|
|
|
|
BuildRequires: llvm13
|
2022-03-18 17:16:16 +01:00
|
|
|
BuildRequires: bpftool
|
|
|
|
BuildRequires: libelf-devel
|
2022-11-12 02:51:37 +01:00
|
|
|
BuildRequires: zlib-devel-static
|
2023-01-19 02:05:43 +01:00
|
|
|
%endif
|
2022-02-02 08:01:30 +01:00
|
|
|
Conflicts: velociraptor
|
2023-01-18 16:50:58 +01:00
|
|
|
ExclusiveArch: x86_64 ppc64le aarch64 s390x
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%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 only the endpoint agent. For the full console, please
|
|
|
|
install the 'velociraptor' package.
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-08-19 20:30:12 +02:00
|
|
|
%setup -q -a 1 -a 4 -n %{projname}-%{version}
|
2022-01-21 18:45:44 +01:00
|
|
|
%autopatch -p1
|
|
|
|
|
|
|
|
# Set the version to something more specific than <next-tag>-dev
|
|
|
|
sed -ie "s/\(VERSION *= \).*/\1 \"%{version}\"/" constants/constants.go
|
|
|
|
|
2023-01-19 02:05:43 +01:00
|
|
|
%if %{with bpf}
|
2022-08-19 20:30:12 +02:00
|
|
|
mkdir -p third_party/libbpfgo/output
|
2022-11-12 02:51:37 +01:00
|
|
|
|
2022-11-14 16:01:41 +01:00
|
|
|
cp vmlinux.h-%{vmlinux_h_version}/vmlinux-%{_arch}.h \
|
|
|
|
third_party/libbpfgo/output/vmlinux.h
|
2023-01-19 02:05:43 +01:00
|
|
|
%endif
|
2022-08-19 20:30:12 +02:00
|
|
|
|
2022-01-21 18:45:44 +01:00
|
|
|
# These just clutter the GUI and we don't have Windows clients
|
2022-05-05 20:38:36 +02:00
|
|
|
# Note: There are dependencies on these that need to be resolved before
|
|
|
|
# removing them outright.
|
|
|
|
# rm -rf artifacts/definitions/Windows
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%build
|
2023-01-19 02:05:43 +01:00
|
|
|
PATH=$PATH:/usr/sbin make linux_bare BUILD_LIBBPFGO=%{with bpf}
|
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-client
|
2022-02-02 08:01:30 +01:00
|
|
|
install -m 0755 output/velociraptor-v%{version}-linux-* %buildroot/%{_bindir}/velociraptor
|
2022-02-02 19:59:59 +01:00
|
|
|
install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
install -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/velociraptor/client.config
|
2023-01-19 16:27:12 +01:00
|
|
|
install -d -m 755 %{buildroot}%{_fillupdir}
|
|
|
|
install -m 0644 %{SOURCE6} %{buildroot}%{_fillupdir}
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2022-02-02 08:01:30 +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/client.config
|
|
|
|
%{_unitdir}/%{name}.service
|
2022-02-18 02:36:48 +01:00
|
|
|
%dir %{_sharedstatedir}/velociraptor-client
|
2023-01-19 16:27:12 +01:00
|
|
|
%{_fillupdir}/sysconfig.%{name}
|
2022-02-02 19:59:59 +01:00
|
|
|
|
|
|
|
%pre
|
|
|
|
%service_add_pre %{name}.service
|
|
|
|
|
|
|
|
%post
|
2023-01-19 16:27:12 +01:00
|
|
|
%{fillup_only}
|
2022-02-02 19:59:59 +01:00
|
|
|
%service_add_post %{name}.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun %{name}.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun %{name}.service
|
2022-01-21 18:45:44 +01:00
|
|
|
|
|
|
|
%changelog
|