YAF is Yet Another Flowmeter. It processes packet data from pcap(3)
dumpfiles (as generated by tcpdump(1)
) or via live capture from an interface. YAF can capture from standard interfaces using pcap(3)
, an Endace DAG card, or a Napatech adapter.
It converts packet data into bidirectional flows and then exports those flows to IPFIX Collecting Processes or into an IPFIX-based file format. YAF’s output is designed to be used with the SiLK flow analysis tools and the NetSA Aggregated Flow (NAF) toolchain.
YAF also supports partial payload capture. This feature is intended for “banner grabbing” for protocol verification and service presence detection, and is presently experimental.
YAF is intended as an experimental implementation tracking developments in the IETF IPFIX working group, specifically:
It is designed to perform acceptably as a flow sensor on any network where white-box flow collection with commodity hardware is appropriate. However, tradeoffs between raw performance and clarity of design have generally been made in favor of the latter.
The YAF toolchain presently consists of several tools:
yaf
: The main flowmeter application.yafscii
: Converts binary YAF IPFIX output into an ASCII format.getFlowKeyHash
: A helper tool for working with pcap
export options.yafMeta2Pcap
: Another helper tool for working with pcap
export options.By default, YAF generates flows based on the standard 5-tuple and the VLAN tag, if available. The 5-tuple consists of:
If YAF is configured with MPLS support, it will use the top three MPLS labels from the stack in addition to the 5-tuple and VLAN to determine the flow. In MPLS mode, it will also export these labels in the IPFIX record.
Furthermore, if YAF is configured with --enable-nonip
, it will accept non-IP data and generate flow data using just the MPLS labels. The 5-tuple and VLAN fields will be set to 0.
YAF uses a standard autotools-based build system.
Before building YAF, you must install its dependencies.
Library | Version | Notes |
---|---|---|
GLib | >= 2.34.0 | Available at gtk.org. |
libfixbuf | >= 2.3.0 | Available at tools.netsa.cert.org/fixbuf. |
libpcap | - | Available at tcpdump.org. Included in many OSes. |
libairframe | - | Built and installed with the YAF distribution. |
libyaf | - | Built and installed with the YAF distribution. |
./configure --with-dag
../configure --with-napatech
.libfixbuf
are in a non-standard location, you may need to set PKG_CONFIG_PATH
.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
./configure
make
sudo make install
Here are solutions to some common issues.
configure: error: Cannot find a suitable libfixbuf
configure: error: Cannot find a suitable libfixbuf (>= 2.3.0) (Try setting PKG_CONFIG_PATH): No package 'libfixbuf' found
libfixbuf
package configuration. Export PKG_CONFIG_PATH
to point to where libfixbuf.pc
was installed.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
(Adjust the path if you installed to a different prefix).
yaf: error while loading shared libraries
yaf: error while loading libraries: libairframe-2.3.0.so.4: cannot open shared object file: No such file or directory
/usr/local
), you may need to update the linker cache or set LD_LIBRARY_PATH
.
sudo ldconfig
or
export LD_LIBRARY_PATH=/usr/local/lib
couldn't open library "dnsplugin": file not found
LTDL_LIBRARY_PATH
environment variable to the plugin directory (default: /usr/local/lib/yaf
).
export LTDL_LIBRARY_PATH=/usr/local/lib/yaf
You may need to add this to your startup script if running yaf
as a service.
Failed to load certificate file: ... no start line
yaf terminating on error: Failed to load certificate file: error:0906D06C:PEM routines:PEM_read_bio:no start line
--tls-ca
and --tls-cert
must be in PEM format. DER format is not supported.Failed to load private key file: ... bad password read
yaf terminating on error: Failed to load private key file: error:0906A068:PEM routines:PEM_do_header:bad password read
YAF_TLS_PASS
environment variable was not set. Set the variable to the correct password.
export YAF_TLS_PASS="your-password-here"
Failed to load private key file: ... bad decrypt
yaf terminating on error: Failed to load private key file: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
YAF_TLS_PASS
environment variable was set to the incorrect password. Correct the password or remove it from the key file:
openssl rsa -in key.key -out key.key
--live dag
because libpcap
is not used.--silk
command-line flag must be used.destinationTransportPort
information element contains ICMP type and code for ICMP/ICMP6 flows. This is nonstandard and may not be interoperable with other IPFIX implementations.Please send bug reports, feature requests, and questions to netsa-help@cert.org.
This project is licensed under a GNU GPL 2.0-style license. Please see the LICENSE.txt
file for full terms.
@DISTRIBUTION_STATEMENT_BEGIN@
YAF 2.16
Copyright 2024 Carnegie Mellon University.
NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING
INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON
UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR
PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF
THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF
ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT
INFRINGEMENT.
Licensed under a GNU GPL 2.0-style license, please see LICENSE.txt or
contact permission@sei.cmu.edu for full terms.
[DISTRIBUTION STATEMENT A] This material has been approved for public
release and unlimited distribution. Please see Copyright notice for
non-US Government use and distribution.
This Software includes and/or makes use of Third-Party Software each
subject to its own license.
DM24-1063
@DISTRIBUTION_STATEMENT_END@