man page updates - access.conf section now includes variable guidance

This commit is contained in:
Michael Rash
2013-05-21 22:10:13 -04:00
parent 52462e7dba
commit cfbbac2654
4 changed files with 323 additions and 209 deletions
+61 -17
View File
@@ -2,12 +2,12 @@
.\" Title: fwknop
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 05/19/2013
.\" Date: 05/20/2013
.\" Manual: Fwknop Client
.\" Source: Fwknop Client
.\" Language: English
.\"
.TH "FWKNOP" "8" "05/19/2013" "Fwknop Client" "Fwknop Client"
.TH "FWKNOP" "8" "05/20/2013" "Fwknop Client" "Fwknop Client"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -40,9 +40,9 @@ SPA is essentially next generation Port Knocking (PK), but solves many of the li
.sp
This is the manual page for the \fBfwknop\fR client which is responsible for constructing SPA packets and sending them over the network\&. The server side is implemented by the \fBfwknopd\fR daemon which sniffs the network for SPA packets, and it is recommended to read the \fIfwknopd(8)\fR manual page as well\&.
.sp
SPA packets generated by \fBfwknop\fR leverage HMAC for authenticated encryption in the encrypt\-then\-authenticate model\&. Although the usage of an HMAC is currently optional, it is highly recommended for three reasons: \fI1)\fR without an HMAC, cryptographically strong authentication is not possible with \fBfwknop\fR unless GnuPG is used, \fI2)\fR an HMAC applied after encryption protects against CBC\-mode padding oracle attacks such as the Vaudenay attack and the more recent "Lucky 13" attack against SSL, and \fI3)\fR the code required by the \fBfwknopd\fR daemon to verify an HMAC is much more simplistic than the code required to decrypt an SPA packet, so an SPA packet without a proper HMAC isn\(cqt even sent through the decryption routines\&. Generating an HMAC for SPA communications requires a dedicated key in addition to the normal encryption key\&.
SPA packets generated by \fBfwknop\fR leverage HMAC for authenticated encryption in the encrypt\-then\-authenticate model\&. Although the usage of an HMAC is currently optional (enabled via the \fB\-\-use\-hmac\fR command line switch), it is highly recommended for three reasons: \fI1)\fR without an HMAC, cryptographically strong authentication is not possible with \fBfwknop\fR unless GnuPG is used, but even then an HMAC should still be applied, \fI2)\fR an HMAC applied after encryption protects against CBC\-mode padding oracle attacks such as the Vaudenay attack and the more recent "Lucky 13" attack against SSL, and \fI3)\fR the code required by the \fBfwknopd\fR daemon to verify an HMAC is much more simplistic than the code required to decrypt an SPA packet, so an SPA packet without a proper HMAC isn\(cqt even sent through the decryption routines\&. Reason \fI3)\fR is why an HMAC should still be used even when SPA packets are encrypted with GnuPG due to the fact that SPA data is not sent through \fBlibgpgme\fR functions unless the HMAC checks out first\&. Generating an HMAC for SPA communications requires a dedicated key in addition to the normal encryption key\&.
.sp
\fBfwknop\fR encrypts SPA packets either with the \fIRijndael\fR block cipher or via \fIGnuPG\fR and associated asymmetric cipher\&. If the symmetric encryption method is chosen, then as usual the encryption key is shared between the client and server (see the \fBfwknopd\fR \fIaccess\&.conf\fR file for details)\&. If the GnuPG method is chosen, then the encryption keys are derived from GnuPG key rings\&. SPA packets generated by fwknop running as a client adhere to the following format (before encryption and the HMAC is applied):
\fBfwknop\fR encrypts SPA packets either with the \fIRijndael\fR block cipher or via \fIGnuPG\fR and associated asymmetric cipher\&. If the symmetric encryption method is chosen, then as usual the encryption key is shared between the client and server (see the \fBfwknopd\fR \fIaccess\&.conf\fR file for details)\&. The actual encryption key used for Rijndael encryption is generated via the standard PBKDF1 key derivation algorithm, and CBC mode is set\&. If the GnuPG method is chosen, then the encryption keys are derived from GnuPG key rings\&. SPA packets generated by fwknop running as a client adhere to the following format (before encryption and the HMAC is applied):
.sp
.if n \{\
.RS 4
@@ -65,7 +65,7 @@ Each of the above fields are separated by a ":" character due to the variable le
.sp
By default, the \fBfwknop\fR client sends authorization packets over UDP port 62201, but this can be altered with the \fB\-\-server\-port\fR argument (this requires \fBfwknopd\fR to be configured to acquire SPA data over the selected port)\&. Also, \fBfwknop\fR can send the SPA packet over a random port via the \fB\-\-rand\-port\fR argument\&. See \fIfwknopd(8)\fR for further details\&. See the \fBEXAMPLES\fR section for example invocations of the \fBfwknop\fR client\&.
.sp
The \fBfwknop\fR client is quite portable, and is known to run on various Linux distributions (all major distros and embedded ones as well such as OpenWRT), FreeBSD, OpenBSD, and Cygwin on Windows\&. There is also a library \fBlibfko\fR that both \fBfwknop\fR and \fBfwknopd\fR use for SPA packet encryption/decryption and HMAC authentication operations\&. This library can be used to allow third party applications to use SPA\&.
The \fBfwknop\fR client is quite portable, and is known to run on various Linux distributions (all major distros and embedded ones such as OpenWRT as well), FreeBSD, OpenBSD, and Cygwin on Windows\&. There is also a library \fBlibfko\fR that both \fBfwknop\fR and \fBfwknopd\fR use for SPA packet encryption/decryption and HMAC authentication operations\&. This library can be used to allow third party applications to use SPA\&.
.SH "REQUIRED ARGUMENTS"
.sp
These required arguments can be specified via command\-line or from within the \fI\&.fwknoprc\fR file (see \fI\-n, \-\-named\-config\fR option and the FWKNOPRC FILE section below)\&.
@@ -143,7 +143,17 @@ rc file is a more powerful mechanism for specifying not only the HMAC key but ot
Have
\fBfwknop\fR
generate both Rijndael and HMAC keys that can be used for SPA packet encryption\&. These keys are derived from /dev/random and then base64 encoded before being printed to stdout, and are meant to be included within the \(lq$HOME/\&.fwknoprc\(rq file (or the file referenced by
\fB\-\-get\-key\fR)\&.
\fB\-\-get\-key\fR)\&. Such keys are generally more secure than passphrases that are typed in from the command line\&.
.RE
.PP
\fB\-\-key\-len\fR=\fI<length>\fR
.RS 4
Specify the number of bytes for a generated Rijndael key\&. The maximum size is currently 128 bytes\&.
.RE
.PP
\fB\-\-hmac\-key\-len\fR=\fI<length>\fR
.RS 4
Specify the number of bytes for a generated HMAC key\&. The maximum size is currently 128 bytes\&.
.RE
.PP
\fB\-l, \-\-last\-cmd\fR
@@ -206,12 +216,16 @@ Specify path to the fwknop rc file (default is $HOME/\&.fwknoprc)\&.
.PP
\fB\-\-save\-rc\-stanza\fR=\fI<stanza name>\fR
.RS 4
Save command line arguments to the $HOME/\&.fwknoprc stanza specified with the \-n option\&.
Save command line arguments to the $HOME/\&.fwknoprc stanza specified with the
\fB\-n\fR
option\&.
.RE
.PP
\fB\-\-force\-stanza\fR
.RS 4
Used with \-\-save\-rc\-stanza to overwrite all of the variables for the specified stanza
Used with
\fB\-\-save\-rc\-stanza\fR
to overwrite all of the variables for the specified stanza
.RE
.PP
\fB\-\-show\-last\fR
@@ -223,7 +237,7 @@ Display the last command\-line arguments used by
\fB\-E, \-\-save\-args\-file\fR=\fI<file>\fR
.RS 4
Save command line arguments to a specified file path\&. Without this option, and when
\fI\-\-no\-save\-args\fR
\fB\-\-no\-save\-args\fR
is not also specified, then the default save args path is
\fI~/\&.fwknop\&.run\fR\&.
.RE
@@ -249,7 +263,9 @@ client to write a newly created SPA packet out to the specified file so that it
.PP
\fB\-b, \-\-save\-packet\-append\fR
.RS 4
Append the generated packet data to the file specified with the \-B option\&.
Append the generated packet data to the file specified with the
\fB\-B\fR
option\&.
.RE
.PP
\fB\-v, \-\-verbose\fR
@@ -261,7 +277,7 @@ client in verbose mode\&. This causes
to print some extra information about the current command and the resulting SPA data\&.
.RE
.PP
\fB\-V, \-\-Version\fR
\fB\-V, \-\-version\fR
.RS 4
Display version information and exit\&.
.RE
@@ -297,7 +313,7 @@ client to automatically resolve the externally routable IP address the local sys
.RS 4
Use GPG encryption on the SPA packet (default if not specified is Rijndael)\&.
\fBNote:\fR
Use of this option will require the specification of a GPG recipient (see
Use of this option will also require a GPG recipient (see
\fB\-\-gpg\-recipient\fR
along with other GPG\-related options below)\&.
.RE
@@ -340,6 +356,26 @@ argument, the
client can be made to request such access\&. This means that any external attacker would only see a connection over port 55,000 instead of the expected port 22 after the SPA packet is sent\&.
.RE
.PP
\fB\-\-nat\-port\fR
.RS 4
Usually
\fBfwknop\fR
is used to request access to a specific port such as tcp/22 on a system running
\fBfwknopd\fR\&. However, by using the
\fB\-\-nat\-port\fR
argument, it is possible to request access to a (again, such as tcp/22), but have this access granted via the specified port (so, the
\fB\-p\fR
argument would then be used on the
\fISSH\fR
client command line)\&. See the
\fB\-\-nat\-local\fR
and
\fB\-\-nat\-access\fR
command line arguments to
\fBfwknop\fR
for additional details on gaining access to services via a NAT operation\&.
.RE
.PP
\fB\-\-nat\-rand\-port\fR
.RS 4
Usually
@@ -351,7 +387,8 @@ argument, it is possible to request access to a particular service (again, such
\fBfwknop\fR
client has been executed in this mode and the random port selected by
\fBfwknop\fR
is displayed, the destination port used by the follow\-on client must be changed to match this random port\&. For SSH, this is accomplished via the
is displayed, the destination port used by the follow\-on client must be changed to match this random port\&. For
\fISSH\fR, this is accomplished via the
\fB\-p\fR
argument\&. See the
\fB\-\-nat\-local\fR
@@ -455,6 +492,13 @@ are mutually exclusive\&.
Set the source port for outgoing SPA packet\&.
.RE
.PP
\fB\-f, \-\-fw\-timeout\fR=\fI<seconds>\fR
.RS 4
Specify the length of time (seconds) that the remote firewall rule that grants access to a service is to remain active\&. The default maintained by
\fBfwknopd\fR
is 30 seconds, but any established connection can be kept open after the initial accept rule is deleted through the use of a connection tracking mechanism that may be offered by the firewall\&.
.RE
.PP
\fB\-C, \-\-server\-cmd\fR=\fI<command to execute>\fR
.RS 4
Instead of requesting access to a service with an SPA packet, the
@@ -651,7 +695,7 @@ This is the passphrase that is used for SPA packet encryption and applies to bot
.PP
\fBKEY_BASE64\fR
.RS 4
Specify the encryption passphrase as a base64 encoded string\&. This allows non\-ascii characters to be included\&.
Specify the encryption passphrase as a base64 encoded string\&. This allows non\-ascii characters to be included in the base64\-decoded key\&.
.RE
.PP
\fBUSE_HMAC\fR
@@ -667,12 +711,12 @@ directives (see below)\&.
.PP
\fBHMAC_KEY\fR
.RS 4
Specify the HMAC key for authenticated encryption of SPA packets\&.
Specify the HMAC key for authenticated encryption of SPA packets\&. This supports both Rijndael and GPG encryption modes, and is applied according to the encrypt\-then\-authenticate model\&.
.RE
.PP
\fBHMAC_KEY_BASE64\fR
.RS 4
Specify the HMAC key as a base64 encoded string\&. This allows non\-ascii characters to be included\&.
Specify the HMAC key as a base64 encoded string\&. This allows non\-ascii characters to be included in the base64\-decoded key\&.
.RE
.PP
\fBHMAC_DIGEST_TYPE\fR
@@ -946,7 +990,7 @@ This \(lqC\(rq version of fwknop was derived from the original Perl\-based versi
The phrase \(lqSingle Packet Authorization\(rq was coined by MadHat and Simple Nomad at the BlackHat Briefings of 2005\&.
.SH "BUGS"
.sp
Send bug reports to dstuart@dstuart\&.org or mbr@cipherdyne\&.org\&. Suggestions and/or comments are always welcome as well\&.
Send bug reports to dstuart@dstuart\&.org or mbr@cipherdyne\&.org, or open a new issue on Github (see \fIhttps://github\&.com/mrash/fwknop\&.git\fR)\&. Suggestions and/or comments are always welcome as well\&. Additional information may be found in the \fBfwknop\fR mailing list archives (see: \fIhttps://lists\&.sourceforge\&.net/lists/listinfo/fwknop\-discuss\fR)\&.
.SH "DISTRIBUTION"
.sp
\fBfwknop\fR is distributed under the GNU General Public License (GPL) version 2, and the latest version may be downloaded from \fIhttp://www\&.cipherdyne\&.org\fR\&.
+63 -52
View File
@@ -62,7 +62,7 @@ requires a dedicated key in addition to the normal encryption key.
*fwknop* encrypts SPA packets either with the 'Rijndael' block cipher or via
'GnuPG' and associated asymmetric cipher. If the symmetric encryption method
is chosen, then as usual the encryption key is shared between the client and
server (see the *fwknopd* 'access.conf' file for details). The actual
server (see the *fwknopd* ''@sysconfdir@/fwknop/access.conf' file for details). The actual
encryption key used for Rijndael encryption is generated via the standard
PBKDF1 key derivation algorithm, and CBC mode is set. If the GnuPG method
is chosen, then the encryption keys are derived from GnuPG key rings. SPA
@@ -120,7 +120,7 @@ section below).
sending full commands with the *--server-cmd* argument via an SPA
packet to be executed by *fwknopd* does not require this argument.
*-D, --destination*='<IP-address>'::
*-D, --destination*='<hostname/IP-address>'::
Direct the *fwknop* client to authenticate with the *fwknopd*
daemon/service at the specified destination hostname or IP address. The
connection mode is discovered by the *fwknopd* daemon/service when it
@@ -291,9 +291,8 @@ SPA OPTIONS
*-g, --gpg-encryption*::
Use GPG encryption on the SPA packet (default if not specified is
Rijndael). *Note:* Use of this option will require the specification of
a GPG recipient (see *--gpg-recipient* along with other GPG-related
options below).
Rijndael). *Note:* Use of this option will also require a GPG recipient
(see *--gpg-recipient* along with other GPG-related options below).
*--hmac-digest-type*='<digest>'::
Set the HMAC digest algorithm for authenticated encryption of SPA packets.
@@ -365,7 +364,7 @@ SPA OPTIONS
packets. This requires root on the client side access since a raw
socket is required to accomplish this. Note that the *--spoof-user*
argument can be given in this mode in order to pass any *REQUIRE_USERNAME*
keyword that might be specified in '/etc/fwknop/access.conf'.
keyword that might be specified in '@sysconfdir@/fwknop/access.conf'.
*-r, --rand-port*::
Instruct the *fwknop* client to send an SPA packet over a random
@@ -384,7 +383,7 @@ SPA OPTIONS
NAT address. Presently, *fwknop* uses the URL:
'http://www.cipherdyne.org/cgi-bin/myip' to resolve the caller IP.
*--resolve-url*::
*--resolve-url* '<url>'::
Override the default URL used for resolving the source IP address. For
best results, the URL specified here should point to a web service that
provides just an IP address in the body of the HTTP response.
@@ -431,9 +430,9 @@ SPA OPTIONS
*-M, --encryption-mode*='<mode>'::
Specify the encryption mode when AES is used for encrypting SPA packets.
The default is CBC mode, but others can be chosen such as CFB or OFB
as long as this is also specified in the 'access.conf' file on the
as long as this is also specified in the ''@sysconfdir@/fwknop/access.conf' file on the
server side via the ENCRYPTION_MODE variable. In general, it is
recommended to not use this argument and just use the default (CBC).
recommended to not include this argument and let the default (CBC) apply.
Note that the string ``legacy'' can be specified in order to generate SPA
packets with the old initialization vector strategy used by versions of
*fwknop* prior to 2.5. With the 2.5 release, *fwknop* generates
@@ -504,8 +503,9 @@ More comprehensive information on this can be found here:
*--gpg-home-dir*='<dir>'::
Specify the path to the GnuPG directory; normally this path is derived
from the home directory of the user that is running the *fwknop*
client. This is useful when a ``root'' user wishes to log into a remote
machine whose sshd daemon/service does not permit root login.
client (so the default is '~/.gnupg'). This is useful when a ``root''
user wishes to log into a remote machine whose sshd daemon/service does not
permit root login.
*--gpg-recipient*='<key ID or Name>'::
Specify the GnuPG key ID, e.g. ``+1234ABCD+'' (see the output of
@@ -547,11 +547,11 @@ There are directives to match most of the command-line parameters *fwknop*
supports. Here is the current list of each directive along with a brief
description and its matching command-line option(s):
*SPA_SERVER*::
Specify the IP or hostname of the destination (*fwknopd*) server
*SPA_SERVER* '<hostname/IP-address>'::
Specify the hostname or IP of the destination (*fwknopd*) server
('-D, --destination').
*ALLOW_IP*::
*ALLOW_IP* '<IP-address>'::
Specify the address to allow within the SPA data. Note: This parameter
covers the *-a*, *-s*, and *-R* command-line options. You can specify
a hostname or IP address (the *-a* option), specify the word "source" to
@@ -559,113 +559,121 @@ description and its matching command-line option(s):
to allow (the *-s* option), or use the word "resolve" to have *fwknop*
resolve the external network IP via HTTP request (the *-R* option).
*ACCESS*::
*ACCESS* '<port list>'::
Set the one or more protocol/ports to open on the firewall ('-A, --access').
The format of this list is ``+<proto>/<port>...<proto>/<port>+'', e.g. ``tcp/22,udp/53''.
*SPA_SERVER_PORT*::
*SPA_SERVER_PORT* '<port>'::
Set the server port to use for sending the SPA packet ('-p, --server-port').
*SPA_SERVER_PROTO*::
*SPA_SERVER_PROTO* '<protocol'>::
Set the protocol to use for sending the SPA packet ('-P, --server-proto').
*KEY*::
*KEY* '<passphrase>'::
This is the passphrase that is used for SPA packet encryption and applies
to both Rijndael or GPG encryption modes. The actual encryption key that
is used for Rijndael is derived from the PBKDF1 algorithm, and the GPG key
is derived from the specified GPG key ring.
*KEY_BASE64*::
*KEY_BASE64* '<base64 encoded passphrase>'::
Specify the encryption passphrase as a base64 encoded string. This allows
non-ascii characters to be included.
non-ascii characters to be included in the base64-decoded key.
*USE_HMAC*::
*USE_HMAC* '<Y/N>'::
Set HMAC mode for authenticated encryption of SPA packets. This will have
*fwknop* prompt the user for a dedicated HMAC key that is independent of
the encryption key. Alternatively, the HMAC key can be specified with the
'HMAC_KEY' or 'HMAC_KEY_BASE64' directives (see below).
*HMAC_KEY*::
Specify the HMAC key for authenticated encryption of SPA packets.
*HMAC_KEY* '<key>'::
Specify the HMAC key for authenticated encryption of SPA packets. This
supports both Rijndael and GPG encryption modes, and is applied according
to the encrypt-then-authenticate model.
*HMAC_KEY_BASE64*::
*HMAC_KEY_BASE64* '<base64 encoded key>'::
Specify the HMAC key as a base64 encoded string. This allows non-ascii
characters to be included.
characters to be included in the base64-decoded key.
*HMAC_DIGEST_TYPE*::
*HMAC_DIGEST_TYPE* '<digest algorithm>'::
Set the HMAC digest algorithm used for authenticated encryption of SPA
packets. Choices are: *MD5*, *SHA1*, *SHA256* (the default), *SHA384*,
and *SHA512*.
*SPA_SOURCE_PORT*::
*SPA_SOURCE_PORT* '<port>'::
Set the source port to use for sending the SPA packet ('-S, --source-port').
*FW_TIMEOUT*::
*FW_TIMEOUT* '<seconds>'::
Set the firewall rule timeout value ('-f, --fw-timeout').
*RESOLVE_URL*::
*RESOLVE_URL* '<url>'::
Set to a URL that will be used for resolving the source IP address
(--resolve-url).
*TIME_OFFSET*::
*TIME_OFFSET* '<time>'::
Set a value to apply to the timestamp in the SPA packet. This can
be either a positive or negative value ('--time-offset-plus/minus').
*ENCRYPTION_MODE*::
*ENCRYPTION_MODE* '<mode>'::
Specify the encryption mode when AES is used. This variable is a synonym
for the '--encryption-mode' command line argument.
for the '-M, --encryption-mode' command line argument. In general, it is
recommended to not include this argument and let the default (CBC) apply.
Note that the string ``legacy'' can be specified in order to generate SPA
packets with the old initialization vector strategy used by versions of
*fwknop* prior to 2.5.
*DIGEST_TYPE*::
Set the SPA message digest type ('-m, --digest-type').
*DIGEST_TYPE* '<digest algorithm>'::
Set the SPA message digest type ('-m, --digest-type'). Choices are: *MD5*,
*SHA1*, *SHA256* (the default), *SHA384*, and *SHA512*.
*USE_GPG*::
*USE_GPG* '<Y/N>'::
Set to 'Y' to specify the use of GPG for encryption ('--gpg-encryption').
*USE_GPG*::
*USE_GPG_AGENT* '<Y/N>'::
Set to 'Y' to have *fwknop* interface with a GPG agent instance for the GPG
key password ('--gpg-agent'). Agent information itself is specified with
the 'GPG_AGENT_INFO' environmental variable.
*GPG_SIGNER*::
*GPG_SIGNER* '<key ID or Name>'::
Specify the GPG key name or ID for signing the GPG-encrypted SPA data
('--gpg-signer-key').
*GPG_RECIPIENT*::
*GPG_RECIPIENT* '<key ID or Name>'::
Specify the GPG key name or ID for the recipient of the GPG-encrypted SPA
data ('--gpg-recipient-key').
*GPG_HOMEDIR*::
Specify the GPG home directory ('--gpg-home-dir').
*GPG_HOMEDIR* '<dir>'::
Specify the GPG home directory ('--gpg-home-dir'). Defaults to '~/.gnupg'.
*SPOOF_USER*::
*SPOOF_USER* '<user>'::
Set the username in the SPA data to the specified value ('-U,
--spoof-user').
*SPOOF_SOURCE_IP*::
*SPOOF_SOURCE_IP* '<IP>'::
Set the source IP of the outgoing SPA packet to the specified value
('-Q, --spoof-source').
*RAND_PORT*::
*RAND_PORT* '<Y/N>'::
Send the SPA packet over a randomly assigned port ('-r, --rand-port').
*KEY_FILE*::
*KEY_FILE* '<file>'::
Load an encryption key/password from a file ('-G, --get-key').
*HTTP_USER_AGENT*::
*HTTP_USER_AGENT* '<agent string>'::
Set the HTTP User-Agent for resolving the external IP via -R, or for
sending SPA packets over HTTP ('-u, --user-agent').
*NAT_ACCESS*::
*NAT_ACCESS* '<internalIP:forwardPort>'::
Gain NAT access to an internal service protected by the fwknop server
('-N, --nat-access').
*NAT_LOCAL*::
*NAT_LOCAL* '<Y/N>'::
Access a local service via a forwarded port on the fwknopd server
system ('--nat-local').
*NAT_PORT*::
*NAT_PORT* '<port>'::
Specify the port to forward to access a service via NAT ('--nat-port').
*NAT_RAND_PORT*::
*NAT_RAND_PORT* '<Y/N>'::
Have the fwknop client assign a random port for NAT access
('--nat-rand-port').
@@ -698,7 +706,7 @@ The most common usage of *fwknop* is to gain access to 'SSH' running on a
remote system that has the *fwknopd* daemon deployed along with a default-drop
firewall policy. The following command illustrates this where IP '1.1.1.1' is
the IP to be allowed through the firewall running on '2.2.2.2' (note that the
'access.conf' file consumed by *fwknopd* will need to have matching encryption
''@sysconfdir@/fwknop/access.conf' file consumed by *fwknopd* will need to have matching encryption
and HMAC keys, and configuration specifics can be found in the 'fwknopd(8)'
manual page):
@@ -852,8 +860,11 @@ Nomad at the BlackHat Briefings of 2005.
BUGS
----
Send bug reports to dstuart@dstuart.org or mbr@cipherdyne.org. Suggestions
and/or comments are always welcome as well.
Send bug reports to dstuart@dstuart.org or mbr@cipherdyne.org, or open a new
issue on Github (see 'https://github.com/mrash/fwknop.git'). Suggestions
and/or comments are always welcome as well. Additional information may be
found in the *fwknop* mailing list archives (see:
'https://lists.sourceforge.net/lists/listinfo/fwknop-discuss').
DISTRIBUTION
------------
+101 -67
View File
@@ -31,12 +31,26 @@ scanned for with 'Nmap'.
The main configuration for *fwknopd* is maintained within two files:
'fwknopd.conf' and 'access.conf'. The default location for these files
is determined at package configuration (typically '@sysconfdir@/fwknop')The
configuration variables within these files are described below.
is determined at package configuration (typically '@sysconfdir@/fwknop').
The configuration variables within these files are described below.
COMMAND-LINE OPTIONS
--------------------
*-i, --interface*='<interface>'::
Manually specify interface on which to sniff, e.g. ``-i eth0''. This
option is not usually needed because the ``PCAP_INTF'' keyword in the
'fwknopd.conf' file defines the sniffing interface.
*-f, --foreground*::
Run *fwknopd* in the foreground instead of becoming a daemon. When run
in the foreground, message that would go to the log would instead be
sent to stderr. This mode is usually used when testing and/or debugging.
*--fw-list*::
List only firewall rules that any running *fwknopd* daemon has created
and then exit.
*-a, --access-file*='<access-file>'::
Specify the location of the 'access.conf' file. If this option is
not given, 'fwknopd' will use the compile-time default location (typically
@@ -54,25 +68,11 @@ COMMAND-LINE OPTIONS
*-d, --digest-file*='<digest-file>'::
Specify the location of the 'digest.cache' file. If this option is
not given, 'fwknopd' will use the compile-time default location (typically
'@localstatedir@/run/fwknop/digest.cache).
'@localstatedir@/run/fwknop/digest.cache').
*-D, --Dump-config*::
*-D, --dump-config*::
Dump the configuration values that *fwknopd* derives from the
'fwknopd.conf' (or override files) and 'access.conf' on stderr.
*-i, --interface*='<interface>'::
Manually specify interface on which to sniff, e.g. ``-i eth0''. This
option is not usually needed because the ``PCAP_INTF'' keyword in the
'fwknopd.conf' file defines the sniffing interface.
*-f, --foreground*::
Run *fwknopd* in the foreground instead of becoming a daemon. When run
in the foreground, message that would go to the log would instead be
sent to stderr. This mode is usually used when testing and/or debugging.
*--fw-list*::
List only firewall rules that any running *fwknopd* daemon has created
and then exit.
'@sysconfdir@/fwknop/fwknopd.conf'' (or override files) and '@sysconfdir@/fwknop/access.conf' on stderr.
*--fw-list-all*::
List all firewall rules including those that have nothing to do with
@@ -83,16 +83,16 @@ COMMAND-LINE OPTIONS
option allows the used to easily delete *fwknopd* firewall rules without
having to wait for them to be timed out.
*-K, --Kill*::
*-K, --kill*::
Kill the current *fwknopd* process. This provides a quick and easy
way to stop *fwknopd* without having to look in the process table.
*-l, --locale*='<locale>'::
Set/override the system default locale setting.
*-O, --Override-config*='<file>'::
*-O, --override-config*='<file>'::
Override config variable values that are normally read from the
'fwknopd.conf' file with values from the specified file. Multiple
'@sysconfdir@/fwknop/fwknopd.conf'' file with values from the specified file. Multiple
override config files can be given as a comma-separated list.
*-p, --pid-file*='<pid-file>'::
@@ -103,19 +103,30 @@ COMMAND-LINE OPTIONS
*-P, --pcap-filter*='<filter>'::
Specify a Berkeley packet filter statement on the *fwknopd* command
line. This overrides the value of the PCAP_FILTER variable taken
from the 'fwknopd.conf' file.
from the '@sysconfdir@/fwknop/fwknopd.conf'' file.
*--pcap-file*='<pcap-file>'::
This option instructs *fwknopd* to read packet data from a pcap file
instead of sniffing an interface directly. This mode is usually used for
debugging purposes, and will disable SPA packet age checking unless it is
manually enabled in the 'fwknop.conf' file.
manually enabled in the '@sysconfdir@/fwknop/fwknopd.conf' file.
*-R, --Restart*::
*--pcap-any-direction*::
Allow *fwknopd* to sniff SPA packets regardless of whether they are
received on the sniffing interface or sent from the sniffing interface. In
the later case, this can be useful to have fwknopd sniff SPA packets that
are forwarded through a system and destined for a different network. If
the sniffing interface is the egress interface for such packets (and hence
SPA packets are sent by this interface instead of received), then this
option will need to used in order for *fwknopd* to see them. The default
is to only sniff packets that are received on the sniffing interface. Note
that this setting is independent of promiscuous mode.
*-R, --restart*::
Restart the currently running *fwknopd* processes. This option
will preserve the command line options that were supplied to the
original *fwknopd* process but will force *fwknopd* to re-read the
'fwknopd.conf' and 'access.conf' files. This will also force a
'fwknopd.conf' and '@sysconfdir@/fwknop/access.conf' files. This will also force a
flush of the current ``FWKNOP'' iptables chain(s).
*--rotate-digest-cache*::
@@ -123,7 +134,7 @@ COMMAND-LINE OPTIONS
starting a new one. The digest cache file is typically found in
'@localstatedir@/run/fwknop/digest.cache'.
*-S, --Status*::
*-S, --status*::
Display the status of any *fwknopd* processes that may or not be
running.
@@ -141,12 +152,12 @@ COMMAND-LINE OPTIONS
FWKNOPD CONFIG AND ACCESS VARIABLES
-----------------------------------
*fwknopd* references the 'fwknopd.conf' file for configuration variables
*fwknopd* references the '@sysconfdir@/fwknop/fwknopd.conf'' file for configuration variables
that define its operational parameters (what network interface and port
to sniff, what features to enable/disable, etc.). The 'fwknopd.conf' file
does not define any access control directives.
The access control directives are contained in the 'access.conf' file.
The access control directives are contained in the '@sysconfdir@/fwknop/access.conf' file.
Access control directives define encryption keys and level of access that
is granted to an fwknop client that has generated the appropriate encrypted
SPA message.
@@ -157,7 +168,7 @@ This section list the more prominent configuration variables used by
*fwknopd*. It is not a complete list. There are directives for the type
of firewall used by *fwknopd* (i.e. _iptables_, _ipfw_, or _pf_). You will
want to make sure to check these to make sure they have appropriate values.
See the 'fwknopd.conf' file for the full list and corresponding details.
See the '@sysconfdir@/fwknop/fwknopd.conf'' file for the full list and corresponding details.
*PCAP_INTF* '<interface>'::
Specify the ethernet interface on which *fwknopd* will sniff packets.
@@ -208,7 +219,7 @@ See the 'fwknopd.conf' file for the full list and corresponding details.
firewall instead of just to it (i.e. access through the FWKNOP_FORWARD
chain instead of the INPUT chain).
*ENABLE_IPT_LOCAL_NAT* '>Y/N>'::
*ENABLE_IPT_LOCAL_NAT* '<Y/N>'::
Allow SPA clients to request access to a local socket via NAT. This
still puts an ACCEPT rule into the FWKNOP_INPUT chain, but a different
port is translated via DNAT rules to the real one. So, the user would
@@ -229,7 +240,7 @@ See the 'fwknopd.conf' file for the full list and corresponding details.
Specify the IP address for SNAT. This functionality is only enabled
when ``ENABLE_IPT_SNAT'' is set to ``Y'' and by default SNAT rules are
built with the MASQUERADE target (since then the internal IP does not
have to be defined here in the 'fwknopd.conf' file), but if you want
have to be defined here in the '@sysconfdir@/fwknop/fwknopd.conf'' file), but if you want
*fwknopd* to use the SNAT target, you must also define an IP address with
the ``SNAT_TRANSLATE_IP'' variable.
@@ -253,7 +264,7 @@ See the 'fwknopd.conf' file for the full list and corresponding details.
*GPG_HOME_DIR* '<path>'::
If GPG keys are used instead of a Rijndael symmetric key, this is
the default GPG keys directory. Note that each access block in
'access.conf' can specify its own GPG directory to override
'@sysconfdir@/fwknop/access.conf' can specify its own GPG directory to override
this default. If not set here or in an 'access.conf' stanza, then
the '$HOME/.gnupg' directory of the user running *fwknopd* (most
likely root).
@@ -290,7 +301,7 @@ See the 'fwknopd.conf' file for the full list and corresponding details.
non-zero integer. More information can be found in the *pcap_dispatch(3)*
man page.
*PCAP_LOOP_SLEEP* '<microseconds'::
*PCAP_LOOP_SLEEP* '<microseconds>'::
Sets the number of microseconds to passed as an argument to usleep() in
the pcap loop. The default is 10000, or 1/10th of a second.
@@ -309,7 +320,7 @@ See the 'fwknopd.conf' file for the full list and corresponding details.
ACCESS.CONF VARIABLES
~~~~~~~~~~~~~~~~~~~~~
This section describes the access control directives in the 'access.conf'
This section describes the access control directives in the '@sysconfdir@/fwknop/access.conf'
file. Theses directives define encryption keys and level of access that
is granted to *fwknop* clients that have generated the appropriate
encrypted message.
@@ -320,66 +331,88 @@ address or network range defined by the ``SOURCE'' variable. All variables
following ``SOURCE'' apply to the source 'stanza'. Each ``SOURCE''
directive starts a new stanza.
*SOURCE*: '<IP,..,IP/NET,..,NET/ANY>'::
*SOURCE* '<IP,..,IP/NET,..,NET/ANY>'::
This defines the source address from which the SPA packet will be
accepted. The string ``ANY'' is also accepted if a valid SPA packet
should be honored from any source IP. Every authorization stanza in
'access.conf' definition must start with the ``SOURCE'' keyword.
'@sysconfdir@/fwknop/access.conf' definition must start with the ``SOURCE'' keyword.
Networks should be specified in CIDR notation (e.g. ``192.168.10.0/24''),
and individual IP addresses can be specified as well. Also, multiple
IP's and/or networks can be defined as a comma separated list (e.g.
``192.168.10.0/24,10.1.1.123'')
*OPEN_PORTS*: '<proto/port>,...,<proto/port>'::
*OPEN_PORTS* '<proto/port>,...,<proto/port>'::
Define a set of ports and protocols (tcp or udp) that will be
opened if a valid knock sequence is seen. If this entry is not set,
*fwknopd* will attempt to honor any proto/port request specified in the
SPA data (unless of it matches any ``RESTRICT_PORTS'' entries). Multiple
entries are comma-separated.
*RESTRICT_PORTS*: '<proto/port>,...,<proto/port>'::
*RESTRICT_PORTS* '<proto/port>,...,<proto/port>'::
Define a set of ports and protocols (tcp or udp) that are explicitly
*not* allowed regardless of the validity of the incoming SPA packet.
Multiple entries are comma-separated.
*KEY*: '<password>'::
Define the key used for decrypting an incoming SPA packet that is using
its built-in (Rijndael) encryption. This variable is required for
all non-GPG-encrypted SPA packets.
*KEY* '<passphrase>'::
Define the symmetric key used for decrypting an incoming SPA packet that is
encrypted by the *fwknop* client with Rijndael. The actual encryption key
that is used is derived from the standard PBKDF1 algorithm. This variable
is required for all SPA packets unless GnuPG is used instead (see the GPG
variables below).
*FW_ACCESS_TIMEOUT*: '<seconds>'::
*KEY_BASE64* '<base64 encoded passphrase>'::
Same as the *KEY* option above, but specify the symmetric key as a base64
encoded string. This allows non-ascii characters to be included in the
base64-decoded key.
*HMAC_KEY* '<key>'::
Specify the HMAC key for authenticated encryption of SPA packets. This
supports both Rijndael and GPG encryption modes, and is applied according
to the encrypt-then-authenticate model.
*HMAC_KEY_BASE64* '<base64 encoded key>'::
Specify the HMAC key as a base64 encoded string. This allows non-ascii
characters to be included in the base64-decoded key.
*FW_ACCESS_TIMEOUT* '<seconds>'::
Define the length of time access will be granted by *fwknopd* through the
firewall after a valid knock sequence from a source IP address. If
``FW_ACCESS_TIMEOUT'' is not set then the default timeout of 30 seconds
will automatically be set.
*ENCRYPTION_MODE*: '<mode>'::
*ENCRYPTION_MODE* '<mode>'::
Specify the encryption mode when AES is used. The default is CBC mode,
but other modes can be selected such as OFB and CFB. In general, it is
recommended to not use this variable and leave it as the default. Note
that the string ``legacy'' can be specified in order to generate SPA
packets with the old initialization vector strategy used by versions of
*fwknop* before 2.5. With the 2.5 release, *fwknop* generates
initialization vectors in a manner that is compatible with OpenSSL.
*fwknop* before 2.5. With the 2.5 release, *fwknop* uses PBKDF1 for key
derivation.
*ENABLE_CMD_EXEC*: '<Y/N>'::
*HMAC_DIGEST_TYPE* '<digest algorithm>'::
Specify the digest algorithm for incoming SPA packet authentication. Must
be one of *MD5*, *SHA1*, *SHA256*, *SHA384*, or *SHA512*. This is an
optional field, and if not specified then *fwknopd* defaults to using
SHA256 if the access stanza requires an HMAC.
*ENABLE_CMD_EXEC* '<Y/N>'::
This instructs *fwknopd* to accept complete commands that are contained
within an authorization packet. Any such command will be executed on
the *fwknopd* server as the user specified by the ``CMD_EXEC_USER'' or
as the user that started *fwknopd* if that is not set.
*CMD_EXEC_USER*: '<username>'::
*CMD_EXEC_USER* '<username>'::
This specifies the user that will execute commands contained within a SPA
packet. If not specified, fwknopd will execute it as the user it is
running as (most likely root). Setting this to a non-root user is highly
recommended.
*REQUIRE_USERNAME*: '<username>'::
*REQUIRE_USERNAME* '<username>'::
Require a specific username from the client system as encoded in the SPA
data. This variable is optional and if not specified, the username data
in the SPA data is ignored.
*REQUIRE_SOURCE_ADDRESS*: '<Y/N>'::
*REQUIRE_SOURCE_ADDRESS* '<Y/N>'::
Force all SPA packets to contain a real IP address within the
encrypted data. This makes it impossible to use the *-s* command
line argument on the *fwknop* client command line, so either *-R* has
@@ -387,7 +420,7 @@ directive starts a new stanza.
client behind a NAT) or the client must know the external IP and set it
via the *-a* argument.
*FORCE_NAT*: '<IP> <PORT>'::
*FORCE_NAT* '<IP> <PORT>'::
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
@@ -395,14 +428,14 @@ directive starts a new stanza.
for each stanza in the access.conf file. This way, multiple external
users can each directly access only one internal system per SPA key.
*GPG_HOME_DIR*: '<path>'::
*GPG_HOME_DIR* '<path>'::
Define the path to the GnuPG directory to be used by the *fwknopd*
server. If this keyword is not specified within 'access.conf' then
server. If this keyword is not specified within '@sysconfdir@/fwknop/access.conf' then
*fwknopd* will default to using the '/root/.gnupg' directory for the
server key(s) for incoming SPA packets handled by the matching
'access.conf' stanza.
*GPG_DECRYPT_ID*: '<keyID>'::
*GPG_DECRYPT_ID* '<keyID>'::
Define a GnuPG key ID to use for decrypting SPA messages that
have been encrypted by an *fwknop* client. This keyword is
required for authentication that is based on GPG keys. The GPG
@@ -411,18 +444,18 @@ directive starts a new stanza.
personal GPG key on the client, but each *fwknopd* server should
have its own GPG key that is generated specifically for fwknop
communications. The reason for this is that the decryption
password for the server key must be placed within the 'access.conf'
password for the server key must be placed within the '@sysconfdir@/fwknop/access.conf'
file for *fwknopd* to function (it has to be able to decrypt SPA
messages that have been encrypted with the server's public key).
For more information on using fwknop with GnuPG keys, see the
following link: ``http://www.cipherdyne.org/fwknop/docs/gpghowto.html''.
*GPG_DECRYPT_PW*: '<decrypt password>'::
*GPG_DECRYPT_PW* '<decrypt password>'::
Specify the decryption password for the gpg key defined by the
``GPG_DECRYPT_ID'' above. This is a required field for gpg-based
authentication.
*GPG_ALLOW_NO_PW*: '<Y/N>'::
*GPG_ALLOW_NO_PW* '<Y/N>'::
Allow *fwknopd* to leverage a GnuPG key pair that does not have an
associated password. While this may sound like a controversial deployment
mode, in automated environments it makes sense because "there is usually no
@@ -432,19 +465,19 @@ directive starts a new stanza.
useful in some environments where libgpgme is forced to use gpg-agent
and/or pinentry to collect a passphrase.
*GPG_REQUIRE_SIG*: '<Y/N>'::
*GPG_REQUIRE_SIG* '<Y/N>'::
With this setting set to 'Y', fwknopd check all GPG-encrypted SPA
messages for a signature (signed by the sender's key). If the incoming
message is not signed, the decryption process will fail. If not set, the
default is 'N'.
*GPG_IGNORE_SIG_VERIFY_ERROR*: '<Y/N>'::
*GPG_IGNORE_SIG_VERIFY_ERROR* '<Y/N>'::
Setting this will allow fwknopd to accept incoming GPG-encrypted packets
that are signed, but the signature did not pass verification (i.e. the
signer key was expired, etc.). This setting only applies if the
GPG_REQUIRE_SIG is also set to 'Y'.
*GPG_REMOTE_ID*: '<keyID,...,keyID>'::
*GPG_REMOTE_ID* '<keyID,...,keyID>'::
Define a list of gpg key ID's that are required to have signed
any incoming SPA message that has been encrypted with the
*fwknopd* server key. This ensures that the verification of the
@@ -455,10 +488,10 @@ directive starts a new stanza.
FILES
-----
*fwknopd.conf*::
*@sysconfdir@/fwknop/fwknopd.conf*::
The main configuration file for fwknop.
*access.conf*::
*@sysconfdir@/fwknop/access.conf*::
Defines all knock sequences and access control directives.
@@ -536,13 +569,14 @@ Nomad at the BlackHat Briefings of 2005.
BUGS
----
Send bug reports to dstuart@dstuart.org or mbr@cipherdyne.org. Suggestions
and/or comments are always welcome as well.
Send bug reports to dstuart@dstuart.org or mbr@cipherdyne.org, or open a new
issue on Github (see 'https://github.com/mrash/fwknop.git'). Suggestions
and/or comments are always welcome as well. Additional information may be
found in the *fwknop* mailing list archives (see:
'https://lists.sourceforge.net/lists/listinfo/fwknop-discuss').
DISTRIBUTION
------------
*fwknopd* is distributed under the GNU General Public License (GPL), and
the latest version may be downloaded from 'http://www.cipherdyne.org'.
+98 -73
View File
@@ -2,12 +2,12 @@
.\" Title: fwknopd
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 05/19/2013
.\" Date: 05/20/2013
.\" Manual: Fwknop Server
.\" Source: Fwknop Server
.\" Language: English
.\"
.TH "FWKNOPD" "8" "05/19/2013" "Fwknop Server" "Fwknop Server"
.TH "FWKNOPD" "8" "05/20/2013" "Fwknop Server" "Fwknop Server"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -38,9 +38,30 @@ fwknopd \- Firewall Knock Operator Daemon
.sp
The main application of this program is to protect services such as \fISSH\fR with an additional layer of security in order to make the exploitation of vulnerabilities (both 0\-day and unpatched code) much more difficult\&. In addition, services that are protected in this fashion naturally cannot be scanned for with \fINmap\fR\&.
.sp
The main configuration for \fBfwknopd\fR is maintained within two files: \fIfwknopd\&.conf\fR and \fIaccess\&.conf\fR\&. The default location for these files is determined at package configuration (typically \fI@sysconfdir@/fwknop\fR)The configuration variables within these files are described below\&.
The main configuration for \fBfwknopd\fR is maintained within two files: \fIfwknopd\&.conf\fR and \fIaccess\&.conf\fR\&. The default location for these files is determined at package configuration (typically \fI@sysconfdir@/fwknop\fR)\&. The configuration variables within these files are described below\&.
.SH "COMMAND-LINE OPTIONS"
.PP
\fB\-i, \-\-interface\fR=\fI<interface>\fR
.RS 4
Manually specify interface on which to sniff, e\&.g\&. \(lq\-i eth0\(rq\&. This option is not usually needed because the \(lqPCAP_INTF\(rq keyword in the
\fIfwknopd\&.conf\fR
file defines the sniffing interface\&.
.RE
.PP
\fB\-f, \-\-foreground\fR
.RS 4
Run
\fBfwknopd\fR
in the foreground instead of becoming a daemon\&. When run in the foreground, message that would go to the log would instead be sent to stderr\&. This mode is usually used when testing and/or debugging\&.
.RE
.PP
\fB\-\-fw\-list\fR
.RS 4
List only firewall rules that any running
\fBfwknopd\fR
daemon has created and then exit\&.
.RE
.PP
\fB\-a, \-\-access\-file\fR=\fI<access\-file>\fR
.RS 4
Specify the location of the
@@ -72,41 +93,20 @@ Specify the location of the
\fIdigest\&.cache\fR
file\&. If this option is not given,
\fIfwknopd\fR
will use the compile\-time default location (typically \*(Aq@localstatedir@/run/fwknop/digest\&.cache)\&.
will use the compile\-time default location (typically
\fI@localstatedir@/run/fwknop/digest\&.cache\fR)\&.
.RE
.PP
\fB\-D, \-\-Dump\-config\fR
\fB\-D, \-\-dump\-config\fR
.RS 4
Dump the configuration values that
\fBfwknopd\fR
derives from the
\fIfwknopd\&.conf\fR
(or override files) and
\fIaccess\&.conf\fR
\fI@sysconfdir@/fwknop/fwknopd\&.conf\fR\*(Aq (or override files) and
\fI@sysconfdir@/fwknop/access\&.conf\fR
on stderr\&.
.RE
.PP
\fB\-i, \-\-interface\fR=\fI<interface>\fR
.RS 4
Manually specify interface on which to sniff, e\&.g\&. \(lq\-i eth0\(rq\&. This option is not usually needed because the \(lqPCAP_INTF\(rq keyword in the
\fIfwknopd\&.conf\fR
file defines the sniffing interface\&.
.RE
.PP
\fB\-f, \-\-foreground\fR
.RS 4
Run
\fBfwknopd\fR
in the foreground instead of becoming a daemon\&. When run in the foreground, message that would go to the log would instead be sent to stderr\&. This mode is usually used when testing and/or debugging\&.
.RE
.PP
\fB\-\-fw\-list\fR
.RS 4
List only firewall rules that any running
\fBfwknopd\fR
daemon has created and then exit\&.
.RE
.PP
\fB\-\-fw\-list\-all\fR
.RS 4
List all firewall rules including those that have nothing to do with
@@ -122,7 +122,7 @@ process\&. This option allows the used to easily delete
firewall rules without having to wait for them to be timed out\&.
.RE
.PP
\fB\-K, \-\-Kill\fR
\fB\-K, \-\-kill\fR
.RS 4
Kill the current
\fBfwknopd\fR
@@ -136,11 +136,10 @@ without having to look in the process table\&.
Set/override the system default locale setting\&.
.RE
.PP
\fB\-O, \-\-Override\-config\fR=\fI<file>\fR
\fB\-O, \-\-override\-config\fR=\fI<file>\fR
.RS 4
Override config variable values that are normally read from the
\fIfwknopd\&.conf\fR
file with values from the specified file\&. Multiple override config files can be given as a comma\-separated list\&.
\fI@sysconfdir@/fwknop/fwknopd\&.conf\fR\*(Aq file with values from the specified file\&. Multiple override config files can be given as a comma\-separated list\&.
.RE
.PP
\fB\-p, \-\-pid\-file\fR=\fI<pid\-file>\fR
@@ -157,8 +156,7 @@ will use the compile\-time default location (typically \*(Aq@localstatedir@/run/
Specify a Berkeley packet filter statement on the
\fBfwknopd\fR
command line\&. This overrides the value of the PCAP_FILTER variable taken from the
\fIfwknopd\&.conf\fR
file\&.
\fI@sysconfdir@/fwknop/fwknopd\&.conf\fR\*(Aq file\&.
.RE
.PP
\fB\-\-pcap\-file\fR=\fI<pcap\-file>\fR
@@ -166,11 +164,20 @@ file\&.
This option instructs
\fBfwknopd\fR
to read packet data from a pcap file instead of sniffing an interface directly\&. This mode is usually used for debugging purposes, and will disable SPA packet age checking unless it is manually enabled in the
\fIfwknop\&.conf\fR
\fI@sysconfdir@/fwknop/fwknopd\&.conf\fR
file\&.
.RE
.PP
\fB\-R, \-\-Restart\fR
\fB\-\-pcap\-any\-direction\fR
.RS 4
Allow
\fBfwknopd\fR
to sniff SPA packets regardless of whether they are received on the sniffing interface or sent from the sniffing interface\&. In the later case, this can be useful to have fwknopd sniff SPA packets that are forwarded through a system and destined for a different network\&. If the sniffing interface is the egress interface for such packets (and hence SPA packets are sent by this interface instead of received), then this option will need to used in order for
\fBfwknopd\fR
to see them\&. The default is to only sniff packets that are received on the sniffing interface\&. Note that this setting is independent of promiscuous mode\&.
.RE
.PP
\fB\-R, \-\-restart\fR
.RS 4
Restart the currently running
\fBfwknopd\fR
@@ -181,7 +188,7 @@ process but will force
to re\-read the
\fIfwknopd\&.conf\fR
and
\fIaccess\&.conf\fR
\fI@sysconfdir@/fwknop/access\&.conf\fR
files\&. This will also force a flush of the current \(lqFWKNOP\(rq iptables chain(s)\&.
.RE
.PP
@@ -191,7 +198,7 @@ Rotate the digest cache file by renaming it to \(lq<name>\-old\(rq, and starting
\fI@localstatedir@/run/fwknop/digest\&.cache\fR\&.
.RE
.PP
\fB\-S, \-\-Status\fR
\fB\-S, \-\-status\fR
.RS 4
Display the status of any
\fBfwknopd\fR
@@ -216,12 +223,12 @@ Display version information and exit\&.
.RE
.SH "FWKNOPD CONFIG AND ACCESS VARIABLES"
.sp
\fBfwknopd\fR references the \fIfwknopd\&.conf\fR file for configuration variables that define its operational parameters (what network interface and port to sniff, what features to enable/disable, etc\&.)\&. The \fIfwknopd\&.conf\fR file does not define any access control directives\&.
\fBfwknopd\fR references the \fI@sysconfdir@/fwknop/fwknopd\&.conf\fR\*(Aq file for configuration variables that define its operational parameters (what network interface and port to sniff, what features to enable/disable, etc\&.)\&. The \fIfwknopd\&.conf\fR file does not define any access control directives\&.
.sp
The access control directives are contained in the \fIaccess\&.conf\fR file\&. Access control directives define encryption keys and level of access that is granted to an fwknop client that has generated the appropriate encrypted SPA message\&.
The access control directives are contained in the \fI@sysconfdir@/fwknop/access\&.conf\fR file\&. Access control directives define encryption keys and level of access that is granted to an fwknop client that has generated the appropriate encrypted SPA message\&.
.SS "FWKNOPD\&.CONF VARIABLES"
.sp
This section list the more prominent configuration variables used by \fBfwknopd\fR\&. It is not a complete list\&. There are directives for the type of firewall used by \fBfwknopd\fR (i\&.e\&. \fIiptables\fR, \fIipfw\fR, or \fIpf\fR)\&. You will want to make sure to check these to make sure they have appropriate values\&. See the \fIfwknopd\&.conf\fR file for the full list and corresponding details\&.
This section list the more prominent configuration variables used by \fBfwknopd\fR\&. It is not a complete list\&. There are directives for the type of firewall used by \fBfwknopd\fR (i\&.e\&. \fIiptables\fR, \fIipfw\fR, or \fIpf\fR)\&. You will want to make sure to check these to make sure they have appropriate values\&. See the \fI@sysconfdir@/fwknop/fwknopd\&.conf\fR\*(Aq file for the full list and corresponding details\&.
.PP
\fBPCAP_INTF\fR \fI<interface>\fR
.RS 4
@@ -313,8 +320,7 @@ is running\&.
\fBSNAT_TRANSLATE_IP\fR \fI<ip_address>\fR
.RS 4
Specify the IP address for SNAT\&. This functionality is only enabled when \(lqENABLE_IPT_SNAT\(rq is set to \(lqY\(rq and by default SNAT rules are built with the MASQUERADE target (since then the internal IP does not have to be defined here in the
\fIfwknopd\&.conf\fR
file), but if you want
\fI@sysconfdir@/fwknop/fwknopd\&.conf\fR\*(Aq file), but if you want
\fBfwknopd\fR
to use the SNAT target, you must also define an IP address with the \(lqSNAT_TRANSLATE_IP\(rq variable\&.
.RE
@@ -346,7 +352,7 @@ is stopped or otherwise exits cleanly\&. The default is \(lqY\(rq\&.
\fBGPG_HOME_DIR\fR \fI<path>\fR
.RS 4
If GPG keys are used instead of a Rijndael symmetric key, this is the default GPG keys directory\&. Note that each access block in
\fIaccess\&.conf\fR
\fI@sysconfdir@/fwknop/access\&.conf\fR
can specify its own GPG directory to override this default\&. If not set here or in an
\fIaccess\&.conf\fR
stanza, then the
@@ -389,7 +395,7 @@ is running on a platform with an old version of libpcap, it may be necessary to
man page\&.
.RE
.PP
\fBPCAP_LOOP_SLEEP\fR \fI<microseconds\fR
\fBPCAP_LOOP_SLEEP\fR \fI<microseconds>\fR
.RS 4
Sets the number of microseconds to passed as an argument to usleep() in the pcap loop\&. The default is 10000, or 1/10th of a second\&.
.RE
@@ -411,53 +417,72 @@ Override syslog facility\&. The \(lqSYSLOG_FACILITY\(rq variable can be set to
.RE
.SS "ACCESS\&.CONF VARIABLES"
.sp
This section describes the access control directives in the \fIaccess\&.conf\fR file\&. Theses directives define encryption keys and level of access that is granted to \fBfwknop\fR clients that have generated the appropriate encrypted message\&.
This section describes the access control directives in the \fI@sysconfdir@/fwknop/access\&.conf\fR file\&. Theses directives define encryption keys and level of access that is granted to \fBfwknop\fR clients that have generated the appropriate encrypted message\&.
.sp
The \fIaccess\&.conf\fR variables described below provide the access directives for the SPA packets with a source (or embedded request) IP that matches an address or network range defined by the \(lqSOURCE\(rq variable\&. All variables following \(lqSOURCE\(rq apply to the source \fIstanza\fR\&. Each \(lqSOURCE\(rq directive starts a new stanza\&.
.PP
\fBSOURCE\fR: \fI<IP,\&.\&.,IP/NET,\&.\&.,NET/ANY>\fR
\fBSOURCE\fR \fI<IP,\&.\&.,IP/NET,\&.\&.,NET/ANY>\fR
.RS 4
This defines the source address from which the SPA packet will be accepted\&. The string \(lqANY\(rq is also accepted if a valid SPA packet should be honored from any source IP\&. Every authorization stanza in
\fIaccess\&.conf\fR
\fI@sysconfdir@/fwknop/access\&.conf\fR
definition must start with the \(lqSOURCE\(rq keyword\&. Networks should be specified in CIDR notation (e\&.g\&. \(lq192\&.168\&.10\&.0/24\(rq), and individual IP addresses can be specified as well\&. Also, multiple IP\(cqs and/or networks can be defined as a comma separated list (e\&.g\&. \(lq192\&.168\&.10\&.0/24,10\&.1\&.1\&.123\(rq)
.RE
.PP
\fBOPEN_PORTS\fR: \fI<proto/port>,\&...,<proto/port>\fR
\fBOPEN_PORTS\fR \fI<proto/port>,\&...,<proto/port>\fR
.RS 4
Define a set of ports and protocols (tcp or udp) that will be opened if a valid knock sequence is seen\&. If this entry is not set,
\fBfwknopd\fR
will attempt to honor any proto/port request specified in the SPA data (unless of it matches any \(lqRESTRICT_PORTS\(rq entries)\&. Multiple entries are comma\-separated\&.
.RE
.PP
\fBRESTRICT_PORTS\fR: \fI<proto/port>,\&...,<proto/port>\fR
\fBRESTRICT_PORTS\fR \fI<proto/port>,\&...,<proto/port>\fR
.RS 4
Define a set of ports and protocols (tcp or udp) that are explicitly
\fBnot\fR
allowed regardless of the validity of the incoming SPA packet\&. Multiple entries are comma\-separated\&.
.RE
.PP
\fBKEY\fR: \fI<password>\fR
\fBKEY\fR \fI<passphrase>\fR
.RS 4
Define the key used for decrypting an incoming SPA packet that is using its built\-in (Rijndael) encryption\&. This variable is required for all non\-GPG\-encrypted SPA packets\&.
Define the symmetric key used for decrypting an incoming SPA packet that is encrypted by the
\fBfwknop\fR
client with Rijndael\&. The actual encryption key that is used is derived from the standard PBKDF1 algorithm\&. This variable is required for all SPA packets unless GnuPG is used instead (see the GPG variables below)\&.
.RE
.PP
\fBFW_ACCESS_TIMEOUT\fR: \fI<seconds>\fR
\fBKEY_BASE64\fR \fI<base64 encoded passphrase>\fR
.RS 4
Same as the
\fBKEY\fR
option above, but specify the symmetric key as a base64 encoded string\&. This allows non\-ascii characters to be included in the base64\-decoded key\&.
.RE
.PP
\fBHMAC_KEY\fR \fI<key>\fR
.RS 4
Specify the HMAC key for authenticated encryption of SPA packets\&. This supports both Rijndael and GPG encryption modes, and is applied according to the encrypt\-then\-authenticate model\&.
.RE
.PP
\fBHMAC_KEY_BASE64\fR \fI<base64 encoded key>\fR
.RS 4
Specify the HMAC key as a base64 encoded string\&. This allows non\-ascii characters to be included in the base64\-decoded key\&.
.RE
.PP
\fBFW_ACCESS_TIMEOUT\fR \fI<seconds>\fR
.RS 4
Define the length of time access will be granted by
\fBfwknopd\fR
through the firewall after a valid knock sequence from a source IP address\&. If \(lqFW_ACCESS_TIMEOUT\(rq is not set then the default timeout of 30 seconds will automatically be set\&.
.RE
.PP
\fBENCRYPTION_MODE\fR: \fI<mode>\fR
\fBENCRYPTION_MODE\fR \fI<mode>\fR
.RS 4
Specify the encryption mode when AES is used\&. The default is CBC mode, but other modes can be selected such as OFB and CFB\&. In general, it is recommended to not use this variable and leave it as the default\&. Note that the string \(lqlegacy\(rq can be specified in order to generate SPA packets with the old initialization vector strategy used by versions of
\fBfwknop\fR
before 2\&.5\&. With the 2\&.5 release,
\fBfwknop\fR
generates initialization vectors in a manner that is compatible with OpenSSL\&.
uses PBKDF1 for key derivation\&.
.RE
.PP
\fBENABLE_CMD_EXEC\fR: \fI<Y/N>\fR
\fBENABLE_CMD_EXEC\fR \fI<Y/N>\fR
.RS 4
This instructs
\fBfwknopd\fR
@@ -468,17 +493,17 @@ server as the user specified by the \(lqCMD_EXEC_USER\(rq or as the user that st
if that is not set\&.
.RE
.PP
\fBCMD_EXEC_USER\fR: \fI<username>\fR
\fBCMD_EXEC_USER\fR \fI<username>\fR
.RS 4
This specifies the user that will execute commands contained within a SPA packet\&. If not specified, fwknopd will execute it as the user it is running as (most likely root)\&. Setting this to a non\-root user is highly recommended\&.
.RE
.PP
\fBREQUIRE_USERNAME\fR: \fI<username>\fR
\fBREQUIRE_USERNAME\fR \fI<username>\fR
.RS 4
Require a specific username from the client system as encoded in the SPA data\&. This variable is optional and if not specified, the username data in the SPA data is ignored\&.
.RE
.PP
\fBREQUIRE_SOURCE_ADDRESS\fR: \fI<Y/N>\fR
\fBREQUIRE_SOURCE_ADDRESS\fR \fI<Y/N>\fR
.RS 4
Force all SPA packets to contain a real IP address within the encrypted data\&. This makes it impossible to use the
\fB\-s\fR
@@ -491,17 +516,17 @@ has to be used to automatically resolve the external address (if the client behi
argument\&.
.RE
.PP
\fBFORCE_NAT\fR: \fI<IP> <PORT>\fR
\fBFORCE_NAT\fR \fI<IP> <PORT>\fR
.RS 4
For any valid SPA packet, force the requested connection to be NAT\(cqd 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\&.
.RE
.PP
\fBGPG_HOME_DIR\fR: \fI<path>\fR
\fBGPG_HOME_DIR\fR \fI<path>\fR
.RS 4
Define the path to the GnuPG directory to be used by the
\fBfwknopd\fR
server\&. If this keyword is not specified within
\fIaccess\&.conf\fR
\fI@sysconfdir@/fwknop/access\&.conf\fR
then
\fBfwknopd\fR
will default to using the
@@ -511,7 +536,7 @@ directory for the server key(s) for incoming SPA packets handled by the matching
stanza\&.
.RE
.PP
\fBGPG_DECRYPT_ID\fR: \fI<keyID>\fR
\fBGPG_DECRYPT_ID\fR \fI<keyID>\fR
.RS 4
Define a GnuPG key ID to use for decrypting SPA messages that have been encrypted by an
\fBfwknop\fR
@@ -520,38 +545,38 @@ client\&. This keyword is required for authentication that is based on GPG keys\
server key, and vice versa\&. It is ok to use a sensitive personal GPG key on the client, but each
\fBfwknopd\fR
server should have its own GPG key that is generated specifically for fwknop communications\&. The reason for this is that the decryption password for the server key must be placed within the
\fIaccess\&.conf\fR
\fI@sysconfdir@/fwknop/access\&.conf\fR
file for
\fBfwknopd\fR
to function (it has to be able to decrypt SPA messages that have been encrypted with the server\(cqs public key)\&. For more information on using fwknop with GnuPG keys, see the following link: \(lqhttp://www\&.cipherdyne\&.org/fwknop/docs/gpghowto\&.html\(rq\&.
.RE
.PP
\fBGPG_DECRYPT_PW\fR: \fI<decrypt password>\fR
\fBGPG_DECRYPT_PW\fR \fI<decrypt password>\fR
.RS 4
Specify the decryption password for the gpg key defined by the \(lqGPG_DECRYPT_ID\(rq above\&. This is a required field for gpg\-based authentication\&.
.RE
.PP
\fBGPG_ALLOW_NO_PW\fR: \fI<Y/N>\fR
\fBGPG_ALLOW_NO_PW\fR \fI<Y/N>\fR
.RS 4
Allow
\fBfwknopd\fR
to leverage a GnuPG key pair that does not have an associated password\&. While this may sound like a controversial deployment mode, in automated environments it makes sense because "there is usually no way to store a password more securely than on the secret keyring itself" according to: \(lqhttp://www\&.gnupg\&.org/faq/GnuPG\-FAQ\&.html#how\-can\-i\-use\-gnupg\-in\-an\-automated\-environment\(rq\&. Using this feature and removing the passphrase from a GnuPG key pair is useful in some environments where libgpgme is forced to use gpg\-agent and/or pinentry to collect a passphrase\&.
.RE
.PP
\fBGPG_REQUIRE_SIG\fR: \fI<Y/N>\fR
\fBGPG_REQUIRE_SIG\fR \fI<Y/N>\fR
.RS 4
With this setting set to
\fIY\fR, fwknopd check all GPG\-encrypted SPA messages for a signature (signed by the sender\(cqs key)\&. If the incoming message is not signed, the decryption process will fail\&. If not set, the default is
\fIN\fR\&.
.RE
.PP
\fBGPG_IGNORE_SIG_VERIFY_ERROR\fR: \fI<Y/N>\fR
\fBGPG_IGNORE_SIG_VERIFY_ERROR\fR \fI<Y/N>\fR
.RS 4
Setting this will allow fwknopd to accept incoming GPG\-encrypted packets that are signed, but the signature did not pass verification (i\&.e\&. the signer key was expired, etc\&.)\&. This setting only applies if the GPG_REQUIRE_SIG is also set to
\fIY\fR\&.
.RE
.PP
\fBGPG_REMOTE_ID\fR: \fI<keyID,\&...,keyID>\fR
\fBGPG_REMOTE_ID\fR \fI<keyID,\&...,keyID>\fR
.RS 4
Define a list of gpg key ID\(cqs that are required to have signed any incoming SPA message that has been encrypted with the
\fBfwknopd\fR
@@ -560,12 +585,12 @@ server key\&. This ensures that the verification of the remote user is accomplis
.RE
.SH "FILES"
.PP
\fBfwknopd\&.conf\fR
\fB@sysconfdir@/fwknop/fwknopd\&.conf\fR
.RS 4
The main configuration file for fwknop\&.
.RE
.PP
\fBaccess\&.conf\fR
\fB@sysconfdir@/fwknop/access\&.conf\fR
.RS 4
Defines all knock sequences and access control directives\&.
.RE
@@ -610,7 +635,7 @@ This \(lqC\(rq version of fwknop was derived from the original Perl\-based versi
The phrase \(lqSingle Packet Authorization\(rq was coined by MadHat and Simple Nomad at the BlackHat Briefings of 2005\&.
.SH "BUGS"
.sp
Send bug reports to dstuart@dstuart\&.org or mbr@cipherdyne\&.org\&. Suggestions and/or comments are always welcome as well\&.
Send bug reports to dstuart@dstuart\&.org or mbr@cipherdyne\&.org, or open a new issue on Github (see \fIhttps://github\&.com/mrash/fwknop\&.git\fR)\&. Suggestions and/or comments are always welcome as well\&. Additional information may be found in the \fBfwknop\fR mailing list archives (see: \fIhttps://lists\&.sourceforge\&.net/lists/listinfo/fwknop\-discuss\fR)\&.
.SH "DISTRIBUTION"
.sp
\fBfwknopd\fR is distributed under the GNU General Public License (GPL), and the latest version may be downloaded from \fIhttp://www\&.cipherdyne\&.org\fR\&.