diff --git a/CREDITS b/CREDITS index 0019b1f2..ce0b4506 100644 --- a/CREDITS +++ b/CREDITS @@ -124,3 +124,7 @@ Shawn Wilson - Added better SPA source IP logging for various fwknopd logging messages. This helps to make it more clear why certain SPA packets are rejected from some systems. + +Dan Lauber + - Suggested a check for fwknopd to ensure that the jump rule on systems + running iptables is not duplicated if it already exists. diff --git a/ChangeLog b/ChangeLog index 2671927f..e3e26b67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,10 +2,14 @@ fwknop-2.5 (//2013): - Major release of new functionality - HMAC authenticated encryption support in the encrypt-then-authenticate model for SPA communications. Supported HMAC digests include MD5, SHA1, SHA256, SHA384, and SHA512. - The default is HMAC-SHA256 when HMAC is used. HMAC is supported for both - Rijndael and GPG encrypted SPA packet data, and provides a significant - security benefit since the HMAC verification is more simplisitic than - decryption operations (particularly for GPG). + The default is HMAC-SHA256 when an HMAC is used. The HMAC mode is + supported for both Rijndael and GPG encrypted SPA packet data, and + provides a significant security benefit for the fwknopd server since the + HMAC verification is more simplisitic than decryption operations. This + is particularly true for GPG. Beyond this, HMAC authenticated + encryption in the encrypt-then-authenticate mode does not suffer from + things like CBC-mode padding oracle attacks (see the Vaudenay attack and + the more recent "Lucky 13" attack against SSL). - [libfko] Significant bug fix to honor the full encryption key length for user-supplied Rijndael keys > 16 bytes long. Previous to this fix, only the first 16 bytes of a key were actually used in the encryption/ @@ -13,13 +17,15 @@ fwknop-2.5 (//2013): a weakening of expected security for users that had keys > 16 bytes, although this is probably not too common. Note that "passphrase" is perhaps technically a better word for "user-supplied key" in this - context since Rijndael in CBC mode derives a real encryption/decryption - key from the passphrase through a series of applications of md5 against - the passphrase and a random salt. This issue was reported by Michael T. - Dean. Closes issue #18 on github. + context since the actual key is generated with the PBKDF1 key derivation + algorithm. This issue was reported by Michael T. Dean. Closes issue #18 + on github. - [libfko] Added the ability to maintain backwards compatibility with the now deprecated "zero padding" key derivation strategy in AES mode that - was a hold over from the old perl fwknop implementation. + was a hold over from the old perl fwknop implementation. This is NOT + compliant with PBKDF1 and is only brought forward into fwknop-2.5 for + backwards compatibility. Future versions of fwknop will remove this + code altogether since PBKDF1 is now implemented. - [test suite] Added --enable-openssl-checks to send all SPA packets encrypted via libfko through the OpenSSL library to ensure that the libfko usage of AES is always compatible with OpenSSL. This ensures diff --git a/Makefile.am b/Makefile.am index fa48c3d8..84560454 100644 --- a/Makefile.am +++ b/Makefile.am @@ -151,6 +151,7 @@ EXTRA_DIST = \ test/conf/hmac_access.conf \ test/conf/hmac_get_key_access.conf \ test/conf/hmac_no_b64_access.conf \ + test/conf/hmac_equal_keys_access.conf \ test/conf/hmac_dual_key_usage_access.conf \ test/conf/hmac_invalid_type_access.conf \ test/conf/hmac_md5_access.conf \ @@ -176,6 +177,7 @@ EXTRA_DIST = \ test/conf/fwknoprc_default_hmac_base64_key \ test/conf/fwknoprc_hmac_key2 \ test/conf/fwknoprc_gpg_hmac_key \ + test/conf/fwknoprc_hmac_equal_keys \ test/conf/fwknoprc_hmac_invalid_type \ test/conf/fwknoprc_hmac_md5_key \ test/conf/fwknoprc_hmac_md5_long_key \ diff --git a/client/config_init.c b/client/config_init.c index 220d24ec..4c49efb7 100644 --- a/client/config_init.c +++ b/client/config_init.c @@ -507,13 +507,15 @@ create_fwknoprc(const char *rcfile) "#\n" "# Each section (or stanza) is identified and started by a line in this\n" "# file that contains a single identifier surrounded by square brackets.\n" + "# It is this identifier (or name) that is used from the fwknop command line\n" + "# via the '-n ' argument to reference the corresponding stanza.\n" "#\n" "# The parameters within the stanza typicaly match corresponding client \n" "# command-line parameters.\n" "#\n" "# The first one should always be `[default]' as it defines the global\n" "# default settings for the user. These override the program defaults\n" - "# for these parameter. If a named stanza is used, its entries will\n" + "# for these parameters. If a named stanza is used, its entries will\n" "# override any of the default. Command-line options will trump them\n" "# all.\n" "#\n" @@ -1285,6 +1287,26 @@ update_rc(fko_cli_options_t *options, uint32_t args_bitmask) static void validate_options(fko_cli_options_t *options) { + + if ( (options->use_rc_stanza[0] != 0x0) + && (options->got_named_stanza == 0) + && (options->save_rc_stanza == 0) ) + { + log_msg(LOG_VERBOSITY_ERROR, + "Named configuration stanza: [%s] was not found.", + options->use_rc_stanza); + + exit(EXIT_FAILURE); + } + + if ( (options->save_rc_stanza == 1) && (options->use_rc_stanza[0] == 0) ) + { + log_msg(LOG_VERBOSITY_ERROR, + "The option --save-rc-stanza must be used with the " + "--named-config option to specify the stanza to update."); + exit(EXIT_FAILURE); + } + /* Gotta have a Destination unless we are just testing or getting the * the version, and must use one of [-s|-R|-a]. */ @@ -1304,33 +1326,23 @@ validate_options(fko_cli_options_t *options) if (options->resolve_url != NULL) options->resolve_ip_http = 1; - if (!options->resolve_ip_http && options->allow_ip_str[0] == 0x0) + if (!options->resolve_ip_http) { - log_msg(LOG_VERBOSITY_ERROR, - "Must use one of [-s|-R|-a] to specify IP for SPA access."); - exit(EXIT_FAILURE); + if(options->allow_ip_str[0] == 0x0) + { + log_msg(LOG_VERBOSITY_ERROR, + "Must use one of [-s|-R|-a] to specify IP for SPA access."); + exit(EXIT_FAILURE); + } + else if(options->verbose + && strncmp(options->allow_ip_str, "0.0.0.0", strlen("0.0.0.0")) == 0) + { + log_msg(LOG_VERBOSITY_WARNING, + "[-] WARNING: Should use -a or -R to harden SPA against potential MITM attacks"); + } } } - if ( (options->use_rc_stanza[0] != 0x0) - && (options->got_named_stanza == 0) - && (options->save_rc_stanza == 0) ) - { - log_msg(LOG_VERBOSITY_ERROR, - "Named configuration stanza: [%s] was not found.", - options->use_rc_stanza); - - exit(EXIT_FAILURE); - } - - if ( (options->save_rc_stanza == 1) && (options->use_rc_stanza[0] == 0) ) - { - log_msg(LOG_VERBOSITY_ERROR, - "The option --save-rc-stanza must be used with the " - "--named-config option to specify the stanza to update."); - exit(EXIT_FAILURE); - } - if(options->resolve_ip_http || options->spa_proto == FKO_PROTO_HTTP) if (options->http_user_agent[0] == '\0') snprintf(options->http_user_agent, HTTP_MAX_USER_AGENT_LEN, @@ -1360,6 +1372,9 @@ validate_options(fko_cli_options_t *options) if(options->use_hmac && options->hmac_type == FKO_HMAC_UNKNOWN) options->hmac_type = FKO_DEFAULT_HMAC_MODE; + if(options->key_gen && options->hmac_type == FKO_HMAC_UNKNOWN) + options->hmac_type = FKO_DEFAULT_HMAC_MODE; + return; } @@ -1410,8 +1425,10 @@ config_init(fko_cli_options_t *options, int argc, char **argv) case 'h': usage(); exit(EXIT_SUCCESS); - case 'n': + case NO_SAVE_ARGS: options->no_save_args = 1; + break; + case 'n': strlcpy(options->use_rc_stanza, optarg, sizeof(options->use_rc_stanza)); break; case SAVE_RC_STANZA: @@ -1492,7 +1509,7 @@ config_init(fko_cli_options_t *options, int argc, char **argv) strlcpy(options->get_key_file, optarg, sizeof(options->get_key_file)); cli_arg_bitmask |= FWKNOP_CLI_ARG_BM(FWKNOP_CLI_ARG_KEY_FILE); break; - case GET_HMAC_KEY: + case GET_HMAC_KEY: strlcpy(options->get_hmac_key_file, optarg, sizeof(options->get_hmac_key_file)); options->use_hmac = 1; diff --git a/client/fwknop.c b/client/fwknop.c index eb4c2f72..e60c72a9 100644 --- a/client/fwknop.c +++ b/client/fwknop.c @@ -205,10 +205,19 @@ main(int argc, char **argv) */ if(options.key_gen) { - fko_key_gen(options.key_base64, options.key_len, + memset(options.key_base64, 0x00, MAX_B64_KEY_LEN+1); + memset(options.hmac_key_base64, 0x00, MAX_B64_KEY_LEN+1); + + res = fko_key_gen(options.key_base64, options.key_len, options.hmac_key_base64, options.hmac_key_len, options.hmac_type); + if(res != FKO_SUCCESS) + { + errmsg("fko_key_gen", res); + return(EXIT_FAILURE); + } + if(options.key_gen_file[0] != '\0') { if ((key_gen_file_ptr = fopen(options.key_gen_file, "w")) == NULL) @@ -1263,6 +1272,18 @@ get_keys(fko_ctx_t ctx, fko_cli_options_t *options, clean_exit(ctx, options, EXIT_FAILURE); } + /* Make sure the same key is not used for both encryption and the HMAC + */ + if(*hmac_key_len == *key_len) + { + if(memcmp(hmac_key, key, *key_len) == 0) + { + log_msg(LOG_VERBOSITY_ERROR, + "[*] The encryption passphrase and HMAC key should not be identical, no SPA packet sent. Exiting."); + clean_exit(ctx, options, EXIT_FAILURE); + } + } + res = fko_set_spa_hmac_type(ctx, options->hmac_type); if(res != FKO_SUCCESS) { diff --git a/doc/fwknop.man.asciidoc b/doc/fwknop.man.asciidoc index b6cb6e2c..7090d204 100644 --- a/doc/fwknop.man.asciidoc +++ b/doc/fwknop.man.asciidoc @@ -16,40 +16,56 @@ SYNOPSIS DESCRIPTION ----------- *fwknop* implements an authorization scheme known as Single Packet -Authorization (SPA) for Linux systems running iptables. This mechanism -requires only a single encrypted and non-replayed packet to communicate -various pieces of information including desired access through an iptables -or ipfw policy. The main application of this program is to use iptables -in a default-drop stance to protect services such as 'SSH' with an +Authorization (SPA) for passive service protection. SPA requires only a single +non-replayed encrypted packet together with an HMAC in order to communicate +various pieces of information including desired access to a service that is +otherwise blocked by a firewall. The main application of SPA is to use a +firewall in a default-drop stance to protect services such as 'SSH' with an additional layer of security in order to make the exploitation of -vulnerabilities (both 0-day and unpatched code) much more difficult. +vulnerabilities (both 0-day and unpatched code) more difficult. In +addition, services that are protected in this fashion naturally cannot be +scanned for with 'Nmap'. -An authorization server *fwknopd* passively monitors authorization packets -via 'libpcap' and hence there is no ``server'' to which to connect in the -traditional sense. Any service protected by *fwknop* is inaccessible (by -using 'iptables' or 'ipfw' to intercept packets within the kernel) before -authenticating; anyone scanning for the service will not be able to detect -that it is even listening. Single Packet Authorization offers many -advantages over port knocking, including non-replayability of SPA packets, -ability to use asymmetric ciphers (such as Elgamal), and SPA cannot be -broken by simply spoofing packets to duplicate ports within the knock -sequence on the server to break port knocking authentication. +SPA is essentially next generation Port Knocking (PK), but solves many of the +limitations exhibited by PK while retaining its core benefits. PK limitations +include a general difficulty in protecting against replay attacks, asymmetric +ciphers and HMAC schemes are not usually supported, and it is trivially easy +to mount a DoS attack against a PK server just by spoofing an additional +packet into a PK sequence as it traverses the network (thereby convincing the +PK server that the client doesn't know the proper sequence). All of these +limitation are solved by SPA. At the same time, SPA hides services behind a +default-drop firewall policy, acquires SPA data passively (usually via +libpcap or other means), and implements lightweight cryptographic operations +for SPA packet authentication and encryption/decryption. -SPA packets can easily be spoofed as well (this is a good thing in this -context), and this makes it possible to make it appear as though, say, -www.yahoo.com is trying to authenticate to a target system but in reality -the actual connection will come from a seemingly unrelated IP. +This is the manual page for the *fwknop* client which is responsible for +constructing SPA packets and sending them over the network. The server side is +implemented by the *fwknopd* daemon which sniffs the network for SPA packets, +and it is recommended to read the 'fwknopd(8)' manual page as well. -Authorization packets are either encrypted with the 'Rijndael' block cipher -or via 'GnuPG' and associated asymmetric ciphers. If the symmetric encryption -method is chosen, then the encryption key is shared between the client and -server (see the fwknopd 'access.conf' file for details). If the GnuPG method +SPA packets generated by *fwknop* 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: '1)' without +an HMAC, cryptographically strong authentication is not possible with *fwknop* +unless GnuPG is used, '2)' 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 '3)' the code required by the *fwknopd* +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't even +sent through the decryption routines. Generating an HMAC for SPA +communications 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). 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 they are encrypted): +format (before encryption and the HMAC is applied): .......................... - random number (16 bytes) + random data (16 bytes) username timestamp software version @@ -59,38 +75,37 @@ format (before they are encrypted): message digest (SHA512 / SHA384 / SHA256 / SHA1 / MD5) .......................... -Each of the above fields are separated by a ":" character due to the -variable length of several of the fields, and those that might contain -":" characters are base64 encoded. The message digest (*SHA256* by -default in all versions of *fwknop* greater than 1.9.1) allows the server -to check message integrity after decryption, and the 16 bytes of random data -ensures (with high probability) that no two messages are identical. This -ensures that replay attacks are not possible against *fwknop*. - -For each packet coming from an *fwknop* client, the *fwknopd* server can -cache the digest calculated over the entire packet and compares against -previous packet digests in order to detect attempted replay attacks. Syslog +Each of the above fields are separated by a ":" character due to the variable +length of several of the fields, and those that might contain ":" characters +are base64 encoded. The message digest (*SHA256* by default) is part of the +data to be encrypted and is independent of the HMAC which is appended to the +SPA packet data after encryption. The 16 bytes of random data ensures that no +two SPA packets are identical, and this is in addition to and independent of +using PBKDF1 for key derivation for Rijndael in CBC mode. Because *fwknopd* +tracks the SHA256 digest of all incoming valid SPA packets and throws out +duplicates, replay attacks are not feasible against *fwknop*. Syslog alerts are generated if a replay is detected. By default, the *fwknop* client sends authorization packets over UDP port -62201, but this can be altered with the *--server-port* argument. The server -must first be configured to acquire the SPA data on the changed protocol-port. +62201, but this can be altered with the *--server-port* argument (this requires +*fwknopd* to be configured to acquire SPA data over the selected port). Also, *fwknop* can send the SPA packet over a random port via the *--rand-port* argument. See 'fwknopd(8)' for further details. See the *EXAMPLES* section for example invocations of the *fwknop* client. +The *fwknop* 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 *libfko* +that both *fwknop* and *fwknopd* use for SPA packet encryption/decryption +and HMAC authentication operations. This library can be used to allow +third party applications to use SPA. + REQUIRED ARGUMENTS ------------------ These required arguments can be specified via command-line or from within the '.fwknoprc' file (see '-n, --named-config' option and the FWKNOPRC FILE -section below. - -*-D, --destination*='':: - 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 - decrypts and parses the authentication packet. +section below). *-A, --access*='':: Provide a list of ports and protocols to access on a remote computer @@ -100,9 +115,15 @@ 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*='':: + 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 + decrypts and parses the authentication packet. + *-R|-a|-s*:: One of these options (see below) is required to tell the remote - *fwknopd* daemon what IP should be let through the local firewall. It + *fwknopd* daemon what IP should be allowed through the local firewall. It is recommend to use the *-R* or *-a* options instead of *-s* in order to harden SPA communications against possible 'Man-In-The-Middle' (MITM) attacks. @@ -113,25 +134,17 @@ GENERAL OPTIONS *-h, --help*:: Print a usage summary message and exit. -*-B, --save-packet*='':: - Instruct the *fwknop* client to write a newly created SPA packet out - to the specified file so that it can be examined off-line. - -*-b, --save-packet-append*:: - Append the generated packet data to the file specified with the -B - option. - *-G, --get-key*='':: Load an encryption key/password from the specified file. The key file contains a line for each destination hostname or IP address, a colon (":"), optional space and the password, followed by a newline. Note that the last line has to have a terminating newline character. Also note: though this is a convenience, having a file on your system - with cleartext passwords is not a good idea and is not recommended. + with clear text passwords is not a good idea and is not recommended. Having the *fwknop* client prompt you for the key is generally more secure. Note also that if a key is stored on disk, the *fwknop* rc - file is a more powerful mechanism for specifying the key but other - options as well. + file is a more powerful mechanism for specifying not only the key but + other options as well. *--get-hmac-key*='':: Load an HMAC key/password from the specified file. Similarly to the @@ -139,36 +152,18 @@ GENERAL OPTIONS each destination hostname or IP address, a colon (":"), optional space and the password, followed by a newline. Note that the last line has to have a terminating newline character. Also note: though this is a - convenience, having a file on your system with cleartext passwords is + convenience, having a file on your system with clear text passwords is not a good idea and is not recommended. Having the *fwknop* client prompt you for the HMAC key is generally more secure. Note also that if a key is stored on disk, the *fwknop* rc file is a more powerful - mechanism for specifying the key but other options as well. + mechanism for specifying not only the HMAC key but other options as + well. -*--key-rijndael*='':: - Specify the Rijndael key. Since the key may be visible to utilities - such as 'ps' under Unix, this form should only be used where security is - not critical. Having the *fwknop* client prompt you for the key is - generally more secure. - -*--key-base64-rijndael*='':: - Specify the base64 encoded Rijndael key. Since the key may be visible - to utilities such as 'ps' under Unix, this form should only be used where - security is not critical. Having the *fwknop* client prompt you for the - key is generally more secure. - -*--key-base64-hmac*='':: - Specify the base64 encoded HMAC key. Since the key may be visible - to utilities such as 'ps' under Unix, this form should only be used where - security is not critical. Having the *fwknop* client prompt you for the - key is generally more secure. - - -*--key-hmac*='':: - Specify the raw HMAC key (not base64 encoded). Since the key may be visible - to utilities such as 'ps' under Unix, this form should only be used where - security is not critical. Having the *fwknop* client prompt you for the - key is generally more secure. +*--key-gen*:: + Have *fwknop* 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 ``$HOME/.fwknoprc'' file (or the file referenced by *--get-key*). *-l, --last-cmd*:: Execute *fwknop* with the command-line arguments from the previous @@ -183,6 +178,34 @@ GENERAL OPTIONS FWKNOPRC FILE below for a list of the valid configuration directives in the '.fwknoprc' file. +*--key-rijndael*='':: + Specify the Rijndael key on the command line. Since the key may be visible + to utilities such as 'ps' under Unix, this form should only be used where + security is not critical. Having the *fwknop* client either prompt you for + the key or acquire via the ``$HOME/.fwknoprc'' file is generally more + secure. + +*--key-base64-rijndael*='':: + Specify the base64 encoded Rijndael key. Since the key may be visible + to utilities such as 'ps' under Unix, this form should only be used where + security is not critical. Having the *fwknop* client either prompt you for + the key or acquire via the ``$HOME/.fwknoprc'' file is generally more + secure. + +*--key-base64-hmac*='':: + Specify the base64 encoded HMAC key. Since the key may be visible + to utilities such as 'ps' under Unix, this form should only be used where + security is not critical. Having the *fwknop* client either prompt you for + the key or acquire via the ``$HOME/.fwknoprc'' file is generally more + secure. + +*--key-hmac*='':: + Specify the raw HMAC key (not base64 encoded). Since the key may be visible + to utilities such as 'ps' under Unix, this form should only be used where + security is not critical. Having the *fwknop* client either prompt you for + the key or acquire via the ``$HOME/.fwknoprc'' file is generally more + secure. + *--rc-file*='':: Specify path to the fwknop rc file (default is $HOME/.fwknoprc). @@ -211,6 +234,14 @@ GENERAL OPTIONS the decryption and decoding process and print the break-down again. This is primarily a debugging feature. +*-B, --save-packet*='':: + Instruct the *fwknop* client to write a newly created SPA packet out + to the specified file so that it can be examined off-line. + +*-b, --save-packet-append*:: + Append the generated packet data to the file specified with the -B + option. + *-v, --verbose*:: Run the *fwknop* client in verbose mode. This causes *fwknop* to print some extra information about the current command and the resulting SPA @@ -222,6 +253,11 @@ GENERAL OPTIONS SPA OPTIONS ----------- +*--use-hmac*:: + Set HMAC mode for authenticated encryption of SPA communications. As of + *fwknop* 2.5, this is an optional feature, but this will become the + default in a future release. + *-a, --allow-ip*='':: Specify IP address that should be permitted through the destination *fwknopd* server firewall (this IP is encrypted within the SPA packet @@ -238,48 +274,15 @@ SPA OPTIONS system is connected to by querying a website that returns the actual IP address it sees from the calling system. -*-C, --server-cmd*='':: - Instead of requesting access to a service with an SPA packet, the - *--server-cmd* argument specifies a command that will be executed by - the *fwknopd* server. The command is encrypted within the SPA packet - and sniffed off the wire (as usual) by the *fwknopd* server. - *-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). -*-H, --http-proxy*='[:port]':: - Specify an HTTP proxy that the *fwknop* client will use to send the SPA - packet through. Using this option will automatically set the SPA packet - transmission mode (usually set via the *--server-proto* argument) to - "http". You can also specify the proxy port by adding ":" to - the proxy host name or ip. - -*-m, --digest-type*='':: - Specify the message digest algorithm to use in the SPA data. Choices - are: *MD5*, *SHA1*, *SHA256* (the default), *SHA384*, and *SHA512*. - -*-M, --encryption-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 - server side via the ENCRYPTION_MODE variable. In general, it is - recommended to not use this argument and just use 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. - *--hmac-digest-type*='':: - Set the HMAC digest algorithm (default is sha256). Options are md5, sha1, - sha256, sha384, or sha512. - -*--use-hmac*:: - Set HMAC mode for authenticated encryption of SPA communications. As of - *fwknop* 2.5, this is an optional feature, but this will become the - default in a future release. + Set the HMAC digest algorithm for authenticated encryption of SPA packets. + Choices are: *MD5*, *SHA1*, *SHA256* (the default), *SHA384*, and *SHA512*. *-N, --nat-access*='':: The *fwknopd* server offers the ability to provide SPA access through @@ -368,13 +371,44 @@ SPA OPTIONS *fwknopd* SPA server to use the source IP address from which the SPA packet originates as the IP that will be allowed through upon modification of the firewall ruleset. This option is useful if the - *fwknop* client is deployed on a machine that is behind a NAT device. + *fwknop* client is deployed on a machine that is behind a NAT device and + the external IP is not known. However, usage of this option is not + recommended, and either the *-a* or *-R* options should be used instead. The permit-address options *-s*, *-R* and *-a* are mutually exclusive. *-S, --source-port*='':: Set the source port for outgoing SPA packet. +*-C, --server-cmd*='':: + Instead of requesting access to a service with an SPA packet, the + *--server-cmd* argument specifies a command that will be executed by + the *fwknopd* server. The command is encrypted within the SPA packet + and sniffed off the wire (as usual) by the *fwknopd* server. + +*-H, --http-proxy*='[:port]':: + Specify an HTTP proxy that the *fwknop* client will use to send the SPA + packet through. Using this option will automatically set the SPA packet + transmission mode (usually set via the *--server-proto* argument) to + "http". You can also specify the proxy port by adding ":" to + the proxy host name or ip. + +*-m, --digest-type*='':: + Specify the message digest algorithm to use in the SPA data. Choices + are: *MD5*, *SHA1*, *SHA256* (the default), *SHA384*, and *SHA512*. + +*-M, --encryption-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 + server side via the ENCRYPTION_MODE variable. In general, it is + recommended to not use this argument and just use the default (CBC). + 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 + initialization vectors in a manner that is compatible with OpenSSL via the + PBKDF1 algorithm. + *--time-offset-plus*='