{"id":4411,"date":"2022-12-20T17:49:13","date_gmt":"2022-12-20T20:49:13","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ipsec-secrets-man5\/"},"modified":"2022-12-20T17:49:13","modified_gmt":"2022-12-20T20:49:13","slug":"ipsec-secrets-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ipsec-secrets-man5\/","title":{"rendered":"IPSEC.SECRETS (man5)"},"content":{"rendered":"<h1 align=\"center\">IPSEC.SECRETS<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#HISTORY\">HISTORY<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ipsec.secrets \u2212 secrets for IKE\/IPsec authentication<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The file ipsec.secrets contains a list of secrets. Currently supported secrets are preshared secrets (PSKs), postquantum preshared keys (PPKs) and XAUTH passwords. As of libreswan version 4.0, the secrets entries for raw RSA keys are no longer needed and ignored. All private keys from public keypairs (RSA or ECDSA) are stored completely in the NSS database and :RSA entries are no longer required to locate these.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">These secrets are used by <b>pluto<\/b>(8) , the Libreswan Internet Key Exchange daemon, to authenticate other hosts. There is another one type of secret, post\u2212quantum preshared keys (PPKs), that are used for protecting traffic from quantum computer attack.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">XAUTH passwords are stored in plaintext in this file. The secrets file should be owned by root, and permissions should be set to block all access by others. (eg: chmod 600)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The file is a sequence of entries and include directives. Here is an example \u2212 each entry or directive must start at the left margin, but if it continues beyond a single line, each continuation line must be indented.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># sample \/etc\/ipsec.secrets file for 10.1.0.1 <br \/> 10.1.0.1 10.2.0.1 : PSK &#8220;secret shared by two hosts&#8221; <br \/> # sample roadwarrior <br \/> %any gateway.corp.com : PSK &#8220;shared secret with many roadwarriors&#8221; <br \/> # sample server for roadwarriors <br \/> myip %any : PSK &#8220;shared secret with many roadwarriors&#8221;<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># an entry may be split across lines, <br \/> # but indentation matters <br \/> www.xs4all.nl @www.kremvax.ru \u00a0\u00a0\u00a0\u00a0 <br \/> 10.6.0.1 10.7.0.1 1.8.0.1 : PSK &#8220;secret shared by 5 systems&#8221;<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># sample entry for static PPK <br \/> 10.1.0.1 10.2.0.1 : PPKS &#8220;PPK_ID_1&#8221; &#8220;post\u2212quantum preshared key for extra security&#8221;<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># XAUTH password, used with leftusername=username <br \/> @username : XAUTH &#8220;password&#8221;<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"-9%\">\n<p>include ipsec.*.secrets<\/p>\n<\/td>\n<td width=\"30%\"><\/td>\n<td width=\"8%\"><\/td>\n<td width=\"54%\">\n<p># get secrets from other files<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">Each entry in the file is a list of indices, followed by a secret. The two parts are separated by a colon (<b>:<\/b>) that is followed by whitespace or a newline.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An index is an IP address, or a Fully Qualified Domain Name, user@FQDN, <b>%any<\/b> or <b>%any6<\/b> (other kinds may come). An IP address may be written in the familiar dotted quad form or as a domain name to be looked up when the file is loaded. Be aware that using domain names requires DNS to be functional before the IPsec tunnel comes up. To denote a Fully Qualified Domain Name (as opposed to an IP address denoted by its domain name), precede the name with an at sign (<b>@<\/b>).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Matching IDs with indices is fairly straightforward: they have to be equal. In the case of a &#8220;Road Warrior&#8221; connection, if an equal match is not found for the Peer&#8217;s ID, and it is in the form of an IP address, an index of <b>%any<\/b> will match the peer&#8217;s IP address if IPV4 and <b>%any6<\/b> will match a the peer&#8217;s IP address if IPV6.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This file is only read at startup time. If any changes are made to this file, the pluto daemon should be told to re\u2212read this file using the command <b>ipsec secrets<\/b> or <b>ipsec auto \u2212\u2212rereadsecrets<\/b>. Note that currently there is no way to add a specific new entry \u2212 it&#8217;s all or nothing.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Smartcard support has been moved from Libreswan to NSS. The location of these are specified using leftcert\/rightcert entries with a PKIX URI in ipsec.conf. No entry in the secrets file is required for these.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An additional complexity arises in the case of authentication by preshared secret in IKEv1 Main Mode: the responder will need to look up the secret before the Peer&#8217;s ID payload has been decoded, so the ID used will be the IP address. IKEv1 Aggressive Mode (aggrmode=yes) can be used to work around this, at the price of leaking the ID in the clear and allowing a brute force attack against the PSK to be performed offline. PSKs are the least secure authentication method and should be avoided.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To authenticate a connection between two hosts, the entry that most specifically matches the host and peer IDs is used. An entry with no index will match any host and peer. More specifically, an entry with one index will match a host and peer if the index matches the host&#8217;s ID (the peer isn&#8217;t considered). Still more specifically, an entry with multiple indices will match a host and peer if the host ID and peer ID each match one of the indices. It is acceptable for two entries to be the best match as long as they agree about the secret.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Authentication by preshared secret requires that both systems find the identical secret (the secret is not actually transmitted by the IKE protocol). If both the host and peer appear in the index list, the same entry will be suitable for both systems so verbatim copying between systems can be used. This naturally extends to larger groups sharing the same secret. Thus multiple\u2212index entries are best for PSK authentication.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When running in FIPS mode, PSK&#8217;s need to comply to a minimum strength requirement depending on the integrity and PRF algorithm used. It is recommended not to use PSK&#8217;s shorter then 64 random characters.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The token &#8220;XAUTH&#8221; indicates an IKEv1 eXtended Authentication password. There should be one index, and it should be in the @FQDN format. The file will be searched with the XAUTH username, which is usually provided in the configuration file. XAUTH is otherwise identical to PSK in syntax.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A preshared secret is most conveniently represented as a sequence of characters, delimited by the double\u2212quote character (<b>&#8220;<\/b>). The sequence cannot contain a newline or double\u2212quote. Strictly speaking, the secret is actually the sequence of bytes that is used in the file to represent the sequence of characters (excluding the delimiters). A preshared secret may also be represented, without quotes, in any of supported formats.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Currently supported formats are hexadecimal, base64, and characters.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A hexadecimal text value begins with a <b>0x<\/b> (or <b>0X<\/b>) prefix and continues with two\u2212digit groups of hexadecimal digits (0\u22129, and a\u2212f or A\u2212F), each group encoding the value of one binary byte, high\u2212order digit first. A single <b>_<\/b> (underscore) between consecutive groups is ignored, permitting punctuation to improve readability; doing this every eight digits seems about right.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A base64 text value begins with a <b>0s<\/b> (or <b>0S<\/b>) prefix and continues with four\u2212digit groups of base64 digits (A\u2212Z, a\u2212z, 0\u22129, +, and \/), each group encoding the value of three binary bytes as described in section 6.8 of RFC 2045. If <i>flags<\/i> has the <b>TTODATAV_IGNORESPACE<\/b> bit on, blanks are ignore (after the prefix). Note that the last one or two digits of a base64 group can be <b>=<\/b> to indicate that fewer than three binary bytes are encoded.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A character text value begins with a <b>0t<\/b> (or <b>0T<\/b>) prefix and continues with text characters, each being the value of one binary byte.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Post\u2212quantum preshared keys (PPK) can be static. The token \u201cPPKS\u201d indicates that the following key will be a PPK. The next token is a PPK_ID that uniquely represents the given PPK. PPK_ID must be represented as a sequence of characters delimited by the double\u2212quote character (<b>&#8220;<\/b>). The next token is a PPK itself. The static PPK may be represented in any format that can be used for representing a preshared secret. It is recommended that the static PPK be at least 256 bits in order to provide real security against quantum computer attacks.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The first token of an entry must start in the first column of its line. Subsequent tokens must be separated by whitespace, except for a colon token, which only needs to be followed by whitespace. A newline is taken as whitespace, but every line of an entry after the first must be indented.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Whitespace at the end of a line is ignored (except in the 0t notation for a key). At the start of line or after whitespace, <b>#<\/b> and the following text up to the end of the line is treated as a comment. Within entries, all lines must be indented (except for lines with no tokens). Outside entries, no line may be indented (this is to make sure that the file layout reflects its structure).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An include directive causes the contents of the named file to be processed before continuing with the current file. The filename is subject to &#8220;globbing&#8221; as in <b>sh<\/b>(1), so every file with a matching name is processed. Includes may be nested to a modest depth (10, currently). If the filename doesn&#8217;t start with a <b>\/<\/b>, the directory containing the current file is prepended to the name. The include directive is a line that starts with the word <b>include<\/b>, followed by whitespace, followed by the filename (which must not contain whitespace).<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">\/etc\/ipsec.secrets<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The rest of the Libreswan distribution, in particular <b>ipsec.conf<\/b>(5), <b>ipsec<\/b>(8), <b>ipsec_newhostkey<\/b>(8), <b>ipsec_rsasigkey<\/b>(8), <b>ipsec_showhostkey<\/b>(8), <b>ipsec_auto<\/b>(8) <b>\u2212\u2212rereadsecrets<\/b>, and <b>pluto<\/b>(8) <b>\u2212\u2212listen<\/b>.<\/p>\n<h2>HISTORY <a name=\"HISTORY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Originally designed for the FreeS\/WAN project <<b><font color=\"#0000FF\">https:\/\/www.freeswan.org<\/font><\/b><font color=\"#000000\">> by D. Hugh Redelmeier. Updated for Openswan by Ken Bantoft. Updated for Libreswan by Paul Wouters<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">This file originally stored the private part of RSA keys. This was later on moved to the NSS database, and all private fields were filled with the CKAID to enable lookup in the NSS database. This was further obsoleted in libreswan 4.0 and now the secrets file no longer contains any public key pair information.<\/font><\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">If an ID is 0.0.0.0, it will match <b>%any<\/b>; if it is <b>0::0<\/b>, it will match <b>%any6<\/b>.<\/font><\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>Paul Wouters<\/b><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">libreswan secrets files<\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  ipsec.secrets \u2212 secrets for IKE\/IPsec authentication <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,851,1291],"class_list":["post-4411","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-ipsec","tag-man5"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4411"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4411\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}