159 Commits

Author SHA1 Message Date
Michael Rash
23ef1d4e59 [libfko] Candidate build fix for Mac OS X 10.9 (closes #108)
Nikolay Kolev reported a build issue on Mac OS X 10.9 (Mavericks) where fwknop
copies of strlcpy() and strlcat() functions were conflicting with those that ship
with OS X 10.9.

The solution was to add a configure.ac check for strlcat() and strlcpy() and
wrap "#if !HAVE_..." checks around those functions.

A portion of the build errors looked like this:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in lib
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I ../common   -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all -fstack-protector -fPIE -D_FORTIFY_SOURCE=2 -MT base64.lo -MD -MP -MF .deps/base64.Tpo -c -o base64.lo base64.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I ../common -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all -fstack-protector -D_FORTIFY_SOURCE=2 -MT base64.lo -MD -MP -MF .deps/base64.Tpo -c base64.c  -fno-common -DPIC -o .libs/base64.o
In file included from base64.c:34:
In file included from ./fko_common.h:149:
./fko_util.h:56:9: error: expected parameter declarator
size_t  strlcat(char *dst, const char *src, size_t siz);
        ^
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
 #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
2013-11-12 21:36:14 -05:00
Michael Rash
90841762cf bumped version to 2.5.1 2013-07-25 20:33:37 -04:00
Michael Rash
37b624ac8b bump version to 2.5, minor fwknopd -S exit status update
This commit bumps the fwknop version to 2.5 and sets the libfko version to 2.0 to
signal incompatibility with older libfko versions.  Backwards compatibility is
maintained in SPA packet construction, but function prototypes in libfko-2.0 are
no longer compatible with older versions.

This commit also returns non-zero exit status under 'fwknopd --status' if there
is no existing fwknopd process.  This is better than always exiting with a zero
status regardless of whether fwknopd is already running or not, and adds a level
of scriptability to --status usage.  This change was suggested by George Herlin.
2013-06-27 21:21:10 -04:00
Michael Rash
b5c8146823 minor configure.ac typo fix for --help output 2013-05-30 22:42:13 -04:00
Damien Stuart
6ecf81b16e First round if refactoring to clean up header dependencies. 2013-03-02 17:03:20 -05:00
Damien Stuart
9c1b1d531d Merging fixes_for_2.0.4 into hmac_support 2013-02-25 21:46:09 -05:00
Damien Stuart
bf990821ff Fixed broken configure options for forcing a particular firewall type and path. 2013-02-24 18:09:13 -05:00
Michael Rash
47ea800889 merged in fwknop-2.0.4 changes 2013-01-18 17:25:16 -05:00
Michael Rash
0337ae9fb6 Merge branch 'master' of github.com:mrash/fwknop 2012-11-22 21:43:43 -05:00
Damien Stuart
5873df753a Tweaks to fix autoconf-related portability issues and autogen.sh reliability 2012-11-21 22:30:54 -05:00
Michael Rash
4cb5add328 revert 7db2d1e796bba7af393e2d5c40db65b95fcee066 (--disable-gpg arg) since --without-gpgme works properly 2012-11-21 21:49:16 -05:00
Damien Stuart
f499e30900 Tweaks to fix issues with building the lib and client under Windows. Added .fwknop.last support on Windows. Bumped the lib version to 0.0.4. Fixed bug in username detection code. Removed -Werror from AM_INIT_AUTOMAKE which prevented setting of CPPFLAG for the lib build in some circumstances. 2012-11-19 08:43:14 -05:00
Michael Rash
517f447028 bumped version to 2.0.4 2012-11-14 23:45:43 -05:00
Michael Rash
7db2d1e796 [client+server] Added --disable-gpg to the autoconf config
Added --disable-gpg to the autoconf ./configure script
via configure.ac.  This makes it easy to not have fwknop/fwknopd
link against libgpgme even if it is installed on the local system.
2012-10-31 21:37:55 -04:00
Michael Rash
f488a8d75d added '-Wformat -Wformat-security' to compile args - no associated warnings in current code 2012-10-30 22:03:40 -04:00
Michael Rash
e103bdf4b0 Updated build CFLAGS and LDFLAGS for PIE support similar to Debian hardening-includes
The Debian hardening-includes package sets CFLAGS and LDFLAGS as follows for PIE support:

_HARDENED_PIE_CFLAGS  := -fPIE
_HARDENED_PIE_LDFLAGS := -fPIE -pie

The configure.ac file has been updated to conform to the above.
2012-10-30 21:40:21 -04:00
Michael Rash
55fa4841f2 another merge from master 2012-09-03 22:32:44 -04:00
Michael Rash
40ac28df21 bump version to 2.0.3 2012-09-03 22:23:48 -04:00
Michael Rash
5daaca01ea merged master 2.0.3 changes 2012-08-31 21:43:55 -04:00
Michael Rash
a60f05ad44 file permissions and client buffer overflow fix
- [client+server] Fernando Arnaboldi from IOActive found that strict
filesystem permissions for various fwknop files are not verified.  Added
warnings whenever permissions are not strict enough, and ensured that
files created by the fwknop client and server are only set to user
read/write.
- [client] Fernando Arnaboldi from IOActive found a local buffer overflow
in --last processing with a maliciously constructed ~/.fwknop.run file.
This has been fixed with proper validation of .fwknop.run arguments.
2012-08-29 22:21:43 -04:00
Michael Rash
6392e5891e Merge branch 'master' into hmac_support 2012-08-18 16:26:06 -04:00
Michael Rash
f7e84da340 fwknop-2.0.2 release 2012-08-18 15:03:04 -04:00
Michael Rash
8d6bc05295 merged from master 2012-08-17 21:19:52 -04:00
Michael Rash
37950df66f bumped version to fwknop-2.0.2-pre3 2012-08-14 22:35:02 -04:00
Michael Rash
72229b5f46 bumped version to fwknop-2.0.2-pre2 2012-08-11 09:21:49 -04:00
Michael Rash
c374a7df27 Merge branch 'master' into hmac_support 2012-08-05 13:26:43 -04:00
Michael Rash
4cde31584f bumped version to 2.0.2-pre1 2012-08-03 22:16:22 -04:00
Michael Rash
c6b674617c completed merge from master after fwknop-2.0.1 release 2012-07-24 16:19:48 -04:00
Michael Rash
9fe6dc7d6f bumped version to fwknop-2.0.1 2012-07-23 21:58:14 -04:00
Michael Rash
e68c561c40 bumped version to fwknop-2.0.1-pre5 2012-07-23 21:24:29 -04:00
Damien Stuart
d5568cb1a1 Bumped version to 2.0.1-pre4 2012-07-14 20:54:05 -04:00
Michael Rash
c57f4a82b7 bumped version to fwknop-2.0.1-pre3 2012-07-12 22:19:41 -04:00
Michael Rash
e5004dc829 Merge branch 'master' into crypto_update 2012-07-10 08:23:16 -04:00
Michael Rash
86fde0d603 bumped version to 2.0.1-pre2 2012-07-09 22:58:35 -04:00
Michael Rash
06d8f118aa bumped version to 2.0.1-pre1 2012-07-09 16:32:10 -04:00
Michael Rash
10d380d193 Test suite support for function coverage testing via gcov
Added --enable-profile-coverage to the configure script to have the fwknop
binaries compiled with gcc profiling support in order to see which functions
get executed by the test suite via gcov.  The last test executed by the test
suite under --enable-profile-coverage contains all fwknop functions that
were not executed under the test run (function execution totals are
cumlative).
2012-06-14 20:43:57 -04:00
Michael Rash
9dae73d972 added FKO_CHECK_COMPILER_ARG_LDFLAGS_ONLY to fix ro-relocations and immediate binding protection compliation warnings on FreeBSD 2012-01-02 15:26:42 -05:00
Damien S. Stuart
aff8832d66 Refactored configure.ac to use a custom macro for compiler flag checks.
Set version to 2.0 (non-release candidate).
Minor typo fixes.
2011-12-29 14:20:18 -05:00
Michael Rash
690fe25fa4 added CREDITS file, bumped software version, added ChangeLog files 2011-12-05 21:14:31 -05:00
Michael Rash
0b8c489075 Added read-only relocations and immediate bindings
Commit 4248b2687054b38e79e2ab9eecf71e5b299172f4 removed read-only relocations
and immediate bindings for FreeBSD systems (and the same was done for OpenBSD
systems too).  This commit adds these security features back in as linker
options by only changing LDFLAGS as opposed to also adding the corresponding
flags to CFLAGS.  The end result is that the following errors are fixed:

gcc: -z: linker input file unused because linking not done
gcc: relro: linker input file unused because linking not done
2011-09-08 23:44:50 -04:00
Michael Rash
0649ef924a PF support on OpenBSD in progress, fwknop --fw-list now works
This is the first commit that has fwknopd interact with the PF firewall on
OpenBSD (via fwknopd --fw-list to show any active fwknopd rules).
2011-08-27 10:57:17 -04:00
Michael Rash
dcf2d94bf6 Added autoconf check for pf firewalls
On OpenBSD systems fwknop now checks for pf firewalls via autoconf.  The next
step will be to fill in support for pf via the C code.
2011-08-24 23:55:36 -04:00
Michael Rash
649b7a88c1 Disabled read-only relocations and immediate binding compiler protections
Similarly to FreeBSD systems, gcc throws the following warnings with read-only
relcations and immediate binding protections - disbabled for now:

gcc: -z: linker input file unused because linking not done
gcc: relro: linker input file unused because linking not done
gcc: -z: linker input file unused because linking not done
gcc: now: linker input file unused because linking not done
2011-08-24 23:17:45 -04:00
Michael Rash
17beb2d348 bumped version to 2.0.0rc4 2011-08-21 14:06:41 -04:00
Michael Rash
04afd2846d On FreeBSD, made gpgme header path inclusion optional
If gpgme is installed on FreeBSD systems it appears that
-I/usr/local/include/gpgme must be added to the include path, but this change
only adds the path if gpgme is installed and going to be used.
2011-08-20 22:02:21 -04:00
Michael Rash
6eeb413094 Fixed a few minor compiler warnings on FreeBSD
This commit fixes a few warnings about possible uninitialized and unused
variables.
2011-08-20 13:33:00 -04:00
Michael Rash
4248b26870 On FreeBSD disable read-only relocations and immediate binding protections
gcc on FreeBSD generates the following errors when the -Wl,-z,relro -Wl,-z,now
flags are used:

gcc: -z: linker input file unused because linking not done
gcc: relro: linker input file unused because linking not done
gcc: -z: linker input file unused because linking not done
gcc: now: linker input file unused because linking not done
2011-08-20 13:19:33 -04:00
Michael Rash
637f7a4c93 Added -Wall for all gcc warnings during compile
Enable gcc compilation to include -Wall for all warnings (can be disabled
with --disable-wall to ./configure).
2011-08-19 21:14:24 -04:00
Michael Rash
bf59c2688f Bug fix for ./configure args to disable compile time security options
The ./configure script would generate the following error for the attempted
use of the --without-stackprotector (and other related options like
--without-pie):

configure: WARNING: unrecognized options: --without-stackprotect
2011-08-19 20:51:50 -04:00
Michael Rash
df96e42c51 Added stack protection, PIE, fortify source, etc.
Added various security options that can be enabled at compile time.  These
options include everything that the "hardening-check" script written by Kees
Cook checks for.  After this change, the hardening-check script produces the
following output against the fwknopd binary:

$ hardening-check server/.libs/fwknopd
server/.libs/fwknopd:
 Position Independent Executable: yes
 Stack protected: yes
 Fortify Source functions: yes
 Read-only relocations: yes
 Immediate binding: yes

One of the compile outputs (for example) that shows the new options is:

/bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -fstack-protector-all -fPIE -pie -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -MT fko_decode.lo -MD -MP -MF .deps/fko_decode.Tpo -c -o fko_decode.lo fko_decode.c

From the hardening-check man page, here is a description of each of these
options:

NAME
       hardening-check - check binaries for security hardening features

SYNOPSIS
       Examine a given set of ELF binaries and check for several security
       hardening features, failing if they are not all found.

DESCRIPTION
       This utility checks a given list of ELF binaries for several security
       hardening features that can be compiled into an executable.  These
       features are:

       Position Independent Executable
               This indicates that the executable was built in such a way
               (PIE) that the "text" section of the program can be relocated
               in memory.  To take full advantage of this feature, the
               executing kernel must support text Address Space Layout
               Randomization (ASLR).

       Stack Protected
               This indicates that the executable was compiled with the
               gcc(1) option -fstack-protector.  The program will be
               resistant to have its stack overflowed.

       Fortify Source functions
               This indicates that the executable was compiled with
               -D_FORTIFY_SOURCE=2 and -O2 or higher.  This causes certain
               unsafe glibc functions with their safer counterparts (e.g.
               strncpy instead of strcpy).

       Read-only relocations
               This indicates that the executable was build with -Wl,-z,relro
               to have ELF markings (RELRO) that ask the runtime linker to
               mark any regions of the relocation table as "read-only" if
               they were resolved before execution begins.  This reduces the
               possible areas of memory in a program that can be used by an
               attacker that performs a successful memory corruption exploit.

       Immediate binding
               This indicates that the executable was built with -Wl,-z,now
               to have ELF markings (BIND_NOW) that ask the runtime linker to
               resolve all relocations before starting program execution.
               When combined with RELRO above, this further reduces the
               regions of memory available to memory corruption attacks.
2011-08-17 20:36:28 -04:00