561 Commits

Author SHA1 Message Date
Michael Rash
ecfa8021e5 doc updates to include sudo information 2015-08-24 17:25:06 -07:00
Michael Rash
d1d59778e9 [server] handle trailing quote for PF firewalls on OpenBSD 2015-08-21 23:06:07 -04:00
Michael Rash
dd1528c829 [test suite] set sudo path on the fwknopd command line 2015-08-21 22:24:45 -04:00
Michael Rash
2f94413b2f [server] bug fix for ipfw firewall rule removal 2015-08-21 21:35:10 -04:00
Michael Rash
ec9eef3365 [server] fix a dead code condition spotted by Coverity 2015-08-19 23:41:47 -04:00
Michael Rash
c5507d2c2a [server] fix ptr vs. val check spotted by Coverity 2015-08-19 23:41:17 -04:00
Michael Rash
423899f3c4 [server] minor fix to remove unnecessary var definition 2015-08-18 22:02:00 -04:00
Michael Rash
0fdc263a43 options struct should not be global (CLANG -Wshadow warning) 2015-08-18 21:58:53 -04:00
Michael Rash
5e0a668a7f [server] minor access.c fix to quiet both Coverity and the CLANG static analyzer 2015-08-16 21:31:48 -04:00
Michael Rash
e5c6f96788 [server] fix compilation issue for non-iptables firewalls 2015-07-25 23:10:06 -04:00
Michael Rash
72555ba9fe [server] minor comment fix for group ID determination in access.conf parsing 2015-07-25 18:58:39 -07:00
Michael Rash
fbdc542f48 Merge branch 'master' of https://github.com/mrash/fwknop 2015-07-25 13:28:49 -07:00
Michael Rash
c0330e5c8b [server] additional work on splitting incoming_spa() loop into functions 2015-07-25 13:27:42 -07:00
Michael Rash
3270900a38 [server] continued work on splitting incoming_spa() into functions 2015-07-24 12:38:17 -07:00
Michael Rash
01beb31861 [server] start to split incoming_spa() main loop into functions 2015-07-22 06:57:13 -07:00
Michael Rash
d681485e29 [server] add sudo support, closes #159 2015-07-22 04:08:58 -07:00
micha137
0ac52b9b4d Fix some typos 2015-07-21 18:39:43 +02: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
295a6a0d14 [server] fix is_digits() logic and add tests 2015-07-17 21:28:02 -07:00
Michael Rash
76d8ce5158 minor change to remove debugging statement 2015-07-17 12:17:48 -07:00
Michael Rash
6e4ad4767f [server] make sure fw _exp_NNN... strings contain only digits after the _exp_ prefix 2015-07-17 12:15:01 -07:00
Michael Rash
b753812cf6 [server] minor addition of function names to fw command error log messages 2015-07-17 11:48:28 -07:00
Michael Rash
a8ef2922e6 Merge branch 'master' of https://github.com/mrash/fwknop 2015-07-17 10:56:28 -07:00
Michael Rash
c25f951b42 Merge pull request #161 from sgh7/master
[server] daemon exits if listened-to interface goes down
2015-07-17 22:37:59 -04:00
Michael Rash
4169c6d477 [server] switch chain_exists() log message to LOG_DEBUG upon error since FWKNOP_INPUT almost never exists at startup 2015-07-17 10:38:34 -07:00
Michael Rash
e7b48af47c [server] Calculate payload length from IP header
Github user Scotte noticed that in his setup a 'VSS-Monitoring ethernet trailer'
was being added to incoming Ethernet frames that contained SPA packets. This
caused base64 decoding to break because the packet data length was calculated
from what libpcap returned for the frame (so these bytes became included in the
SPA payload itself). This issue was reported as #163 on github.

This commit has fwknopd calculate the SPA payload length using the length field
in the IP header so that any trailing bytes in the Ethernet frame are not
included. This solution also applies to the Ethernet Frame Check Sequence issue
(#126).
2015-07-16 23:02:50 -07:00
Michael Rash
71d6f01d11 [server] further no_chk_support for issue #162 2015-07-16 11:49:04 -07:00
Michael Rash
3c8e03d062 [server] add stronger 'no -C' support for firewalld systems (issue #162) 2015-07-16 11:39:14 -07:00
Michael Rash
f1c3806dca [test suite] added tests for duplicate rule detection (issue #162) 2015-07-14 21:13:46 -04: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
bb90a0cb2e [server] minor comment addition 2015-07-12 20:57:09 -04:00
Michael Rash
f4f2ada1c0 [server] bug fix to not zero the wrong buffer for iptables rule deletion
This commit fixes a bug where zero_cmd_buffers() was being called against the
wrong buffer as SPA rules were supposed to be deleted. Although multiple
iterations of check_firewall_rules() would have compensated, some rules would
not have been deleted as quickly as they should have in multi-rule scenarios.
2015-07-12 20:36:06 -04:00
Michael Rash
cd18570f71 [server] default to not returning partial line when collecting the output of an external command 2015-07-10 22:45:44 -04:00
Michael Rash
5460509f88 [server] add NAT rule existence detection for --no-ipt-check support (issue #162) 2015-07-07 08:28:16 -04:00
Michael Rash
012d1cf888 [server] interim commit towards a fix for --no-ipt-check rule detection
This is a significant commit for issue #162 where fwknopd is not properly
detecting rules (particularly NAT rules) on systems running older versions
of iptables where -C support is not offered. A new capability of searching
the output of an external command and getting the first matching line was
added with the search_extcmd_getline() function.
2015-07-05 20:47:06 -04:00
Michael Rash
4c7679fabd [server] start on sudo usage for command exec (issue #159) 2015-07-02 23:44:16 -04:00
Steve Harvey
a212353765 [server] daemon exits if listened-to interface goes down
This commit fixes fwknopd becoming non-responsive should the interface
temporarily cycles through a down state.  Verified on CentOS 7.
2015-07-02 19:33:03 -04:00
Michael Rash
464a680f13 [server] minor --udp-server option handling update for completeness 2015-06-30 17:44:07 -07:00
Michael Rash
ff052bf74f [server] disable external command execution in AFL fuzzing mode 2015-06-01 19:57:49 -07:00
Michael Rash
7bbc30f34c [server] bug fix for --key-gen being called inappropriately, add fw compiled string to -V 2015-06-01 05:27:27 -07:00
Michael Rash
85e07f99c4 man page updates 2015-05-22 15:31:18 -04:00
Michael Rash
de3bca2f9e handle key generation before config parsing 2015-05-20 09:47:51 -07:00
Michael Rash
ceb1713976 add --key-gen option to fwknopd (suggested by Jonathan Bennett) 2015-05-20 08:55:17 -07:00
Michael Rash
17d1071aa8 [server / test suite] cleaner SNAT MASQUERADE support 2015-04-22 01:00:57 -07:00
Michael Rash
176afecd9f [server] minor spacing fix 2015-04-21 21:09:20 -04:00
Michael Rash
3512f7f417 doc updates 2015-04-20 21:34:12 -04:00
Michael Rash
94af6172bb [server] minor -h usage update 2015-04-20 08:41:28 -07:00
Michael Rash
b2109f5630 [server] remove unncessary NULL check spotted by Coverity 2015-04-19 19:44:43 -07:00
Michael Rash
db80c81f66 Merge pull request #152 from Coacher/master
server: remove extra '/run' subdir from paths
2015-04-19 21:15:51 -04:00