407 Commits

Author SHA1 Message Date
Michael Rash
044ea54d93 updated client SPA verbose message to include the server IP/host 2011-10-29 23:49:29 -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
f999e2e672 bugfix to return preprocess_spa_data() result properly to calling function 2011-10-29 16:55:28 -04:00
Michael Rash
b1b830f744 update to remove packet direction requirement when sniffing on OpenBSD loopback interfaces 2011-10-28 23:01:06 -04:00
Michael Rash
cde71b1b27 minor whitespace removal 2011-10-28 23:00:26 -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
6388e8ac7f added 'const' to function prototype vars where possible
Added the 'const' qualifier to function prototype variables where possible.
In addition, reduced some functions to file-scope with 'static' where possible.

Also made a few minor changes to remove extra whitespace, and fixed a bug
in create_fwknoprc() to ensure the new fwknoprc filehandle is closed.
2011-10-25 21:00:40 -04:00
Michael Rash
85377267e2 compiler warning fix for sscanf() on freebsd
This commit fixes the following gcc warning on freebsd systems:

replay_cache.c: In function 'replay_file_cache_init':
replay_cache.c:312: warning: format '%ld' expects type 'long int *', but argument 9 has type 'time_t *'
2011-10-24 21:52:13 -04:00
Michael Rash
1c6fc0f3f8 update to detect loopback interface 2011-10-24 20:48:56 -04:00
Michael Rash
3299fb2581 minor whitespace removal 2011-10-24 20:48:20 -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
2d9dbe1fca minor whitespace removal 2011-10-22 15:19:54 -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
0bda4ee1e5 minor removal of whitespace 2011-10-21 22:54:49 -04:00
Michael Rash
caf458ad3f added first complete SPA cycle test 2011-10-20 23:33:41 -04:00
Michael Rash
44598fd7dd Added --digest-file and --pid-file args
Added --digest-file and --pid-file args so that the user can easily alter
these paths from the command line.
2011-10-20 23:31:59 -04:00
Michael Rash
6f699f7e5d added client/server interaction test capability 2011-10-20 00:06:58 -04:00
Michael Rash
b8571bcc05 Minor PID string length fix
Changed PID string length to 7 to accomodate an ending newline and NULL
char when writing to the fwknopd .pid file.  Without this fix, with a
5 digit PID the trailing newline would be truncated (no room for the
ending NULL char).
2011-10-18 21:28:38 -04:00
Michael Rash
0e7a0e9a37 Added --fw-list-all and --fw-flush
Added new command line options --fw-list-all and --fw-flush to allow all
firewall rules to be displayed including those not created by fwknopd, and
allow all firewall rules created by fwknopd to be deleted.

Also switched -D config dump output to stdout.
2011-10-17 23:03:28 -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
11c240c41b minor update to allow fw rules to be dumped before parsing the access.conf file 2011-10-13 22:44:35 -04:00
Michael Rash
e36c833f55 minor whitespace fixes 2011-10-13 22:02:21 -04:00
Michael Rash
9962dc0808 minor wording update netfilter -> iptables 2011-10-13 20:59:30 -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
Michael Rash
103cd2a8fb added the test/conf/ directory for config files use by the test suite 2011-10-13 20:30:05 -04:00
Michael Rash
6f0d2c5091 minor typo fix 2011-10-13 20:29:37 -04:00
Michael Rash
64160a0c57 started on basic SPA generation, updated to use LD_LIBRARY_PATH for local libfko instance 2011-10-13 20:29:19 -04:00
Michael Rash
a1f4a65f27 interim commit to add major functionality to the fwknop test suite 2011-10-12 23:37:28 -04:00
Michael Rash
4a41ecc955 removed 2011-10-12 23:36:51 -04:00
Michael Rash
88d8eb03b3 minor update to switch to stdout when exiting with success 2011-10-12 23:36:04 -04:00
Michael Rash
41c0be29b7 switched --help output to stdout from stderr 2011-10-06 23:02:29 -04:00
Michael Rash
26f58a705d minor update to account for hardening-check return values 2011-10-06 22:53:27 -04:00
Michael Rash
1a3e1caffe Initial start on a test suite
This commit begins development on a comprehensive test suite for fwknop.
The initial tests are focused on compilation correctness and security options
as determined by the "hardening-check" script from Kees Cook of the Debian
security team.
2011-10-04 23:15:04 -04:00
Michael Rash
05f3cec96a Added --help usage information
With the --help command line argument, the following information is printed:

$ ./fwknop-launcher-lsof.pl --help

Usage: fwknop-launcher-lsof.pl [options]

Options:

    -c,  --config     <file>   - Path to fwknop-launcher.conf config file.
    -l,  --lsof-cmd   <path>   - Path to lsof command.
    -f,  --fwknop-cmd <path>   - Path to fwknop client command.
    -s,  --sleep   <seconds>   - Specify sleep interval (default:
                                 1 seconds)
    -n   --no-daemon           - Run in foreground mode.
    -u,  --user   <username>   - Specify username (usually this is not
                                 needed).
         --home-dir <dir>      - Path to user's home directory (usually
                                 this is not needed).
    -v   --verbose             - Print verbose information to the terminal
                                 (requires --no-daemon).
         --help                - Print usage info and exit.
2011-09-25 21:12:30 -04:00
Michael Rash
71ea0c6bfd Merge branch 'master' into fwknop-launcher 2011-09-25 21:02:54 -04:00
Michael Rash
7748423b15 Added the fwknop lsof launcher under the extras/ directory
The fwknop lsof launcher (extras/fwknop-launcher/fwknop-launcher-lsof.pl) is a
lightweight daemon that allows the user to not have to manually run the fwknop
client when attempting to gain access to a service that is protected by Single
Packet Authorization via fwknopd.  This is accomplished by checking the output
of lsof to look for pending connections in the SYN_SENT state, which (usually)
indicate that a remote firewall is blocking the attempted connection.  At this
point, the launcher executes the fwknop client with the --get-key arg (so the
user must place the key in the local filesystem) to generate an SPA packet for
the attempted connection.  The remote fwknopd daemon will reconfigure the
firewall to allow temporary access, and this usually happens fast enough that
the original connection attempt will then succeed.

The idea for this was originally for a pcap-based connection watcher by
Sebastien Jeanquier.
2011-09-24 22:31:18 -04:00
Michael Rash
35ee5a202d Merge pull request #5 from maxkas/master
Fwknop client for iPhone devices - contributed by Max Kastanas
2011-09-21 18:10:16 -07:00
Max Kastanas
668ed9033f Codebase of Fwknop client for iOS (iPhone) devices 2011-09-16 22:51:53 -07:00