140 Commits

Author SHA1 Message Date
Michael Rash
fb69921fdd add ALLOW_ANY_USER_AGENT to ignore incoming User-Agent strings in SPA packets over HTTP, closes #296 2019-03-11 21:56:21 -07:00
Michael Rash
f5509bcd0c [server] Add MAX_FW_TIMEOUT to access.conf variables.
[server] Add MAX_FW_TIMEOUT to access.conf stanzas to allow a
maximum number of seconds for client-specified timeouts in SPA packets.
This fixes issue #226 which was spotted by Jeremiah Rothschild.
2016-09-29 22:18:13 -04:00
Michael Rash
6e54e9452a [test suite] add ENABLE_RULE_PREPEND test 2016-05-26 19:21:07 -07:00
Jonathan Bennett
23e4fd6a2b Adds more Doxygen documentation in preparation for 2.6.9 2016-04-11 11:28:40 -05:00
Jonathan Bennett
09177554bf Adds configuration option for X-Forwarded-For 2016-04-09 11:03:16 -05:00
Jonathan Bennett
9d0e12a313 Adds option to insert new FW rules to top of chain 2016-04-08 21:37:10 -05:00
Michael Rash
29411dea8c Merge branch 'master' of ssh://github.com/mrash/fwknop 2016-01-03 08:44:22 -05:00
Michael Rash
6247fe9e6a Merge remote-tracking branch 'origin/dstuart_netfilter_queue' 2016-01-03 08:31:12 -05:00
Jonathan Bennett
3378ba2423 Add Doxygen headers for server files 2016-01-01 02:09:59 +00:00
Jonathan Bennett
669e448db5 Add ENABLE_NAT_DNS config option 2015-12-31 18:05:55 +00:00
Jonathan Bennett
748803aef7 Add length checks for nat_access messages 2015-12-31 04:40:41 +00:00
Michael Rash
fc1ef7f21f Merge pull request #181 from vaygr/xff
X-Forwarded-For HTTP header support
2015-12-29 20:47:33 -05:00
Michael Rash
a85b081f79 copyright update 2015-12-23 14:34:51 -05:00
Damien Stuart
0d41b78d18 Merge branch 'master' into dstuart_netfilter_queue and resolved one conflict in cmd_opts.h 2015-12-21 00:12:11 -05:00
Damien Stuart
ba611a2d2c Many additions and modifications for support of capture via Netfilter Queue. 2015-12-20 21:58:31 -05:00
Vlad Glagolev
4a7411ba57 1st implementation of X-Forwarded-For HTTP header support 2015-12-20 21:19:31 +03:00
Michael Rash
e25b78e81d [test suite] restore digest cache validation with a new arg --exit-parse-digest-cache 2015-12-19 05:46:36 -08:00
Michael Rash
c0b6db20be [server] start on not calling strtol_wrapper() repeatedly after the config is parsed 2015-12-16 20:26:17 -08:00
Jonathan Bennett
a0c4acd31c Adds the --access-folder command line option 2015-12-10 12:45:28 -06:00
Michael Rash
4f81dd7747 [server] local NAT should not be enabled by default 2015-12-07 16:51:19 -08:00
Damien Stuart
d2cef1746c Initial update for NETFILTER_QUEUE support. These changes are not tested at all as they were edit on a Mac, but are linux-specific. 2015-11-28 15:03:39 -05:00
Michael Rash
0bf4993071 [server] minor update to replace a string compare for command cycle close exclusions 2015-11-17 21:19:59 -08:00
Michael Rash
cfa02859eb [server] don't run firewall handling code for command-only modes 2015-11-17 20:48:37 -08:00
Michael Rash
4587a279e1 [server] validate CMD_CYCLE_* vars from the access.conf file 2015-10-13 19:17:06 -07:00
Michael Rash
d67fbde992 [server] start on command open/close cycle support (issue #117) 2015-10-13 18:00:07 -07:00
Michael Rash
0fdc263a43 options struct should not be global (CLANG -Wshadow warning) 2015-08-18 21:58:53 -04:00
Michael Rash
d681485e29 [server] add sudo support, closes #159 2015-07-22 04:08:58 -07:00
Michael Rash
89b2e8f477 [server] interface goes down will cause fwknopd to exit
By default, fwknopd will now exit if the interface that it is
sniffing goes down (patch contributed by Github user 'sgh7'). If this
happens, it is expected that the native process monitoring feature in
things like systemd or upstart will restart fwknopd. However, if fwknopd
is not being monitored by systemd, upstart, or anything else, this
behavior can be disabled with the EXIT_AT_INTF_DOWN variable in the
fwknopd.conf file. If disabled, fwknopd will try to recover when a
downed interface comes back up.
2015-07-18 13:11:25 -07:00
Michael Rash
795b1de4dd [server] Added RULES_CHECK_THRESHOLD to define 'deep' rule expiration check frequency
The RULES_CHECK_THRESHOLD variable defines the number of times firewall rule
expiration times must be checked before a "deep" check is run. This allows
fwknopd to remove rules that contain a proper '_exp_<time>' even if a third party
program added them instead of fwknopd. The default value for this variable is 20,
and this typically results in this check being run every two seconds or so. To
disable this type of checking altogether, set this variable to zero.
2015-07-18 10:37:17 -07:00
Michael Rash
ef9498f783 [server] Implement garbage cleanup mode for rule deletion
This is a significant commit that allows fwknopd to delete expired rules
from the firewall policy regardless of whether fwknopd is tracking them.
That is, a third party program could insert rules into the fwknopd
chains (iptables for now, but this will be extended to the other
firewalls) in order to take advantage of fwknopd rule deletion.
2015-07-13 21:29:16 -04:00
Michael Rash
4c7679fabd [server] start on sudo usage for command exec (issue #159) 2015-07-02 23:44:16 -04:00
Michael Rash
ceb1713976 add --key-gen option to fwknopd (suggested by Jonathan Bennett) 2015-05-20 08:55:17 -07:00
Ilya Tumaykin
e333cba945 server: remove extra '/run' subdir from paths
Having extra '/run' subdirectory hardcoded into paths used for options
'digest-file', 'pid-file', 'run-dir' is counterintuitive and can lead to
bogus directory layouts when 'localstatedir' differs from the default
value.

For example, if 'localstatedir' is set to '/run', which is a common and
recommended substitute for /var/run in many distros nowadays, then
fwknop files will be placed under /run/run/fwknop.

This changeset removes extra '/run' subdirectory from all relevant paths
by changing DEF_RUN_DIR. Default value of 'localstatedir' is changed to
'/var/run' so users who relied on the previous behaviour won't have to
bother changing anything.

This is tested and works. Gentoo have this patch applied since 2.6.0.
2015-04-20 02:43:10 +03:00
Michael Rash
03959653ca [server] differentiate MASQUERADE from SNAT with a dedicated FWKNOP_MASQUERADE chain 2015-04-18 05:38:35 -07:00
Michael Rash
c25f34e7a2 [server] update firewalld for FORWARD_ALL NAT operations 2015-04-06 01:24:55 -07:00
Michael Rash
8e6db3a5da [server] extend FORWARD_ALL to apply to NAT operations
This is a significant commit to allow all ports and protocols to be
NAT'd in conjunction with FORWARD ACCEPT rules. This commit is in
support of 6b7a3bbdae295c29a15a59385e637bd391858bc2 to allow fwknopd to
function as an SPA gateway.
2015-04-06 20:04:33 -04:00
Michael Rash
6b7a3bbdae [server] Add FORWARD_ALL access.conf wildcard
This is a significant commit that allows iptables firewalls to be used
as an "SPA gateway" for all ports/protocols upon providing a valid SPA
packet. Additional commits will be made to extend this capability, but
this commit adds two new access.conf keywords: FORWARD_ALL and
DISABLE_DNAT. These are used in conjunction to add ACCEPT rules for all
ports/protocols in the FORWARD chain, and also disable DNAT rules at the
same time. Then, by buildling the SNAT chain to provide translation for
an internal network (where an SPA cliet is located), but DROP all
forwarded traffic by default at the same time, SPA can be used to gain
access to the internet. So, this would allow, say, an RFC 1918 internal
network to have IP's assigned via DHCP but they wouldn't be able to
access the internet before sending a SPA packet to the gateway. This
scenario was suggested by spartan1833 to the fwknop list and tracked via
github issue 131.

Additional commits will be made to fully support this feature.
2015-01-17 08:38:32 -05:00
Michael Rash
76b1c6dd50 Merge branch 'spa_destination_ip' 2014-12-04 20:07:05 -05:00
Michael Rash
285ec0ddcb [server] add AFL support for fuzzing SPA Rijndael decryption routine directly with --afl-pkt-file 2014-12-03 20:25:05 -05:00
Grant Pannell
624872ef48 Add DESTINATION access.conf directive and ENABLE_DESTINATION_RULE fwknopd.conf directive 2014-11-29 15:05:06 +10:30
Michael Rash
aaa44656bc [server] add support for American Fuzzy Lop (ALF) fuzzing 2014-11-13 20:55:04 -05:00
Michael Rash
0af8faa0b3 Merge branch 'udp_listener' into execvpe 2014-10-13 20:25:14 -04:00
Michael Rash
ed9e1ac236 added setgid() call for command execution along with CMD_EXEC_GROUP access.conf var 2014-10-07 16:18:14 -04:00
Michael Rash
ddbba5bc90 autoconf update to ensure libpcap is not linked against in --enable-udp-server mode 2014-09-29 11:42:11 -04:00
Michael Rash
52d34a70a2 fwknopd man page updates, added UDPSERV_SELECT_TIMEOUT config option 2014-09-28 22:32:20 -04:00
Michael Rash
1fd0e7e960 first cut at UDP server mode 2014-09-28 11:49:04 -04:00
Gerry Reno
ac82b1ced2 more changes for firewalld 2014-08-31 13:51:08 -04:00
Gerry Reno
d47ebb602a more changes for firewalld 2014-08-31 02:23:39 -04:00
Michael Rash
77384a904e [server] add access.conf variable GPG_FINGERPRINT_ID
Add a new GPG_FINGERPRINT_ID variable to the access.conf file
so that full GnuPG fingerprints can be required for incoming SPA packets
in addition to the appreviated GnuPG signatures listed in GPG_REMOTE_ID.
From the test suite, an example fingerprint is

GPG_FINGERPRINT_ID            00CC95F05BC146B6AC4038C9E36F443C6A3FAD56
2014-06-30 11:11:09 -04:00
Michael Rash
6d1d66fe03 add --fault-injection-tag support to the client/server/libfko
This is a significant commit to add the ability to leverage libfko fault
injections from both the fwknop client and server command lines via a
new option '--fault-injection-tag <tag name>'.  This option is used by
the test suite with the tests/fault_injection.pl tests.
2014-06-05 23:05:49 -04:00