### Define Installation Targets Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Specifies the installation locations for binaries, configuration files, and manual pages. ```cmake install(TARGETS fastnetmon DESTINATION "${CMAKE_INSTALL_SBINDIR}") install(TARGETS fastnetmon_client DESTINATION "${CMAKE_INSTALL_BINDIR}") install(TARGETS fastnetmon_api_client DESTINATION "${CMAKE_INSTALL_BINDIR}") install(FILES fastnetmon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") # Install blank files for networks list and whitelist install(FILES networks_list DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") install(FILES networks_whitelist DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") # man pages install(FILES man/fastnetmon.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) install(FILES man/fastnetmon_client.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) ``` -------------------------------- ### Install PHP CLI Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/juniper_plugin/README.md Install the PHP command-line interface and the main PHP package using apt-get. ```bash sudo apt-get install php-cli php ``` -------------------------------- ### Build and Install BPF Library Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Compiles the BPF library and installs it into the /opt/libbpf directory. Requires libelf-dev package. ```bash sudo apt-get install -y libelf-dev cd /root/linux-4.19/tools/lib/bpf make mkdir /opt/libbpf cp libbpf.so libbpf.a /opt/libbpf mkdir -p /opt/libbpf/include/bpf cp bpf.h libbpf.h /opt/libbpf/include/bpf ``` -------------------------------- ### ExaBGP Configuration File Example Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Example ExaBGP configuration file. This sets up roles for processing API calls and defines neighbor settings for BGP communication. ```python # /etc/exabgp/exabgp.conf process roles { run roles.py; encoder json; } neighbor 10.0.0.1 { router-id 10.0.0.2; local-address 10.0.0.2; local-as 65001; peer-as 65000; api { processes [roles]; neighbor-changes; receive-routes; send-routes; } } ``` -------------------------------- ### Configure Platform-Specific Installation Paths Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Sets installation directories based on the host operating system, with an option to toggle absolute paths. ```cmake option(SET_ABSOLUTE_INSTALL_PATH "Enables use of absolute install paths" ON) if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "DragonFly") set(CMAKE_INSTALL_BINDIR "bin") set(CMAKE_INSTALL_SBINDIR "bin") set(CMAKE_INSTALL_SYSCONFDIR "etc") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if (SET_ABSOLUTE_INSTALL_PATH) set(CMAKE_INSTALL_BINDIR "/usr/bin") set(CMAKE_INSTALL_SBINDIR "/usr/sbin") set(CMAKE_INSTALL_SYSCONFDIR "/etc") set(CMAKE_INSTALL_MANDIR "/usr/share/man") endif() elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") message(STATUS "We run on Apple platform") else() message(STATUS "We run on platform ${CMAKE_SYSTEM_NAME} and we do not touch install paths") endif() ``` -------------------------------- ### Display Installation Paths Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Outputs the current CMake installation directory variables to the console for verification. ```cmake message(STATUS "Install BINDIR path: ${CMAKE_INSTALL_BINDIR}") message(STATUS "Install SBINDIR path: ${CMAKE_INSTALL_SBINDIR}") message(STATUS "Install SYSCONFDIR path: ${CMAKE_INSTALL_SYSCONFDIR}") message(STATUS "Install MANDIR path: ${CMAKE_INSTALL_MANDIR}") ``` -------------------------------- ### Install Compilers and Build Tools Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Installs necessary compilers (clang, llvm, gcc) and build tools (make) required for compiling kernel modules and applications. ```bash sudo apt-get update sudo apt-get install -y clang llvm gcc make ``` -------------------------------- ### Run Docker Container Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Start the container with necessary privileges and volume mapping. ```bash sudo docker run -d --privileged --cap-add SYS_ADMIN -v /home/pavel/:/home/pavel --restart=always --name fastnetmon_community_developer ghcr.io/pavel-odintsov/fastnetmon-community-developer-24-04:latest tail -f ``` -------------------------------- ### Redis Data Structure Query Examples Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Example redis-cli commands to list all keys with a specific prefix and retrieve the value for a given key. ```bash # Query attack data redis-cli KEYS "mydc1:*" redis-cli GET "mydc1:192.168.1.100" ``` -------------------------------- ### Configure plugins and client tools Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Registers example and optional Netmap plugins, and defines the client tool executable. ```cmake # example plugin add_library(example_plugin STATIC example_plugin/example_collector.cpp) if (ENABLE_NETMAP_SUPPORT) # Netmap plugin set(NETMAP_INCLUDE_DIRS "netmap_plugin/netmap_includes") include_directories(${NETMAP_INCLUDE_DIRS}) add_library(netmap_plugin STATIC netmap_plugin/netmap_collector.cpp) endif() # Client tool add_executable(fastnetmon_client fastnetmon_client.cpp) ``` -------------------------------- ### GoBGP Configuration Example Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Basic GoBGP configuration including global AS, router ID, and neighbor settings with local address. ```yaml # /etc/gobgp/gobgp.conf [global.config] as = 65001 router-id = "10.0.0.2" [[neighbors]] [neighbors.config] neighbor-address = "10.0.0.1" peer-as = 65000 [neighbors.transport.config] local-address = "10.0.0.2" ``` -------------------------------- ### Launch Fuzzing Container Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Starts the container with a mounted volume for output and executes the fuzzing harness script. ```bash mkdir work docker run -v $(pwd)/work:/output --privileged -it fuzz /bin/bash -c "/src/tests/fuzz/scripts/start_fuzz_harness.sh ./build_netflow_pers_mod/fastnetmon" ``` -------------------------------- ### Launch Docker Container for Fuzzing Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Starts a privileged container environment for fuzzing operations. ```bash docker run --privileged -it fuzz /bin/bash ``` -------------------------------- ### Example Prometheus Queries Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Sample PromQL queries to retrieve traffic and attack data from FastNetMon metrics. ```promql # Total incoming traffic in bits per second fastnetmon_total_incoming_traffic_bps ``` ```promql # Total packets per second by direction fastnetmon_total_traffic_pps{direction="incoming"} fastnetmon_total_traffic_pps{direction="outgoing"} ``` ```promql # Number of active attacks fastnetmon_attacks_active ``` -------------------------------- ### Generate Systemd Service Files Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Configures and installs systemd service files on Linux platforms if absolute installation paths are enabled. ```cmake if (SET_ABSOLUTE_INSTALL_PATH) set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "/lib/systemd/system" CACHE PATH "Location for systemd service files") # Generate unit file if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") configure_file(fastnetmon.service.in "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}) endif() else() endif() ``` -------------------------------- ### Start AFL++ Fuzzing for Wrappers Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Launches the AFL++ fuzzer against specific packet parsing wrappers. ```bash afl-fuzz -i in -o out -- ./parse_sflow_v5_packet_fuzz ``` ```bash afl-fuzz -i in -o out -- ./process_netflow_packet_v5_fuzz ``` -------------------------------- ### Start AFL++ Fuzzing for FastNetMon Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Launches the AFL++ fuzzer against the instrumented FastNetMon executable. ```bash afl-fuzz -i in -o out -- ./fastnetmon ``` -------------------------------- ### Create Bash Alias Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Add a shortcut to your ~/.bashrc to quickly start and enter the container. ```bash alias dev_comm='sudo docker start linux_systemd_container_prod; sudo docker exec -it fastnetmon_community_developer bash' ``` -------------------------------- ### Graphite Metrics Paths Example Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Illustrative Graphite metric paths for various traffic statistics and host/network specific data. ```text fastnetmon.total.incoming.pps fastnetmon.total.incoming.bps fastnetmon.total.outgoing.pps fastnetmon.total.outgoing.bps fastnetmon.hosts.192_168_1_100.incoming.pps fastnetmon.networks.10_0_0_0_24.incoming.bps ``` -------------------------------- ### Prometheus Scrape Configuration Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Example Prometheus configuration to scrape metrics from FastNetMon. Adjust job name and targets as needed. ```yaml # prometheus.yml scrape_configs: - job_name: 'fastnetmon' static_configs: - targets: ['localhost:9209'] scrape_interval: 10s ``` -------------------------------- ### Find and Link libbpf Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Locates the libbpf library, which is required for AF_XDP support. It requires LIBBPF_CUSTOM_INSTALL_PATH to be set for custom installations. ```cmake if (ENABLE_LIBBPF_SUPPORT) include_directories("${LIBBPF_CUSTOM_INSTALL_PATH}/include") find_library(LIBBPF_LIBRARY_PATH NAMES "bpf" PATHS "${LIBBPF_CUSTOM_INSTALL_PATH}/lib64" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) if (NOT LIBBPF_LIBRARY_PATH) message(FATAL_ERROR "Could not find libbpf library") else() message(STATUS "Will use libbpf from ${LIBBPF_LIBRARY_PATH}") endif() endif() ``` -------------------------------- ### Expected Output: Receiver Side Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Example output from the receiver tool, showing packets per second (pps), total packets received, and transmitted. ```text sock0@enP9p144s0f0:16 rxdrop pps pkts 0.23 rx 0 297,753,014 tx 0 0 ``` -------------------------------- ### A10 Plugin Manual Ban/Unban Test Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Example commands to manually test the A10 integration script for banning and unbanning IP addresses. ```bash # Manual ban test sudo python fastnetmon_a10_v0.3.py "10.10.10.10" "outgoing" "111111" "ban" ``` ```bash # Manual unban test sudo python fastnetmon_a10_v0.3.py "10.10.10.10" "outgoing" "111111" "unban" ``` -------------------------------- ### Prepare Build Directory Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Navigate to the source directory and initialize the build folder. ```bash cd fastnetmon/src/ mdkir build cd build cmake .. ``` -------------------------------- ### Build Project Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Compile the project using all available CPU cores. ```bash make -j ``` -------------------------------- ### Build FastNetMon Community Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Traffic-Counters-Structures-performance-evaluation Use CMake to configure the build with specific options and then use Make to compile the project. Ensure you are in the build directory before running CMake. ```bash cmake .. -DENABLE_CUSTOM_BOOST_BUILD=FALSE -DDO_NOT_USE_SYSTEM_LIBRARIES_FOR_BUILD=FALSE -DBUILD_TESTS=ON make -j ``` -------------------------------- ### A10 API GET Request Output (Version) Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/tests/README.md This JSON output represents the response from a GET request to the A10 API for version and operational status. It includes hardware and software versions, serial number, and current time. ```json { "version": { "oper" : { "hw-platform":"TH4435 TPS", "copyright":"Copyright 2007-2014 by A10 Networks, Inc.", "sw-version":"3.2.1 build 175 (May-17-2016,16:57)", "plat-features":"", "boot-from":"HD_PRIMARY", "serial-number":"", "current-time":"Jul-27-2016, 09:46", "up-time":"70 days, 22 hours, 44 minutes" }, "a10-url":"/axapi/v3/version/oper" } } ``` -------------------------------- ### Launch Real-time Traffic Monitoring Client Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Launch the ncurses-based interface for monitoring traffic. Use the --ipv6 flag for IPv6 monitoring or set the cli_stats_file_path environment variable for a custom stats file. Press 'q' to quit. ```bash # Launch IPv4 monitoring client ./fastnetmon_client # Launch IPv6 monitoring client ./fastnetmon_client --ipv6 # Use custom stats file export cli_stats_file_path=/tmp/custom_fastnetmon.dat ./fastnetmon_client # Press 'q' to quit the client ``` -------------------------------- ### Configure Boost for Custom Build Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Sets up Boost include and library directories when using custom Boost versions. Requires Boost_INSTALL_PATH to be defined. ```cmake set(Boost_NO_SYSTEM_PATHS ON) set(BOOST_INCLUDEDIR "${BOOST_INSTALL_PATH}") set(BOOST_LIBRARYDIR "${BOOST_INSTALL_PATH}/lib/") SET(Boost_DIR "${BOOST_INSTALL_PATH}/lib/cmake/Boost-1.81.0/") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-deprecated-declarations") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${BOOST_INSTALL_PATH}/lib;${GCC_INSTALL_PATH}/lib64") ``` -------------------------------- ### Run Alias Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Execute the created alias to enter the environment. ```bash dev_comm ``` -------------------------------- ### Get Ban List Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Retrieve the current list of banned IP addresses using the API client. ```APIDOC ## Get Ban List Retrieve the current list of banned IP addresses using the API client. ```bash # Get current ban list ./fastnetmon_api_client get_banlist # Expected output: # 192.168.1.100/32 # 10.0.0.50/32 # 2001:db8::1/128 ``` ``` -------------------------------- ### Initialize Fuzzing Input Directory Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Creates the input directory and adds a seed file for the fuzzer. ```bash mkdir in echo "1" >> in/1 ``` -------------------------------- ### CLI Client - Real-time Traffic Monitoring Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Launch the ncurses-based interface for monitoring traffic in real-time. ```APIDOC ## CLI Client - Real-time Traffic Monitoring The fastnetmon_client provides a ncurses-based interface for monitoring traffic. ```bash # Launch IPv4 monitoring client ./fastnetmon_client # Launch IPv6 monitoring client ./fastnetmon_client --ipv6 # Use custom stats file export cli_stats_file_path=/tmp/custom_fastnetmon.dat ./fastnetmon_client # Press 'q' to quit the client ``` ``` -------------------------------- ### Query Attacks in MongoDB Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Example MongoDB shell query to retrieve the 10 most recent attacks, sorted by timestamp. ```javascript // MongoDB shell use fastnetmon db.attacks.find({}).sort({timestamp: -1}).limit(10) ``` -------------------------------- ### Find and Link libelf Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Locates the libelf library, which is a dependency for libbpf. It requires LIBELF_CUSTOM_INSTALL_PATH to be set for custom installations. ```cmake if (ENABLE_LIBELF_SUPPORT) # We do not use it directly but we need it as dependency for libbpf # include_directories("${LIBELF_CUSTOM_INSTALL_PATH/include") find_library(LIBELF_LIBRARY_PATH names "elf" PATHS "${LIBELF_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) if (NOT LIBELF_LIBRARY_PATH) message(FATAL_ERROR "Could not find libelf library") else() message(STATUS "Will use libelf library from ${LIBELF_LIBRARY_PATH}") endif() endif() ``` -------------------------------- ### Configure sFlow Capture Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Settings for sFlow collection and a sample switch configuration. ```ini # Enable sFlow capture sflow = on # sFlow listener configuration sflow_port = 6343 sflow_host = 0.0.0.0 # Use IP header for packet length (fixes vendor issues) sflow_read_packet_length_from_ip_header = off ``` ```text # Example sFlow agent configuration sflow agent-address 10.0.0.2 sflow destination 10.0.0.1 6343 sflow sampling ethernet 1/1 1024 sflow polling ethernet 1/1 30 ``` -------------------------------- ### Hostname Configuration Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/json_configs/tps_base_config_json_v1.txt Set the system hostname. ```APIDOC ## POST /axapi/v3/hostname ### Description Sets the hostname for the FastNetMon system. ### Method POST ### Endpoint /axapi/v3/hostname ### Request Body - **hostname** (object) - Required - Hostname configuration. - **value** (string) - Required - The desired hostname. ### Request Example ```json { "hostname": { "value":"tps-fastnetmon" } } ``` ### Response #### Success Response (200) - **response** (object) - Contains the status of the operation. #### Response Example ```json { "response": { "status": "ok" } } ``` ``` -------------------------------- ### System Configuration Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/json_configs/tps_base_config_json_v1.txt Configure system-level settings for logging and attack detection. ```APIDOC ## POST /axapi/v3/system ### Description Configures system-level settings including anomaly logging, attack detection, and DDoS logging. ### Method POST ### Endpoint /axapi/v3/system ### Request Body - **system** (object) - Required - System configuration parameters. - **anomaly-log** (integer) - Enable/disable anomaly logging (1 for enable, 0 for disable). - **attack** (integer) - Enable/disable attack detection (1 for enable, 0 for disable). - **attack-log** (integer) - Enable/disable attack logging (1 for enable, 0 for disable). - **ddos-attack** (integer) - Enable/disable DDoS attack detection (1 for enable, 0 for disable). - **ddos-log** (integer) - Enable/disable DDoS attack logging (1 for enable, 0 for disable). ### Request Example ```json { "system": { "anomaly-log":1, "attack":1, "attack-log":1, "ddos-attack":1, "ddos-log":1 } } ``` ### Response #### Success Response (200) - **response** (object) - Contains the status of the operation. #### Response Example ```json { "response": { "status": "ok" } } ``` ``` -------------------------------- ### Find and Link libpcap Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Locates the libpcap library, essential for packet capture. It requires LIBPCAP_CUSTOM_INSTALL_PATH to be set for custom installations. ```cmake ### Look for libpcap find_path(LIBPCAP_INCLUDES_FOLDER NAMES pcap.h PATHS "${LIBPCAP_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) find_library(LIBPCAP_LIBRARY_PATH NAMES pcap PATHS "${LIBPCAP_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) if (LIBPCAP_INCLUDES_FOLDER AND LIBPCAP_LIBRARY_PATH) message(STATUS "We found pcap library ${LIBPCAP_LIBRARY_PATH}") include_directories(${LIBPCAP_INCLUDES_FOLDER}) else() message(FATAL_ERROR "We can't find pcap library") endif() ``` -------------------------------- ### Configure Build Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Run cmake with specific compiler paths and build options. ```bash CC=/opt/fastnetmon-community/libraries/gcc_12_1_0/bin/gcc CXX=/opt/fastnetmon-community/libraries/gcc_12_1_0/bin/g++ /opt/fastnetmon-community/libraries/cmake_3_23_4/bin/cmake -DDO_NOT_USE_SYSTEM_LIBRARIES_FOR_BUILD=ON -DKAFKA_SUPPORT=ON -DBUILD_TESTS=ON -DCLICKHOUSE_SUPPORT=ON .. ``` -------------------------------- ### Configure Kafka Support in FastNetMon Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Enables Kafka support by defining the KAFKA macro and finding the cppkafka library. Requires LIB_RDKAFKA_INSTALL_PATH and LIB_CPP_KAFKA_INSTALL_PATH to be set. ```cmake if (KAFKA_SUPPORT) # We need to enable it explicitly add_definitions(-DKAFKA) # cpp-kafka uses these header files from their header too include_directories("${LIB_RDKAFKA_INSTALL_PATH}/include") # cppkafka find_library(LIBKAFKA_CPP_LIBRARY_PATH names "cppkafka" PATHS "${LIB_CPP_KAFKA_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) include_directories("${LIB_CPP_KAFKA_INSTALL_PATH}/include") if (NOT LIBKAFKA_CPP_LIBRARY_PATH) message(FATAL_ERROR "Could not find cppkafka library") else() message(STATUS "Will use cppkafka library from ${LIBKAFKA_CPP_LIBRARY_PATH}") endif() endif() ``` -------------------------------- ### Get Git Commit Hash Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Retrieves the full and short (8-character) Git commit hash of the current HEAD. This is used for versioning. ```cmake # Get last commit hash execute_process(COMMAND git rev-list HEAD COMMAND head -n 1 OUTPUT_VARIABLE GIT_LAST_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE) # Short 8 symbol commit execute_process(COMMAND git rev-list HEAD COMMAND head -n 1 COMMAND cut -c1-8 OUTPUT_VARIABLE GIT_LAST_COMMIT_HASH_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Commit hash: ${GIT_LAST_COMMIT_HASH_SHORT}") set(FASTNETMON_APPLICATION_VERSION "${FASTNETMON_VERSION_MAJOR}.${FASTNETMON_VERSION_MINOR}.${FASTNETMON_VERSION_PATCH} ${GIT_LAST_COMMIT_HASH_SHORT}") ``` -------------------------------- ### Create Netflow Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Builds a static library for Netflow processing. ```cmake # netflow library add_library(netflow STATIC netflow_plugin/netflow.cpp) ``` -------------------------------- ### Link Libraries to fast_library Target Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Links OpenSSL libraries to the 'fast_library' target. Ensure OpenSSL is installed and its paths are correctly defined in the CMake environment. ```cmake target_link_libraries(fast_library ${OPENSSL_LIBRARY_PATH}) target_link_libraries(fast_library ${OPENSSL_CRYPTO_LIBRARY_PATH}) ``` -------------------------------- ### Create Speed Counters Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Builds a static library for speed counters and links it with the 'fast_library'. ```cmake # Speed counters lib add_library(speed_counters STATIC speed_counters.cpp) target_link_libraries(speed_counters fast_library) ``` -------------------------------- ### Configure FastNetMon Advanced Callback Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/mikrotik_plugin/README.md Enable and configure the notification script path and format using the fcli command-line tool. ```bash sudo fcli set main notify_script_enabled enable sudo fcli set main notify_script_path /etc/fastnetmon/scripts/notify_about_attack.sh sudo fcli set main notify_script_format text sudo fcli commit ``` -------------------------------- ### Expected Output: Traffic Generator Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Example output from the traffic generator, showing packets per second (pps), total packets transmitted, and received. ```text sock0@enP9p144s0f0:0 txonly pps pkts 0.10 rx 0 0 tx 0 292,352,353 ``` -------------------------------- ### Add Static Libraries for gobgp API Client Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Creates static libraries for the generated Protobuf ('gobgp.pb.cc') and gRPC ('gobgp.grpc.pb.cc') code for the gobgp API client. ```cmake add_library(gobgp_api_client_pb_cc STATIC gobgp_client/gobgp.pb.cc) add_library(gobgp_api_client_grpc_pb_cc STATIC gobgp_client/gobgp.grpc.pb.cc) ``` -------------------------------- ### Specify Debian Package Dependencies Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Defines the runtime dependencies required for the Debian package of FastNetMon. Ensure these libraries are installed on the target system for the package to function correctly. ```cmake set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-thread-dev, libboost-system-dev, libboost-regex-dev, libpcap-dev, libnuma-dev, liblog4cpp5-dev, libgrpc10, libgrpc++1, libcapnp-0.7.0, libmongoc-1.0-0, libbson-1.0-0, libboost-program-options1.74.0") ``` -------------------------------- ### Find gRPC C++ Plugin Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Searches for the gRPC C++ compiler plugin ('grpc_cpp_plugin') in a specified custom installation path. This plugin is required for generating gRPC code from .proto files. ```cmake find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin PATHS "${GRPC_CUSTOM_INSTALL_PATH}/bin" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) ``` -------------------------------- ### Create libsflow Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Builds a static library for sFlow parsing with pedantic compilation flags. ```cmake # Our own sFlow parser library set_source_files_properties(libsflow/libsflow.cpp PROPERTIES COMPILE_FLAGS -pedantic) add_library(libsflow STATIC libsflow/libsflow.cpp) ``` -------------------------------- ### Enable Cap'N'Proto Support Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Manages the build of Cap'N'Proto support in FastNetMon, enabled by default via the ENABLE_CAPNP_SUPPORT option. It includes finding the capnp compiler and setting environment variables for its execution. ```cmake option(ENABLE_CAPNP_SUPPORT "Enable Cap'N'Proto support build" ON) if (ENABLE_CAPNP_SUPPORT) message(STATUS "We will build Cap'N'Proto support") find_program(CAPNP_BINARY capnp PATHS "${CAPNP_CUSTOM_INSTALL_PATH}/bin" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) if (CAPNP_BINARY) message(STATUS "Found capnp compiler: ${CAPNP_BINARY}") else() message(FATAL_ERROR "Can't find capnp compiler") endif() SET(CAPNP_ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}" "PATH=$ENV{PATH}:${CAPNP_CUSTOM_INSTALL_PATH}/bin") endif() ``` -------------------------------- ### Get Ban List using API Client Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Retrieve the current list of banned IP addresses using the API client. The output lists each banned IP address with its subnet mask. ```bash # Get current ban list ./fastnetmon_api_client get_banlist # Expected output: # 192.168.1.100/32 # 10.0.0.50/32 # 2001:db8::1/128 ``` -------------------------------- ### Define build targets and link dependencies Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Configures static libraries and executables, including conditional linking for Windows and Kafka support. ```cmake add_library(fastnetmon_grpc_pb_cc STATIC fastnetmon_internal_api.grpc.pb.cc) add_library(fastnetmon_pb_cc STATIC fastnetmon_internal_api.pb.cc) add_executable(fastnetmon_api_client fastnetmon_api_client.cpp) if (LINK_WITH_ABSL) target_link_libraries(fastnetmon_api_client absl::base absl::synchronization) endif() # We use another way to specify dependencies for Windows as our standard approach clearly does not work # https://www.f-ax.de/dev/2020/11/08/grpc-plugin-cmake-support.html if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries(fastnetmon_api_client gRPC::grpc gRPC::grpc++) else() target_link_libraries(fastnetmon_api_client ${GRPC_LIBRARY_GPR_PATH}) target_link_libraries(fastnetmon_api_client ${GRPC_LIBRARY_GRPC_CPP_PATH}) target_link_libraries(fastnetmon_api_client ${GRPC_LIBRARY_GRPC_PATH}) endif() target_link_libraries(fastnetmon_api_client fastnetmon_grpc_pb_cc) target_link_libraries(fastnetmon_api_client fastnetmon_pb_cc) target_link_libraries(fastnetmon_api_client protobuf::libprotobuf) if (KAFKA_SUPPORT) target_link_libraries(fastnetmon ${LIBKAFKA_CPP_LIBRARY_PATH}) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries(fastnetmon gRPC::grpc gRPC::grpc++) else() target_link_libraries(fastnetmon ${GRPC_LIBRARY_GPR_PATH}) target_link_libraries(fastnetmon ${GRPC_LIBRARY_GRPC_CPP_PATH}) target_link_libraries(fastnetmon ${GRPC_LIBRARY_GRPC_PATH}) endif() target_link_libraries(fastnetmon fastnetmon_grpc_pb_cc) target_link_libraries(fastnetmon fastnetmon_pb_cc) target_link_libraries(fastnetmon protobuf::libprotobuf) endif() ``` -------------------------------- ### Find log4cpp Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt This snippet attempts to locate the log4cpp library and its include directories. It checks for a custom installation path and falls back to default search paths. If log4cpp is not found, the build fails. ```cmake find_library(LOG4CPP_LIBRARY_PATH NAMES log4cpp PATHS "${LOG4CPP_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR}) if (LOG4CPP_INCLUDES_FOLDER AND LOG4CPP_LIBRARY_PATH) include_directories(${LOG4CPP_INCLUDES_FOLDER}) message(STATUS "We have found log4cpp: ${LOG4CPP_LIBRARY_PATH}") else() message(FATAL_ERROR "We can't find log4cpp. We can't build project") endif() ``` -------------------------------- ### Set LD_LIBRARY_PATH for Protobuf and gRPC Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Sets the LD_LIBRARY_PATH environment variable to include custom installation paths for Protobuf and gRPC libraries. This is crucial for dynamically linking libraries not found in system paths. It accounts for different library directory names (lib64 vs. lib) across distributions. ```cmake set(ENV{LD_LIBRARY_PATH} "${GCC_INSTALL_PATH}/lib64:${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH}/lib:${PROTOCOL_BUFFERS_CUSTOM_INSTALL_PATH}/lib64:${GRPC_CUSTOM_INSTALL_PATH}/lib") ``` -------------------------------- ### Compile AF_XDP User-space Application Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Compiles the xdpsock_user.c AF_XDP user-space application, linking against the BPF library and including necessary header paths. ```bash cd /root/linux-4.19/samples/bpf gcc xdpsock_user.c -o xdpsock_user -lpthread -L/opt/libbpf -lbpf -lelf -I/opt/libbpf/include -I/root/linux-4.19/tools/testing/selftests/bpf ``` -------------------------------- ### Configure Dummy Zone on A10 TPS Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/README.md This command sequence is used to set up a dummy zone configuration on the A10 TPS appliance if no prior 'ddos dst zone' configuration exists. It's a preliminary step before applying FastNetMon configurations. ```bash TH3030S-1(config)#ddos dst zone dummy TH3030S-1(config-ddos zone)#exit TH3030S-1(config)#no ddos dst zone dummy TH3030S-1(config)#end TH3030S-1# ``` -------------------------------- ### Build Docker Image for Fuzzing Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Builds the Docker image required for fuzzing tests. Ensure you are in the root directory of the FastNetMon project. ```bash docker build -f tests/Dockerfile.ubuntu-24.04-afl++ . -t fuzz ``` -------------------------------- ### Configure Main FastNetMon Settings Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt The primary configuration file located at /etc/fastnetmon.conf manages logging, detection thresholds, and traffic processing directions. ```ini # /etc/fastnetmon.conf - Main Configuration File ### ### Logging Configuration ### logging_level = info logging_local_syslog_logging = off logging_remote_syslog_logging = off logging_remote_syslog_server = 10.10.10.10 logging_remote_syslog_port = 514 ### ### Detection Settings ### enable_ban = on enable_ban_ipv6 = on # Traffic processing directions process_incoming_traffic = on process_outgoing_traffic = on # DDoS detection thresholds threshold_pps = 20000 threshold_mbps = 1000 threshold_flows = 3500 # Per-protocol thresholds threshold_tcp_mbps = 100000 threshold_udp_mbps = 100000 threshold_icmp_mbps = 100000 threshold_tcp_pps = 100000 threshold_udp_pps = 100000 threshold_icmp_pps = 100000 # Detection methods ban_for_pps = on ban_for_bandwidth = on ban_for_flows = off # Ban duration (seconds), set to 0 to disable auto-unban ban_time = 1900 unban_only_if_attack_finished = on ### ### Network Lists ### networks_list_path = /etc/networks_list white_list_path = /etc/networks_whitelist ``` -------------------------------- ### Copy XDP and Link Headers to System Includes Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Copies necessary XDP and BPF header files from the kernel source to the system's include directory to resolve compilation issues. ```bash cp ~/linux-4.19/include/uapi/linux/if_xdp.h /usr/include/linux/if_xdp.h cp ~/linux-4.19/include/uapi/linux/if_link.h /usr/include/linux/if_link.h cp ~/linux-4.19/include/uapi/linux/bpf.h /usr/include/linux/bpf.h ``` -------------------------------- ### ExaBGP Integration Configuration Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Enable ExaBGP integration for announcing blocked IPs via BGP for blackhole routing. Configure the command pipe, next hop, communities, and announcement options. ```ini # Enable ExaBGP integration exabgp = on exabgp_command_pipe = /var/run/exabgp.cmd exabgp_next_hop = 10.0.3.114 # BGP community for announcements exabgp_community = 65001:666 # Or specify multiple communities # exabgp_community = [65001:666 65001:777] # Different communities for host vs subnet # exabgp_community_host = 65001:668 # exabgp_community_subnet = 65001:667 # Announcement options exabgp_announce_host = on exabgp_announce_whole_subnet = off ``` -------------------------------- ### Create Netflow Template Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Builds a static library for Netflow templates. ```cmake # Netflow templates add_library(netflow_template STATIC netflow_plugin/netflow_template.cpp) ``` -------------------------------- ### Run FastNetMon Test Suite Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Traffic-Counters-Structures-performance-evaluation Execute the compiled test suite to verify the integrity of traffic structures. This command should be run after a successful build. ```bash ./traffic_structures_tests ``` -------------------------------- ### sFlow Settings Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/json_configs/tps_base_config_json_v1.txt Configure general sFlow sampling settings. ```APIDOC ## POST /axapi/v3/sflow/setting ### Description Configures general settings for sFlow (Sampled Flow) traffic analysis, including maximum header size and packet sampling rate. ### Method POST ### Endpoint /axapi/v3/sflow/setting ### Request Body - **setting** (object) - Required - sFlow settings. - **max-header** (integer) - The maximum size of the packet header to sample. - **packet-sampling-rate** (integer) - The rate at which packets are sampled (e.g., 1000 means 1 in 1000 packets). ### Request Example ```json { "setting": { "max-header":128, "packet-sampling-rate":1000 } } ``` ### Response #### Success Response (200) - **response** (object) - Contains the status of the operation. #### Response Example ```json { "response": { "status": "ok" } } ``` ``` -------------------------------- ### Ethernet Interface Configuration Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/json_configs/tps_base_config_json_v1.txt Configure Ethernet interfaces, including name and action. ```APIDOC ## POST /axapi/v3/interface/ethernet ### Description Configures Ethernet interfaces, allowing you to set their number, name, and action (e.g., enable). ### Method POST ### Endpoint /axapi/v3/interface/ethernet ### Request Body - **ethernet-list** (array) - Required - List of Ethernet interface configurations. - **ifnum** (integer) - Required - The interface number. - **name** (string) - Optional - The name of the interface. - **action** (string) - Optional - Action to perform on the interface (e.g., "enable"). ### Request Example ```json { "ethernet-list": [ { "ifnum":1, "name":"Inbound", "action":"enable" }, { "ifnum":2, "name":"Outbound" } ] } ``` ### Response #### Success Response (200) - **response** (object) - Contains the status of the operation. #### Response Example ```json { "response": { "status": "ok" } } ``` ``` -------------------------------- ### Login to Container Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Access the running container via bash. ```bash sudo docker exec -it fastnetmon_community_developer bash ``` -------------------------------- ### Build fastnetmon_plugin_runner Executable Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Defines and builds the 'fastnetmon_plugin_runner' executable if BUILD_PLUGIN_RUNNER is enabled. It links necessary libraries, including plugins and log4cpp. ```cmake # cmake .. -DBUILD_PLUGIN_RUNNER=ON if (BUILD_PLUGIN_RUNNER) add_executable(fastnetmon_plugin_runner plugin_runner.cpp) if (ENABLE_AFPACKET_SUPPORT) target_link_libraries(fastnetmon_plugin_runner afpacket_plugin) endif() target_link_libraries(fastnetmon_plugin_runner ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(fastnetmon_plugin_runner patricia) target_link_libraries(fastnetmon_plugin_runner fastnetmon_pcap_format) target_link_libraries(fastnetmon_plugin_runner ${LOG4CPP_LIBRARY_PATH}) target_link_libraries(fastnetmon_plugin_runner fast_library) # Add all plugins target_link_libraries(fastnetmon_plugin_runner sflow_plugin netflow_plugin pcap_plugin example_plugin) if (ENABLE_NETMAP_SUPPORT) target_link_libraries(fastnetmon_plugin_runner netmap_plugin) endif() endif() ``` -------------------------------- ### Enable API Server Configuration Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Enable the gRPC API server for programmatic access. This is required for the fastnetmon_api_client. ```ini # Enable gRPC API (required for fastnetmon_api_client) enable_api = on ``` -------------------------------- ### Configure Fast Platform Header Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Generates the fast_platform.hpp header file from a template, which is essential for platform-specific configurations. ```cmake configure_file(fast_platform.h.template "${PROJECT_SOURCE_DIR}/fast_platform.hpp") ``` -------------------------------- ### Pull Docker Image Source: https://github.com/pavel-odintsov/fastnetmon/wiki/Developer-environment-setup Download the latest Ubuntu 24.04-based developer image. ```bash sudo docker pull ghcr.io/pavel-odintsov/fastnetmon-community-developer-24-04:latest ``` -------------------------------- ### Configure Redis Data Storage Source: https://context7.com/pavel-odintsov/fastnetmon/llms.txt Enable and configure FastNetMon to store attack details in Redis. Includes host, port, and a custom prefix for keys. ```ini # Enable Redis storage redis_enabled = on redis_host = 127.0.0.1 redis_port = 6379 redis_prefix = mydc1 ``` -------------------------------- ### Create sFlow Plugin Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Builds a static library for the sFlow plugin, linking it with the 'simple_packet_parser_ng' and 'libsflow' libraries. ```cmake # sFlow plugin add_library(sflow_plugin STATIC sflow_plugin/sflow_collector.cpp) # Link sFlow plugin with new traffic parser target_link_libraries(sflow_plugin simple_packet_parser_ng) # Link sFlow plugin with libsflow target_link_libraries(sflow_plugin libsflow) ``` -------------------------------- ### Run AF_XDP Receiver Tool Source: https://github.com/pavel-odintsov/fastnetmon/wiki/af_xdp-tests-for-Linux-4.19 Executes the xdpsock_user application in receiver mode, processing traffic on the specified interface and queue, with RX drop enabled. ```bash LD_LIBRARY_PATH=/opt/libbpf ./xdpsock_user --rxdrop --interface enP9p144s0f0 --queue=16 ``` -------------------------------- ### Enable Netmap Support Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Configures FastNetMon to build with Netmap support, which is controlled by the ENABLE_NETMAP_SUPPORT option. This feature is disabled if the system lacks __atomic_thread_fence support. ```cmake option(ENABLE_NETMAP_SUPPORT "Enable Netmap support" OFF) CHECK_CXX_SOURCE_COMPILES(" int main() { __atomic_thread_fence(__ATOMIC_RELEASE); __atomic_thread_fence(__ATOMIC_ACQUIRE); return 0; } " HAVE_ATOMIC_THREAD_FENCE) if (NOT HAVE_ATOMIC_THREAD_FENCE) set(ENABLE_NETMAP_SUPPORT OFF) message(STATUS "Your system does not support __atomic_thread_fence, disabled Netmap plugin support") endif() if (ENABLE_NETMAP_SUPPORT) message(STATUS "We will build Netmap support for you") add_definitions(-DNETMAP_PLUGIN) endif() ``` -------------------------------- ### Check for __sync_fetch_and_add Support Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Verifies the availability of the __sync_fetch_and_add intrinsic. If unavailable, it attempts to link with libatomic. This check is particularly relevant for platforms like mipsel. ```cmake CHECK_CXX_SOURCE_COMPILES(" #include int main() { uint64_t x = 1; __sync_fetch_and_add(&x, 1); return x; } " HAVE__SYNC_FETCH_AND_ADD) if (HAVE__SYNC_FETCH_AND_ADD) message(STATUS "We have __sync_fetch_and_add on this platform") else() message(STATUS "We have no __sync_fetch_and_add on this platform, will try linking with libatomic") check_library_exists(atomic __sync_fetch_and_add_8 "" HAVE_LIBATOMIC_SYNC_FETCH_AND_ADD) if (HAVE_LIBATOMIC_SYNC_FETCH_AND_ADD) message(STATUS "Linked with atomic library") set(LINK_WITH_ATOMIC_LIBRARY ON) else() message(STATUS "We have no support for __sync_fetch_and_add in atomic library, skip linking") endif() endif() ``` -------------------------------- ### Create Network Data Structures Library Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Builds a static library for network data types used in parsing network structures. ```cmake # Library with data types for parsing network structures add_library(network_data_structures STATIC network_data_structures.cpp) ``` -------------------------------- ### Configure MikroTik Router Settings Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/mikrotik_plugin/README.md Set the router IP, API username, and password within the fastnetmon_mikrotik.php file. ```php $cfg[ ip_mikrotik ] = "192.168.10.1"; // MikroTik Router IP $cfg[ api_user ] = "api"; // username $cfg[ api_pass ] = "api123"; // password ``` -------------------------------- ### sFlow Sampling Configuration Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/json_configs/tps_base_config_json_v1.txt Configure the Ethernet interfaces for sFlow sampling. ```APIDOC ## POST /axapi/v3/sflow/sampling ### Description Configures the Ethernet interfaces over which sFlow sampling should be performed. You can specify a range of interfaces. ### Method POST ### Endpoint /axapi/v3/sflow/sampling ### Request Body - **sampling** (object) - Required - sFlow sampling configuration. - **eth-list** (array) - Required - List of Ethernet interface ranges for sampling. - **eth-start** (integer) - Required - The starting Ethernet interface number. - **eth-end** (integer) - Required - The ending Ethernet interface number. ### Request Example ```json { "sampling": { "eth-list": [ { "eth-start":1, "eth-end":1 } ] } } ``` ### Response #### Success Response (200) - **response** (object) - Contains the status of the operation. #### Response Example ```json { "response": { "status": "ok" } } ``` ``` -------------------------------- ### Set Include Directory for gRPC Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Adds a directory to the include path for gRPC. Ensure the ABSL_INSTALL_PATH variable is correctly set. ```cmake include_directories("${ABSL_INSTALL_PATH}/include") ``` -------------------------------- ### Admin Configuration Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/a10_plugin/json_configs/tps_base_config_json_v1.txt Configure administrative user and password. ```APIDOC ## POST /axapi/v3/admin ### Description Configures the administrative user and their password. The password should be provided in an encrypted format. ### Method POST ### Endpoint /axapi/v3/admin ### Request Body - **admin-list** (array) - Required - List of admin configurations. - **user** (string) - Required - The username for the admin account. - **password** (object) - Required - Password configuration. - **encrypted-in-module** (string) - Required - The encrypted password string. ### Request Example ```json { "admin-list": [ { "user":"admin", "password": { "encrypted-in-module":"sCyT4priW1OZSg3m1RiAf0bOyZ0Odnf1rQRp+BHohemGp1YhW+V1NjwQjLjV2wDn" } } ] } ``` ### Response #### Success Response (200) - **response** (object) - Contains the status of the operation. #### Response Example ```json { "response": { "status": "ok" } } ``` ``` -------------------------------- ### Enable XDP Plugin Build Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/CMakeLists.txt Enables the build for the XDP plugin on all platforms that support it. ```cmake # We enable XDP plugin build for all platforms which support it ``` -------------------------------- ### Launch Fuzzing Harness via Automation Script Source: https://github.com/pavel-odintsov/fastnetmon/blob/master/src/tests/fuzz/README.md Executes the fuzzing harness script for specific binary targets within the container's src directory. ```bash /src/tests/fuzz/scripts/start_fuzz_harness.sh ./build_fuzz_harness/process_netflow_packet_v5_fuzz ``` ```bash /src/tests/fuzz/scripts/start_fuzz_harness.sh ./build_fuzz_harness/parse_sflow_v5_packet_fuzz ``` ```bash /src/tests/fuzz/scripts/start_fuzz_harness.sh ./build_netflow_pers_mod/fastnetmon ``` ```bash /src/tests/fuzz/scripts/start_fuzz_harness.sh ./build_sflow_pers_mod/fastnetmon ```