Sisyphus repository
Last update: 25 january 2021 | SRPMs: 17782 | Visits: 20134976
en ru br
ALT Linux repos

Group :: Monitoring
RPM: passivedns

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1

Name: passivedns
Version: 1.2.1
Release: alt2
Summary: A network sniffer that logs all DNS server replies for use in a passive DNS setup
License: GPLv2
Group: Monitoring

Source: %name-%version.tar
Source2: %name.init
Source3: %{name} at .service

Patch1: %name-%version-alt.patch

BuildRequires: libpcap-devel libldns-devel
BuildRequires: libjansson-devel
BuildRequires: perl( perl(Date/ perl( perl(Time/

A tool to collect DNS records passively to aid Incident handling, Network
Security Monitoring (NSM) and general digital forensics.

PassiveDNS sniffes traffic from an interface or reads a pcap-file and outputs
the DNS-server answers to a log file. PassiveDNS can cache/aggregate duplicate
DNS answers in-memory, limiting the amount of data in the logfile without
loosing the essens in the DNS answer.

%package daemon
Summary: Daemon for passive DNS
Group: Monitoring
Requires: %name = %EVR

%description daemon
Daemon for %name

%package tools
Summary: Tools for passive DNS
Group: Monitoring

%description tools
A tools for work with %name data

%patch1 -p1

find . -type f | xargs sed -i \
-e "s|%_logdir/passivedns.log|%_logdir/%name/passivedns.log|g" \
-e "s|%_logdir/passivedns.stats|%_logdir/%name/passivedns.stats|g" \
-e "s|%_logdir/passivedns-run.log|%_logdir/%name/passivedns-run.log|g" \
-e "s|%_logdir/passivedns-alert.log|%_logdir/%name/passivedns-alert.log|g" \

%configure \
--enable-json \


install -pD -m755 src/%name %buildroot%_sbindir/%name
install -pD -m755 tools/ %buildroot%_bindir/
install -pD -m755 tools/ %buildroot%_bindir/
install -pD -m755 %SOURCE2 %buildroot%_initdir/%name

mkdir -p %buildroot%_unitdir
install -pD -m755 %SOURCE3 %buildroot%_unitdir/%{name} at .service

mkdir -p %buildroot%_logdir/%name
mkdir -p %buildroot%_sharedstatedir/%name
mkdir -p %buildroot%_sysconfdir/sysconfig
mkdir -p %buildroot%_logrotatedir

cat > %buildroot%_sysconfdir/sysconfig/%name  <<EOF
# -i <iface>      Network device <iface> (default: eth0).
# -l <file>       Name of the logfile (default: %_logdir/%name/passivedns.log).
# -b 'BPF'        Berkley Packet Filter (default: 'port 53').
# -S <mem>        Soft memory limit in MB (default: 256).
# -C <sec>        Seconds to cache DNS objects in memory (default 43200).
# -P <sec>        Seconds between printing duplicate DNS info (default 86400).
# -X <flags>      Manually set DNS RR Types to care about(Default -X 46CDNPRS).

OPTIONS='-i lo'


cat << EOF > %buildroot%_logrotatedir/%name
%_logdir/%name/%name.log {
   create 644 root _%name
   rotate 5


/usr/sbin/groupadd -r -f _%name
/usr/sbin/useradd -r -g _%name -d %_sharedstatedir/%name -s /dev/null -n -c "DNS network sniffer" _%name >/dev/null 2>&1 ||:

%post daemon
%post_service %name

%preun daemon
%preun_service %name

%doc README doc tools/README.skip_white_black-list.txt www
%dir %attr(3770,root,_%name) %_logdir/%name

%files daemon
%dir %_sharedstatedir/%name
%_unitdir/%{name} at .service

%files tools


Full changelog you can see here

design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin