Commit Graph

183 Commits

Author SHA1 Message Date
W.C.A. Wijngaards
e9810e1154 - For #352: contrib/metrics.awk for Prometheus style metrics output. 2020-11-26 11:00:48 +01:00
David Runge
c48f01445e
Add AF_NETLINK to set of allowed socket address families
contrib/unbound{,_portable}.service.in:
With the changes introduced in f6a527c25a
it is now necessary to also allow access to the AF_NETLINK socket
address family to be able to get information from interfaces.

Without the AF_NETLINK address family the systemd service errors with:

```
error: failed to list interfaces: getifaddrs: Address family not
supported by protocol
```

Fixes #350
2020-11-21 14:10:39 +01:00
W.C.A. Wijngaards
afbc7bb4fe - Fix #296: systemd nss-lookup.target is reached before unbound can
successfully answer queries. Changed contrib/unbound.service.in.
2020-08-31 11:50:11 +02:00
W.C.A. Wijngaards
50091d49ea - contrib/aaaa-filter-iterator.patch file renewed diff content to
apply cleanly to the current coderepo for the current code version.
2020-08-05 16:33:48 +02:00
Christian Göttsche
c6ff5558de munin plugin: always exit 0 in autoconf
The autoconf operation should always exit 0, also in case the answer in "no",
see https://guide.munin-monitoring.org/en/latest/develop/plugins/plugin-concise.html#autoconf
2020-07-23 16:04:26 +02:00
W.C.A. Wijngaards
6a13b51bed - Fix contrib/fastrpz.patch to apply cleanly. 2020-07-20 10:55:13 +02:00
W.C.A. Wijngaards
477bb1a6ff - Fix contrib/fastrpz.patch to apply cleanly. 2020-07-20 10:53:30 +02:00
Robert Edmonds
c93b4b3158 contrib/libunbound.pc.in: Do not use "Requires:"
This commit updates contrib/libunbound.pc.in to remove the "Requires:"
directive and move its contents to "Requires.private:".

The pkg-config manpage documents the Requires/Libs fields as follows:

   Requires:
          This is a comma-separated list of packages that are required  by
          your package. Flags from dependent packages will be merged in to
          the flags reported for your package. Optionally, you can specify
          the  version  of the required package (using the operators =, <,
          >, >=, <=); specifying a version allows  pkg-config  to  perform
          extra  sanity  checks. You may only mention the same package one
          time on the Requires: line. If the version of a package  is  un‐
          specified, any version will be used with no checking.

   Requires.private:
          A list of packages required by this package. The difference from
          Requires is that the packages listed under Requires.private  are
          not  taken into account when a flag list is computed for dynami‐
          cally linked executable (i.e., when --static was not specified).
          In  the  situation where each .pc file corresponds to a library,
          Requires.private shall be used exclusively to specify the depen‐
          dencies between the libraries.

   Libs:  This  line  should give the link flags specific to your package.
          Don't add any flags for required packages; pkg-config  will  add
          those automatically.

   Libs.private:
          This line should list any private libraries in use.  Private li‐
          braries are libraries which are not  exposed  through  your  li‐
          brary,  but  are needed in the case of static linking. This dif‐
          fers from Requires.private in that it references libraries  that
          do not have package files installed.

In other words:

1) "Requires:" should specify the name of .pc packages that are required
to be installed to compile and dynamically link against libunbound. This
corresponds to needing the -dev (or -devel) package containing the .pc
file to be installed on the system. Since libunbound's header files
actually do not have any includes on any other library's headers, the
"Requires:" directive should be empty.

2) "Requires.private:" specifies the name of .pc packages that
correspond to libraries that are required to be installed to statically
link against libunbound. E.g., if libunbound.a has undefined symbols
event_* that are in libevent.a, statically linking against libunbound.a
requires statically linking libevent.a, and because libevent has a .pc
file, this means "libevent" should appear in libunbound.pc's
"Requires.private:" directive.

3) "Libs:" specifies the link flags needed to link against libunbound,
only, not including any dependencies.

4) "Libs.private:" specifies the link flags needed to statically link
against libraries that libunbound depends on that do not have .pc files.
I think it's possible for unbound's build system to actually declare
link flags under "Libs.private:" for some libraries that do have .pc
files (e.g. libcrypto/-lcrypto, libssl/-lssl, for OpenSSL) but in
practice this appears to be harmless.

Given #1 above that libunbound does not have any header dependencies
against any other packages it does not appear that "Requires:" is needed
at all. See https://bugs.debian.org/958331 for an example of a bug
report that this causes. We should not need to install the nettle-dev
package only for building binaries that compile against the libunbound
headers and link against the libunbound library.
2020-05-25 17:58:37 -04:00
George Thessalonikefs
21cd836e82 - Update contrib/aaaa-filter-iterator.patch for the recent
generate_sub_request() change and to apply cleanly.
2020-05-25 11:49:48 +02:00
George Thessalonikefs
042ba77c63 - Keep 'arm64-v8a' support for Travis android builds. 2020-03-25 13:58:57 +01:00
Jeffrey Walton
c228e0ac16
Fix OpenSSL corss-compaile warning
warning: '__ANDROID_API__' macro redefined
2020-03-25 05:00:35 -04:00
W.C.A. Wijngaards
2889be5e90 - Travis fix for ios by omitting tools from install. 2020-03-24 10:23:00 +01:00
Jeffrey Walton
20dbd6339e
Sync with upstream 2020-03-17 06:32:13 -04:00
Jeffrey Walton
135fdd5839
Add iOS testing to Travis 2020-03-05 06:44:13 -05:00
Jeffrey Walton
a53c452f25
Test OpenSSL -pie changes
See https://github.com/openssl/openssl/issues/11237
2020-03-03 16:25:25 -05:00
George Thessalonikefs
0c51af0fb4 - Make contrib/android/install_openssl.sh Code of Conduct compliant. 2020-03-02 16:12:51 +01:00
George Thessalonikefs
f4eaf6c0ff - Merge PR #174: Add Android to Travis testing, by noloader.
- Move android build scripts to contrib/ and allow android tests to fail.
2020-03-02 15:17:59 +01:00
glitsj16
42ee37847f
Fix typo 2020-02-22 01:16:11 +00:00
W.C.A. Wijngaards
ec0d6f196e - Updated contrib/unbound_smf23.tar.gz with Solaris SMF service for
Unbound from Yuri Voinov.
2020-02-20 09:17:24 +01:00
W.C.A. Wijngaards
42fdfd8121 - contrib/drop2rpz: perl script that converts the Spamhaus DROP-List
in RPZ-Format, contributed by Andreas Schulze.
2020-02-17 10:09:46 +01:00
W.C.A. Wijngaards
6e13c6f401 - Fix contrib/fastrpz.patch to apply cleanly. 2020-02-12 11:24:59 +01:00
Wouter Wijngaards
e4e00db42e
Merge pull request #151 from Maryse47/systemd_fix
Fixes for systemd units
2020-01-30 14:09:29 +01:00
W.C.A. Wijngaards
20a2574da1 - Update contrib/fastrpz.patch for clean diff with current code. 2020-01-30 13:05:35 +01:00
Maryse47
9aa4b5a7a6 unbound.service.in: don't write pidfile at start
Pidfiles aren't needed while running unbound through systemd.
The PID of the unbound daemon can still be obtained with:
'systemctl show --property MainPID --value unbound'.

While disabling pidfiles we can also drop CAP_CHOWN and writable
/run directory.
2020-01-28 19:03:18 +01:00
Maryse47
939cf38576 unbound.service.in: drop CAP_IPC_LOCK
CAP_IPC_LOCK controls whether a process can lock pages into physical
memory (for instance to prevent passwords or private keys from
being swapped to disk), e.g. mmap() with the MAP_LOCKED flag or
shmctl() with the SHM_LOCK command, neither of which seem to be
used by unbound.
2020-01-28 18:42:41 +01:00
Maryse47
c0789a8785 unbound.service.in: allow CAP_CHOWN
CAP_CHOWN is needed for changing onwership of pidfile before
dropping privileges and truncate pidfile on exit.
2020-01-27 18:31:10 +01:00
Ralph Dolmans
1d0fc2d179
Merge pull request #148 from pettai/morestats
Add some TLS stats to unbound_munin_
2020-01-27 16:04:00 +01:00
Ralph Dolmans
7e200ce90e
Merge branch 'master' into edmonds/libbsd-support 2020-01-27 15:37:33 +01:00
Maryse47
cfce0a5e60 unbound.service.in: add StateDirectory
State directory will be created under /var/lib/unbound and will be
useful for writing various files managed at runtime like trust
anchors updates there instead of in ConfigureDirectory which could
be made read-only next. For this chroot needs to be disabled.
2020-01-27 13:46:31 +01:00
Maryse47
72bfa5a48c Move unbound_nochroot.service to unbound_portable.service
The real purpose of this service is to make it work with
https://systemd.io/PORTABLE_SERVICES/ which are incompatible with
chroot workarounds from original unbound.service.

The service content is identical to unbound.service with exception
for chroot related rules which were modified as needed.
2020-01-27 13:44:47 +01:00
Maryse47
1464bedce2 unbound.service.in: add RuntimeDirectory and ConfigurationDirectory
Adding 'RuntimeDirectory' is needed when pidfile path is set to
subdirectory under /run.

Adding ConfigurationDirectory may help in some non-standard setups.

Also add more descriptions about used rules to avoid user confusion
about they meaning and purpose.
2020-01-27 13:44:46 +01:00
W.C.A. Wijngaards
0ae684830a Merge branch 'master' of github.com:NLnetLabs/unbound 2020-01-27 09:29:18 +01:00
Robert Edmonds
394f9403df contrib/libunbound.pc.in: Embed the correct crypto dependencies
This commit removes the hardcoded dependency in the libunbound
pkg-config .pc file on the libcrypto and libssl modules and instead
populates the .pc file based on which crypto library was selected at
configure time.

Note that the .pc file specifies pkg-config module names for the
"Requires" line and this can vary from the library filename (e.g. "nss"
is the pkg-config module name vs. "nss3" being the library name).
2020-01-26 22:30:31 -05:00
Robert Edmonds
36b5d74fc4 contrib/libunbound.pc.in: Only specify -lunbound for Libs
According to the pkg-config manpage, the "Libs" line in a .pc file
should give the link flags "specific to your package", and specifically
says not to include link flags for dependencies:

    Libs:  This line should give the link flags specific to your
           package.  Don't add any flags for required packages;
           pkg-config will add those automatically.
2020-01-26 22:06:58 -05:00
Steven Chamberlain
f6b4f2a149 Allow use of libbsd functions with configure option --with-libbsd
Add a new configure option `--with-libbsd', which allows to use libbsd's
portable implementations of:

    strlcpy strlcat arc4random arc4random_uniform reallocarray

instead of the embedded code copies in contrib/, which will be
difficult to maintain in the long term.

Also patch util/random.c so that, when building with libbsd and without
OpenSSL, arc4random can still be used as the PRNG.  Otherwise, building
with libnettle would need a kernel-specific getentropy implementation,
and libbsd does not export one.

[edmonds@debian.org: Imported patch description from BTS, refreshed
patch against Unbound 1.9.6.]
2020-01-26 19:09:43 -05:00
W.C.A. Wijngaards
61456ff81d Changelog and contrib/README note for PR#150.
- Merge PR#150 from Frzk: Systemd unit without chroot.  It add
  contrib/unbound_nochroot.service.in, a systemd file for use with
  chroot: "", see comments in the file, it uses systemd protections
  instead.
2020-01-23 16:16:52 +01:00
François KUBLER
016f742f16 Added a new unit file to run unbound with systemd and without chroot.
See https://github.com/NLnetLabs/unbound/pull/149
2020-01-23 15:46:53 +01:00
frpet
05cb07093d Update unbound_munin_
Add TLS (DoT) counters
2020-01-23 08:23:16 +01:00
Maryse47
89d98564c3
unbound.service.in: stop binding pidfile inside chroot dir
Apparently pidfile isn't used inside chroot and binding it may cause some weird failures with older systemd.

Fixes https://github.com/NLnetLabs/unbound/issues/138
2020-01-08 15:21:22 +00:00
W.C.A. Wijngaards
ff7d68ca53 - unbound-fuzzers.tar.bz2: three programs for fuzzing, that are 1:1
replacements for unbound-fuzzme.c that gets created after applying
  the contrib/unbound-fuzzme.patch.  They are contributed by
  Eric Sesterhenn from X41 D-Sec.
2019-12-05 09:10:49 +01:00
W.C.A. Wijngaards
6e8b4a7796 - update contrib/fastrpz.patch to apply more cleanly. 2019-12-04 11:41:13 +01:00
W.C.A. Wijngaards
f887552763 - Fix Config Injection in create_unbound_ad_servers.sh,
reported by X41 D-Sec.
2019-11-20 12:02:19 +01:00
W.C.A. Wijngaards
d4c904d091 - contrib/fastrpz.patch updated to apply for current code. 2019-11-13 11:40:56 +01:00
W.C.A. Wijngaards
e6a179e27a - drop-tld.diff: adds option drop-tld: yesno that drops 2 label
queries, to stop random floods.  Apply with
  patch -p1 < contrib/drop-tld.diff and compile.
  From Saksham Manchanda (Secure64).  Please note that we think this
  will drop DNSKEY and DS lookups for tlds and hence break DNSSEC
  lookups for downstream clients.
2019-10-22 10:32:37 +02:00
Pascal Ernster
11f22074a9
Drop CAP_KILL, use + prefix for ExecReload= instead
CAP_KILL seems a bit too much privileges for the sole purpose of being able to make ExecReload= work.
Use the + prefix on ExecReload= instead to run "/bin/kill -HUP $MAINPID" with full privileges, ignoring the restrictions from CapabilityBoundingSet=.

See https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart= for further details about the + prefix in ExecReload=.
2019-09-26 08:41:37 +00:00
sam-lunt
6943cab670
Add kill capability to systemd service file
The ExecReload command calls kills on a process owned by the unbound user (or whatever user is configured). To do so, it needs the CAP_KILL capability.
2019-09-21 14:36:12 -05:00
Maryse47
acdd4058d2
unbound.service.in: do not fork into the background
This is needed when unbound config doesn't set "do-daemonize: no" by itself otherwise starting service fails with:
 systemd[1]: unbound.service: Got notification message from PID <PID>, but reception only permitted for main PID which is currently not known

https://github.com/NLnetLabs/unbound/blob/release-1.9.3/doc/example.conf.in#L236
2019-09-20 10:07:37 +00:00
Wouter Wijngaards
e1e71eac3e
Merge pull request #81 from Maryse47/urandom
Consistently use /dev/urandom instead of /dev/random in scripts and docs
2019-09-20 07:44:22 +02:00
Pascal Ernster
ae2d5276d2
Downgrade CAP_NET_ADMIN to CAP_NET_RAW in unbound.service
Since kernel 3.2, CAP_NET_RAW instead of CAP_NET_ADMIN is sufficient to allow for the usage of the IP_TRANSPARENT socket option. CAP_NET_ADMIN allows far more mayhem then CAP_NET_RAW, so prefer the safer, more restrictive solution.
2019-09-20 04:47:56 +00:00
Maryse47
ce0e9bef45 Consistently use /dev/urandom instead of /dev/random in scripts and docs
Unbound code call /dev/urandom (see below)  but various docs and scripts
mention /dev/random which may be confusing.

https://github.com/NLnetLabs/unbound/blob/release-1.9.3/compat/arc4random.c#L107
https://github.com/NLnetLabs/unbound/blob/release-1.9.3/compat/getentropy_linux.c#L251
https://github.com/NLnetLabs/unbound/blob/release-1.9.3/compat/getentropy_osx.c
https://github.com/NLnetLabs/unbound/blob/release-1.9.3/compat/getentropy_solaris.c#L116
2019-09-19 17:40:49 +02:00