- Update to version 0.6.3~git17.741ebb59:

* kafka-humio-gateway: update README.md
  * kafka-humio-gateway: Fix missing variable rename
  * Add Kafka-Humio Gateway [Depends on PR#10] (#8)

- Update to version 0.6.3~git17.741ebb59:
  * kafka-humio-gateway: update README.md
  * kafka-humio-gateway: Fix missing variable rename
  * Add Kafka-Humio Gateway [Depends on PR#10] (#8)

OBS-URL: https://build.opensuse.org/package/show/security:sensor/velociraptor?expand=0&rev=11
This commit is contained in:
Jeff Mahoney 2022-03-15 14:14:34 +00:00 committed by Git OBS Bridge
parent abc6b0bb16
commit ce24aee9be
7 changed files with 67 additions and 28 deletions

View File

@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/SUSE/linux-security-sensor</param>
<param name="changesrevision">af7fdb00f16fd3feb082e1ccb55097e82053ed22</param></service></servicedata>
<param name="changesrevision">03bd1d74b26a6f6593068bb6a4e80782e9e690a9</param></service></servicedata>

View File

@ -1,7 +1,7 @@
#!/bin/bash
cleanup() {
test -n "$dir" && rm -rf "$dir"
test -n "${dir}" && rm -rf "${dir}"
}
error() {
@ -12,40 +12,47 @@ trap error ERR SIGINT
trap cleanup EXIT
set -e
version=$(rpmspec -q --queryformat="%{VERSION}" velociraptor.spec)
version=$(rpmspec -q --queryformat="%{VERSION}\n" velociraptor.spec|head -1)
dir="$(realpath "$(mktemp -d vendoring.XXXXXX)")"
topdir="$(realpath "$(dirname "$0")")"
rpmspec -P velociraptor.spec --define "_sourcedir $PWD" | \
awk '
BEGIN { go=0; };
/^%build/ { go=0; };
{ if (go) print };
/^%setup/ { go=1 }' > $dir/setup.sh
/^%setup/ { go=1 }' > ${dir}/setup.sh
echo "Expanding archive..."
cpio -D "$dir" -id < velociraptor-${version}.obscpio
cpio -D "${dir}" -id < velociraptor-${version}.obscpio
echo "Running %prep"
cd "$dir/velociraptor-${version}"
sh ../setup.sh
cd "${dir}/velociraptor-${version}"
sh ${dir}/setup.sh
echo "Re-vendoring Go code..."
rm -rf vendor
go mod vendor
tar Jcf ../vendor-golang-${version}.tar.xz vendor
tar Jcf ${dir}/vendor-golang-${version}.tar.xz vendor
cd "${dir}/velociraptor-${version}/contrib/kafka-humio-gateway"
rm -rf vendor
go mod vendor
cd "${dir}/velociraptor-${version}"
tar Jcf "${dir}/vendor-golang-kafka-humio-gateway-${version}.tar.xz" "contrib/kafka-humio-gateway/vendor"
echo "Re-vendoring nodejs code..."
cd gui/velociraptor
cd "${dir}/velociraptor-${version}/gui/velociraptor"
rm -rf node_modules
npm install
cd ../..
tar Jcf ../vendor-nodejs-${version}.tar.xz gui/velociraptor/node_modules
tar Jcf ${dir}/vendor-nodejs-${version}.tar.xz gui/velociraptor/node_modules
cd ..
mv vendor-golang-${version}.tar.xz vendor-nodejs-${version}.tar.xz ..
cd "${dir}"
mv vendor-golang-*${version}.tar.xz vendor-nodejs-${version}.tar.xz ${topdir}
for spec in ../*.spec; do
for spec in ${topdir}/*.spec; do
sed -i "s/^%define vendor_version.*/%define vendor_version %{version}/" ${spec}
done

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Mar 15 13:31:21 UTC 2022 - jeffm@suse.com
- Update to version 0.6.3~git17.741ebb59:
* kafka-humio-gateway: update README.md
* kafka-humio-gateway: Fix missing variable rename
* Add Kafka-Humio Gateway [Depends on PR#10] (#8)
-------------------------------------------------------------------
Tue Mar 15 01:04:29 UTC 2022 - jeffm@suse.com

View File

@ -19,7 +19,7 @@
%define vendor_version %{version}
Name: velociraptor-client
Version: 0.6.3~git13.af7fdb00
Version: 0.6.3~git17.741ebb59
Release: 0
Summary: Endpoint visibility and collection tool (endpoint only)

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Mar 15 13:31:21 UTC 2022 - jeffm@suse.com
- Update to version 0.6.3~git17.741ebb59:
* kafka-humio-gateway: update README.md
* kafka-humio-gateway: Fix missing variable rename
* Add Kafka-Humio Gateway [Depends on PR#10] (#8)
-------------------------------------------------------------------
Tue Mar 15 01:04:29 UTC 2022 - jeffm@suse.com

View File

@ -1,4 +1,4 @@
name: velociraptor
version: 0.6.3~git13.af7fdb00
mtime: 1647305633
commit: af7fdb00f16fd3feb082e1ccb55097e82053ed22
version: 0.6.3~git17.741ebb59
mtime: 1647349936
commit: 741ebb59371cb031ae50997187d0497130a4bb5a

View File

@ -19,7 +19,7 @@
%define vendor_version %{version}
Name: velociraptor
Version: 0.6.3~git13.af7fdb00
Version: 0.6.3~git17.741ebb59
Release: 0
Summary: Endpoint visibility and collection tool
@ -28,11 +28,12 @@ License: AGPL-3.0-only
URL: https://github.com/Velocidex/velociraptor
Source: %{projname}-%{version}.tar.xz
Source1: vendor-golang-%{vendor_version}.tar.xz
Source2: vendor-nodejs-%{vendor_version}.tar.xz
Source3: %{name}.service
Source4: %{name}-server.config.placeholder
Source5: %{name}-client.service
Source6: %{name}-client.config.placeholder
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
Patch1: velociraptor-golang-mage-vendoring.diff
BuildRequires: golang-packaging
BuildRequires: systemd-rpm-macros
@ -56,9 +57,16 @@ 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.
%package kafka-humio-gateway
Summary: Gateway between Kafka and Humio for Velociraptor Artifacts
Version: %{version}
%description kafka-humio-gateway
This tool is used to consume events generated by the Kafka Velociraptor plugin
and post them to a Humio cluster.
%prep
%setup -q -a 1 -a 2 -n %{projname}-%{version}
%setup -q -a 1 -a 2 -a 3 -n %{projname}-%{version}
%autopatch -p1
# Set the version to something more specific than <next-tag>-dev
@ -73,6 +81,8 @@ sed -ie "s/\(VERSION *= \).*/\1 \"%{version}\"/" constants/constants.go
(cd gui/velociraptor ; npm run build)
make linux
(cd contrib/kafka-humio-gateway; go build -o velociraptor-kafka-humio-gateway)
%install
mkdir -p %buildroot/%{_bindir}
mkdir -p %buildroot/%{_sysconfdir}/velociraptor
@ -81,10 +91,11 @@ mkdir -p %buildroot/%{_sharedstatedir}/velociraptor/data
mkdir -p %buildroot/%{_sharedstatedir}/velociraptor/logs
mkdir -p %buildroot/%{_sharedstatedir}/velociraptor-client
install -m 755 output/velociraptor-v%{version}-linux-* %buildroot/%{_bindir}/velociraptor
install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
install -m 0600 %{SOURCE4} %{buildroot}%{_sysconfdir}/velociraptor/server.config
install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}-client.service
install -m 0600 %{SOURCE6} %{buildroot}%{_sysconfdir}/velociraptor/client.config
install -m 755 contrib/kafka-humio-gateway/velociraptor-kafka-humio-gateway %buildroot/%{_bindir}
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
%files
%license LICENSE
@ -100,6 +111,11 @@ install -m 0600 %{SOURCE6} %{buildroot}%{_sysconfdir}/velociraptor/client.config
%dir %{_sharedstatedir}/velociraptor/logs
%dir %{_sharedstatedir}/velociraptor-client
%files kafka-humio-gateway
%license LICENSE
%doc contrib/kafka-humio-gateway/README.md
%{_bindir}/velociraptor-kafka-humio-gateway
%pre
%service_add_pre %{name}.service
%service_add_pre %{name}-client.service