name: fastnetmon-community base: core24 version: '1.2.9' summary: FastNetMon Community DDoS detection sensor license: GPL-2.0-only description: | FastNetMon Community is a high-performance DDoS detection sensor supporting NetFlow, IPFIX, sFlow, PCAP and AF_PACKET traffic sources. contact: support@fastnetmon.com website: https://fastnetmon.com/ issues: https://github.com/pavel-odintsov/fastnetmon/issues source-code: https://github.com/pavel-odintsov/fastnetmon grade: devel confinement: strict platforms: amd64: arm64: apps: fastnetmon: command: usr/sbin/fastnetmon #environment: # LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu plugs: - network - network-bind - network-observe fastnetmon-service: command: usr/sbin/fastnetmon --configuration_file $SNAP_COMMON/etc/fastnetmon.conf --log_file $SNAP_COMMON/log/fastnetmon.log #command: usr/sbin/fastnetmon --configuration_file /etc/fastnetmon.conf #environment: # LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu daemon: simple restart-condition: on-failure plugs: - network - network-bind - network-observe - network-control - firewall-control fastnetmon-client: command: usr/bin/fastnetmon_client #environment: # LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu plugs: - network fastnetmon-api-client: command: usr/bin/fastnetmon_api_client #environment: # LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu plugs: - network parts: fastnetmon: plugin: cmake source: . source-type: local # for build with getting code from git change to #source: https://github.com/pavel-odintsov/fastnetmon.git #source-type: git #source-tag: v1.2.9 ## source-branch: #source-subdir: src cmake-parameters: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=/usr # Flags from Debian/Ubuntu packaging - -DENABLE_CUSTOM_BOOST_BUILD=FALSE - -DDO_NOT_USE_SYSTEM_LIBRARIES_FOR_BUILD=FALSE - -DLINK_WITH_ABSL=TRUE # For snap we probably do not need real systemd unit installation, # but keeping the path harmlessly aligned with Debian is OK. - -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR=/usr/lib/systemd/system - -DFASTNETMON_ATTACK_DETAILS_FOLDER=/var/snap/fastnetmon-community/common/log/fastnetmon_attacks build-packages: - cmake - pkgconf - git - build-essential - libboost-atomic-dev - libboost-chrono-dev - libboost-date-time-dev - libboost-program-options-dev - libboost-regex-dev - libboost-thread-dev - libbpf-dev - libelf-dev - libbson-dev - libcapnp-dev - libgrpc-dev - libgrpc++-dev - libprotobuf-dev - protobuf-compiler - protobuf-compiler-grpc - capnproto - libhiredis-dev - liblog4cpp5-dev - libicu-dev - libmongoc-dev - libncurses-dev - libpcap-dev # Not listed directly in Debian control, but useful on Ubuntu/core24 # if gRPC/Abseil linkage is not pulled transitively enough. - libabsl-dev # for override https://documentation.ubuntu.com/snapcraft/9.0/how-to/debugging/use-the-classic-linter/#patch-elf-binaries - patchelf - binutils stage-packages: # gRPC / protobuf / abseil - libgrpc++1.51 - libgrpc++1.51t64 - libgrpc29 #- libgpr29 - libprotobuf32 - libabsl20220623t64 # FastNetMon direct deps - liblog4cpp5v5 - libpcap0.8 - libhiredis1.1.0 - libmongoc-1.0-0 - libbson-1.0-0 # Boost runtime - libboost-thread1.83.0 - libboost-program-options1.83.0 # Cap'n Proto - libcapnp-1.0.1 #- libkj-1.0.1 # CLI / terminal - libncurses6 - libtinfo6 # Already resolved from base/host in your ldd, but harmless and safer - libbpf1 - libelf1 - zlib1g - libssl3 # Old hack for classic amd64 only #override-prime: | # craftctl default # RPATH='/snap/fastnetmon-community/current/usr/lib/x86_64-linux-gnu:/snap/fastnetmon-community/current/lib/x86_64-linux-gnu:/snap/fastnetmon-community/current/usr/lib:/snap/fastnetmon-community/current/lib' # INTERPRETER='/snap/core24/current/lib64/ld-linux-x86-64.so.2' # for bin in \ # usr/sbin/fastnetmon \ # usr/bin/fastnetmon_client \ # usr/bin/fastnetmon_api_client # do # if [ -f "$bin" ]; then # echo "Patching ELF: $bin" # patchelf --set-interpreter "$INTERPRETER" "$bin" # patchelf --force-rpath --set-rpath "$RPATH" "$bin" # fi # done