205 Commits

Author SHA1 Message Date
Michael Rash
dc8a034a4d merged usage() information from master 2012-07-08 22:00:13 -04:00
Michael Rash
bc2e41fd47 added unique function names to --enable-valgrind suspect functions test 2012-07-08 21:21:36 -04:00
Michael Rash
9497044f24 added new test in --enable-valgrind mode to collect suspect functions 2012-07-08 15:30:35 -04:00
Michael Rash
6b3e5ef3c2 Added a test for a dual-usage key in access.conf 2012-07-08 08:35:50 -04:00
Michael Rash
92e403a242 added initial HMAC-SHA256 support for the client side 2012-07-02 23:50:45 -04:00
Michael Rash
3095f0ee43 Added key generation support with --key-gen
Added --key-gen to allow KEY_BASE64 and HMAC_KEY_BASE64 keys to be created from
reading random data from /dev/random.  These keys can be placed within server
access.conf files and corresponding client .fwknoprc files for SPA
communications.  The HMAC key is not used yet with this commit, but that is
coming.
2012-06-27 23:06:17 -04:00
Michael Rash
20e3e3b6e5 added test for client --show-last functionality 2012-06-23 15:41:58 -04:00
Michael Rash
c6a2680be2 added test for invalid SOURCE access lines 2012-06-17 13:57:06 -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
6dbe523052 added test suite support for AES CTR, OFB, CFB, and ECB encryption modes 2012-02-10 15:09:27 -05:00
Michael Rash
280b8c56f0 switched CBC mode test (which is the default Rjindael encryption mode) to ECB mode 2012-02-08 14:29:33 -05:00
Michael Rash
53a6d72cd2 added test suite support for CBC mode Rijndael tcp/22 test 2012-01-29 17:31:12 -05:00
Michael Rash
6f6a9d727d minor test suite update to look for linker warnings in a more generic way 2012-01-02 15:25:35 -05:00
Michael Rash
1bd2592d15 minor test suite addition to check for linker input file warnings 2012-01-02 15:10:55 -05:00
Michael Rash
3d0ceccf65 added local_spa.key file 2011-12-05 22:20:39 -05:00
Michael Rash
9b7c1a8ce6 Added FORCE_NAT mode to the access.conf file
This commit adds a new configuration variable "FORCE_NAT" to the access.conf
file:

    For any valid SPA packet, force the requested connection to be NAT'd
    through to the specified (usually internal) IP and port value.  This is
    useful if there are multiple internal systems running a service such as
    SSHD, and you want to give transparent access to only one internal system
    for each stanza in the access.conf file.  This way, multiple external
    users can each directly access only one internal system per SPA key.

This commit also implements a few minor code cleanups.
2011-11-30 20:51:19 -05:00
Michael Rash
b280f5cde0 Added access stanza expiration feature, multiple access stanza bug fix
This commit does two major things:

1) Two new access.conf variables are added "ACCESS_EXPIRE" and
"ACCESS_EXPIRE_EPOCH" to allow access stanzas to be expired without having
to modify the access.conf file and restart fwknopd.

2) Allow an access stanza that matches the SPA source address to not
automatically short circuit other stanzas if there is an error (such as when
there are multiple encryption keys involved and an incoming SPA packet is
meant for, say, the second stanza and the first therefore doesn't allow
proper decryption).
2011-11-28 22:03:21 -05:00
Michael Rash
9e884e9759 added SPA packet aging tests 2011-11-22 22:56:48 -05:00
Michael Rash
644b9e9432 added test for --test mode in the fwknop client 2011-11-22 22:40:26 -05:00
Michael Rash
05b189ff4f added DNAT mode tests, minor memory leak fix in NAT mode, added fwknopd check for ENABLE_IPT_FORWARDING variable before attempting NAT access 2011-11-22 22:13:27 -05:00
Michael Rash
dd2deec73d added tests for various access.conf variables 2011-11-18 23:23:50 -05:00
Michael Rash
63498c9032 added IP/subnet match tests, added --Anonymize-results mode 2011-11-17 21:17:50 -05:00
Michael Rash
34cd0c7a78 simplified the client/server interaction code, started on IP filtering tests, added spoof username tests 2011-11-15 21:45:51 -05:00
Michael Rash
3d94aaa920 minor test wording consolidation 2011-11-10 22:54:25 -05:00
Michael Rash
9ebd55f522 remove CMD timestamps for --diff mode 2011-11-10 22:33:00 -05:00
Michael Rash
9e19b8bc26 added --diff mode to the test suite to compare results from one execution to the next 2011-11-06 13:51:23 -05:00
Michael Rash
a5a3c06ef2 consolidated several test functions into a single generic_exec() function 2011-11-04 23:46:31 -04:00
Michael Rash
f41a26b389 Fixed fwknopd memory leak, several other fixes and updates
This commit does several things.  First, a memory leak in fwknopd has been
fixed by ensuring to free access.conf stanzas.  This bug was found with the
new test suite running in --enable-valgrind mode.  Here is what some of the
valgrind output looked like to find the leak:

==19217== 11 bytes in 1 blocks are indirectly lost in loss record 3 of 5
==19217==    at 0x4C2815C: malloc (vg_replace_malloc.c:236)
==19217==    by 0x52F6B81: strdup (strdup.c:43)
==19217==    by 0x10FC8B: add_acc_string (access.c:49)
==19217==    by 0x1105C8: parse_access_file (access.c:756)
==19217==    by 0x10B79B: main (fwknopd.c:194)
==19217==
==19217== 16 bytes in 1 blocks are indirectly lost in loss record 4 of 5
==19217==    at 0x4C27480: calloc (vg_replace_malloc.c:467)
==19217==    by 0x10FEC0: add_source_mask (access.c:88)
==19217==    by 0x110100: expand_acc_source (access.c:191)
==19217==    by 0x1104B0: parse_access_file (access.c:500)
==19217==    by 0x10B79B: main (fwknopd.c:194)
==19217==
==19217== 183 (152 direct, 31 indirect) bytes in 1 blocks are definitely lost in loss record 5 of 5
==19217==    at 0x4C27480: calloc (vg_replace_malloc.c:467)
==19217==    by 0x1103E4: parse_access_file (access.c:551)
==19217==    by 0x10B79B: main (fwknopd.c:194)
==19217==
==19217== LEAK SUMMARY:
==19217==    definitely lost: 152 bytes in 1 blocks
==19217==    indirectly lost: 31 bytes in 3 blocks
==19217==      possibly lost: 0 bytes in 0 blocks
==19217==    still reachable: 8 bytes in 1 blocks
==19217==         suppressed: 0 bytes in 0 blocks

Second, this commit changes how fwknopd acquires packet data with
pcap_dispatch() - packets are now processed within the callback function
process_packet() that is provided to pcap_dispatch(), the global packet
counter is incremented by the return value from pcap_dispatch() (since this is
the number of packets processed per pcap loop), and there are two new
fwknopd.conf variables PCAP_DISPATCH_COUNT and PCAP_LOOP_SLEEP to control the
number of packets that pcap_dispatch() should process per loop and the number
of microseconds that fwknopd should sleep per loop respectively.  Without this
change, it was fairly easy to cause fwknopd to miss packets by creating bursts
of packets that would all be processed one at time with the usleep() delay
between each.  For fwknopd deployed on a busy network and with a permissive
pcap filter (i.e. something other than the default that causes fwknopd to look
at, say, TCP ACK's), this change should help.

Third, the criteria that a packet must reach before data copying into the
buffer designed for SPA processing has been tightened.  A packet less than
/greater than the minimum/maximum expected sizes is ignored before data is
copied, and the base64 check is done as well.
2011-11-03 22:15:19 -04:00
Michael Rash
97a8d751c1 added complete SPA cycle tests for tcp ports 23 and 9418 (git), and for udp 53 dns 2011-10-30 22:14:00 -04:00
Michael Rash
8e4b45dd56 minor looping criteria update for valgrind tests 2011-10-29 23:48:42 -04:00
Michael Rash
ea3e817871 [test-suite] added the ability to run all fwknop tests through valgrind 2011-10-29 16:59:57 -04:00
Michael Rash
dbbbe60fe4 added stack protection detection for OpenBSD systems 2011-10-28 22:59:52 -04:00
Michael Rash
2e96ece4b0 Update to ensure libfko.so path is detected properly on OpenBSD 2011-10-28 22:42:27 -04:00
Michael Rash
464dbe95d0 Update to print all firewall commands in --verbose mode
This commit makes it easier to determine exactly which commands fwknopd
runs in --verbose mode when interacting with the underlying firewall.
This commit also adds --verbose --verbose mode to the test suite.
2011-10-27 21:51:55 -04:00
Michael Rash
1c6fc0f3f8 update to detect loopback interface 2011-10-24 20:48:56 -04:00
Michael Rash
c9860811f5 added LD_LIBRARY_PATH to all fwknop/fwknopd commands to make manual command execution easier 2011-10-22 22:29:27 -04:00
Michael Rash
50bcc537ee added digest cache validation after GPG tests 2011-10-22 22:06:00 -04:00
Michael Rash
1b8606461c minor update to match include/exclude criteria on the whole test message 2011-10-22 21:54:22 -04:00
Michael Rash
9e3a4b4c92 extended packet validity tests in GPG mode 2011-10-22 21:29:44 -04:00
Michael Rash
09e6ed1405 added first GPG complete cycle SPA test 2011-10-22 16:48:30 -04:00
Michael Rash
e4f4ee7825 added test to validate digest.cache structure 2011-10-22 14:25:56 -04:00
Michael Rash
266150218a added -P bpf test for complete SPA cycle over non standard SPA port 2011-10-22 10:57:25 -04:00
Michael Rash
0ab39a64a5 added -P bpf filter test 2011-10-22 10:48:37 -04:00
Michael Rash
6848983b47 added Rijndael SPA validity tests 2011-10-21 23:43:08 -04:00
Michael Rash
081b58d951 added rule timeout detection 2011-10-21 23:13:24 -04:00
Michael Rash
9b816ed29a added replay attack detection test 2011-10-21 22:55:45 -04:00
Michael Rash
caf458ad3f added first complete SPA cycle test 2011-10-20 23:33:41 -04:00
Michael Rash
6f699f7e5d added client/server interaction test capability 2011-10-20 00:06:58 -04:00
Michael Rash
e479e776db Added usage of sudo for recompilation test
The test suite now recompiles fwknop only if the --enable-recompile-check
option is used, and if so, uses sudo (if installed) to have the resulting
binaries own by the original user (instead of by root).  Also made a couple
of API changes to create test output files automatically if they don't
exist.
2011-10-17 22:55:01 -04:00
Michael Rash
45ecc6f399 minor bugfix to ensure that the proper firewall is used to collect system specs 2011-10-13 20:41:12 -04:00