439 Commits

Author SHA1 Message Date
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
Michael Rash
35abc349ab minor typo fix: fwkop -> fwknop 2011-09-12 23:04:41 -04:00
Damien Stuart
f693a2721c Merge branch 'master' of https://github.com/mrash/fwknop 2011-09-10 11:30:09 -04:00
Damien Stuart
e07ccdd550 Added the cmd_opts.h file to server and client's Makefile.am so they are included with make dist. 2011-09-10 11:25:08 -04:00
Michael Rash
87416c0cdf Replaced all strcpy() calls with strlcpy()
OpenBSD especially gives compiler warnings whenever strcpy() is used.  All such
calls have been replaced with strlcpy().
2011-09-09 22:09:37 -04: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
c65e25c656 Check for active_rules > 0 before decrementing
In the fw_config struct the active_rules member is unsigned, so this change
ensures that we don't try to decrement it below zero whenever a firewall rule
is deleted or an error condition occurs.
2011-09-08 21:33:52 -04:00
Michael Rash
88b6d44f1f Update to make _exp_ string a #define
Replaced all instances of "_exp_" with the #define EXPIRE_COMMENT_PREFIX so
that the prefix can easily be changed. so
that the prefix can easily be changed. so
that the prefix can easily be changed. so
that the prefix can easily be changed.
2011-09-08 00:20:20 -04:00
Michael Rash
2531896ebf Added the ability to delete PF rules
This commit adds the ability to fwknopd to delete PF rules after the SPA timer
expires.  The strategy implemented is similar to iptables and ipfw, except
that all PF rules are added to an 'anchor', and deleting a specific expired
rule is done by listing all rules in the anchor and reinstantiating it via
'pfctl -a <anchor> -f -' with the expired rule deleted.  fwknopd uses the
"_exp_<expire time>" convention in a PF rule label similarly to how fwknopd
interfaces with iptables (via the 'comment' match), and ipfw (via the
"//<comment>" feature).
2011-09-07 23:24:18 -04:00
Michael Rash
f9810904c3 minor comment typo fixes 2011-09-03 21:00:12 -04:00
Michael Rash
d60dde17b7 PF rules are now added to the fwknop anchor
This commit implements the ability to add PF firewall rules to the fwknop
anchor after a valid SPA packet is sniffed off the wire.  A subsequent commit
will add the ability to delete these rules.
2011-09-03 14:50:28 -04:00
Michael Rash
6938f7a6ae Minor copyright holder update
Minor copyright holder update
2011-08-28 13:37:23 -04:00
Michael Rash
10ff421e1e For PF firewalls implemented a check for an active fwknop anchor
This commit ensures that for PF firewalls that the fwknop anchor is active and
linked into the running PF policy.  This is accomplished by looking for the
string 'anchor "fwknop"' in the output of "pfctl -s rules".  If the anchor
exists, then fwknopd will be able to influence traffic via rules added and
removed from the fwknop anchor.
2011-08-28 13:27:15 -04:00
Michael Rash
5bc5ef4305 Added --fw-list info to --help
Added --fw-list output to usage info when --help is specified from the command
line.
2011-08-27 11:07:19 -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
47da588003 removed 2.0.0 branch specific ChangeLog, ShortLog and diffstat files 2011-08-22 21:39:28 -04:00
Michael Rash
17beb2d348 bumped version to 2.0.0rc4 2011-08-21 14:06:41 -04:00