ipsec.secrets.5 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. .TH IPSEC.SECRETS 5 "2011-12-14" "5.8.1" "strongSwan"
  2. .SH NAME
  3. ipsec.secrets \- secrets for IKE/IPsec authentication
  4. .SH DESCRIPTION
  5. The file \fIipsec.secrets\fP holds a table of secrets.
  6. These secrets are used by the strongSwan Internet Key Exchange (IKE) daemons
  7. pluto (IKEv1) and charon (IKEv2) to authenticate other hosts.
  8. .LP
  9. It is vital that these secrets be protected. The file should be owned
  10. by the super-user,
  11. and its permissions should be set to block all access by others.
  12. .LP
  13. The file is a sequence of entries and include directives.
  14. Here is an example.
  15. .LP
  16. .RS
  17. .nf
  18. # /etc/ipsec.secrets - strongSwan IPsec secrets file
  19. 192.168.0.1 %any : PSK "v+NkxY9LLZvwj4qCC2o/gGrWDF2d21jL"
  20. : RSA moonKey.pem
  21. alice@strongswan.org : EAP "x3.dEhgN"
  22. carol : XAUTH "4iChxLT3"
  23. dave : XAUTH "ryftzG4A"
  24. # get secrets from other files
  25. include ipsec.*.secrets
  26. .fi
  27. .RE
  28. .LP
  29. Each entry in the file is a list of optional ID selectors, followed by a secret.
  30. The two parts are separated by a colon (\fB:\fP) that is surrounded
  31. by whitespace. If no ID selectors are specified the line must start with a
  32. colon.
  33. .LP
  34. A selector is an IP address, a Fully Qualified Domain Name, user@FQDN,
  35. \fB%any\fP or \fB%any6\fP (other kinds may come).
  36. .LP
  37. Matching IDs with selectors is fairly straightforward: they have to be
  38. equal. In the case of a ``Road Warrior'' connection, if an equal
  39. match is not found for the Peer's ID, and it is in the form of an IP
  40. address, a selector of \fB%any\fP will match the peer's IP address if IPV4
  41. and \fB%any6\fP will match a the peer's IP address if IPV6.
  42. Currently, the obsolete notation \fB0.0.0.0\fP may be used in place of
  43. \fB%any\fP.
  44. .LP
  45. In IKEv1 an additional complexity
  46. arises in the case of authentication by preshared secret: the
  47. responder will need to look up the secret before the Peer's ID payload has
  48. been decoded, so the ID used will be the IP address.
  49. .LP
  50. To authenticate a connection between two hosts, the entry that most
  51. specifically matches the host and peer IDs is used. An entry with no
  52. selectors will match any host and peer. More specifically, an entry with one
  53. selector will match a host and peer if the selector matches the host's ID (the
  54. peer isn't considered). Still more specifically, an entry with multiple
  55. selectors will match a host and peer if the host ID and peer ID each match one
  56. of the selectors. If the key is for an asymmetric authentication technique
  57. (i.e. a public key system such as RSA), an entry with multiple selectors will
  58. match a host and peer even if only the host ID matches a selector (it is
  59. presumed that the selectors are all identities of the host).
  60. It is acceptable for two entries to be the best match as
  61. long as they agree about the secret or private key.
  62. .LP
  63. Authentication by preshared secret requires that both systems find the
  64. identical secret (the secret is not actually transmitted by the IKE
  65. protocol). If both the host and peer appear in the selector list, the
  66. same entry will be suitable for both systems so verbatim copying
  67. between systems can be used. This naturally extends to larger groups
  68. sharing the same secret. Thus multiple-selector entries are best for PSK
  69. authentication.
  70. .LP
  71. Authentication by public key systems such as RSA requires that each host
  72. have its own private key. A host could reasonably use a different private keys
  73. for different interfaces and for different peers. But it would not
  74. be normal to share entries between systems. Thus thus no-selector and
  75. one-selector forms of entry often make sense for public key authentication.
  76. .LP
  77. The key part of an entry must start with a token indicating the kind of
  78. key. The following types of secrets are currently supported:
  79. .TP
  80. .B PSK
  81. defines a pre-shared key
  82. .TP
  83. .B RSA
  84. defines an RSA private key
  85. .TP
  86. .B ECDSA
  87. defines an ECDSA private key
  88. .TP
  89. .B P12
  90. defines a PKCS#12 container
  91. .TP
  92. .B EAP
  93. defines EAP credentials
  94. .TP
  95. .B NTLM
  96. defines NTLM credentials
  97. .TP
  98. .B XAUTH
  99. defines XAUTH credentials
  100. .TP
  101. .B PIN
  102. defines a smartcard PIN
  103. .LP
  104. Details on each type of secret are given below.
  105. .LP
  106. Whitespace at the end of a line is ignored. At the start of a line or
  107. after whitespace, \fB#\fP and the following text up to the end of the
  108. line is treated as a comment.
  109. .LP
  110. An include directive causes the contents of the named file to be processed
  111. before continuing with the current file. The filename is subject to
  112. ``globbing'' as in \fIsh\fP(1), so every file with a matching name
  113. is processed. Includes may be nested to a modest
  114. depth (10, currently). If the filename doesn't start with a \fB/\fP, the
  115. directory containing the current file is prepended to the name. The
  116. include directive is a line that starts with the word \fBinclude\fP,
  117. followed by whitespace, followed by the filename (which must not contain
  118. whitespace).
  119. .SS TYPES OF SECRETS
  120. .TP
  121. .B [ <selectors> ] : PSK <secret>
  122. A preshared \fIsecret\fP is most conveniently represented as a sequence of
  123. characters, which is delimited by double-quote characters (\fB"\fP).
  124. The sequence cannot contain newline or double-quote characters.
  125. .br
  126. Alternatively, preshared secrets can be represented as hexadecimal or Base64
  127. encoded binary values. A character sequence beginning with
  128. .B 0x
  129. is interpreted as sequence of hexadecimal digits.
  130. Similarly, a character sequence beginning with
  131. .B 0s
  132. is interpreted as Base64 encoded binary data.
  133. .TP
  134. .B : RSA <private key file> [ <passphrase> | %prompt ]
  135. .TQ
  136. .B : ECDSA <private key file> [ <passphrase> | %prompt ]
  137. For the private key file both absolute paths or paths relative to
  138. \fI/etc/ipsec.d/private\fP are accepted. If the private key file is
  139. encrypted, the \fIpassphrase\fP must be defined. Instead of a passphrase
  140. .B %prompt
  141. can be used which then causes the daemon to ask the user for the password
  142. whenever it is required to decrypt the key.
  143. .TP
  144. .B : P12 <PKCS#12 file> [ <passphrase> | %prompt ]
  145. For the PKCS#12 file both absolute paths or paths relative to
  146. \fI/etc/ipsec.d/private\fP are accepted. If the container is
  147. encrypted, the \fIpassphrase\fP must be defined. Instead of a passphrase
  148. .B %prompt
  149. can be used which then causes the daemon to ask the user for the password
  150. whenever it is required to decrypt the container. Private keys, client and CA
  151. certificates are extracted from the container. To use such a client certificate
  152. in a connection set leftid to one of the subjects of the certificate.
  153. .TP
  154. .B <user id> : EAP <secret>
  155. The format of \fIsecret\fP is the same as that of \fBPSK\fP secrets.
  156. .br
  157. \fBEAP\fP secrets are IKEv2 only.
  158. .TP
  159. .B <user id> : NTLM <secret>
  160. The format of \fIsecret\fP is the same as that of \fBPSK\fP secrets, but the
  161. secret is stored as NTLM hash, which is MD4(UTF-16LE(secret)), instead of as
  162. cleartext.
  163. .br
  164. \fBNTLM\fP secrets can only be used with the \fBeap-mschapv2\fP plugin.
  165. .TP
  166. .B [ <servername> ] <username> : XAUTH <password>
  167. The format of \fIpassword\fP is the same as that of \fBPSK\fP secrets.
  168. \fBXAUTH\fP secrets are IKEv1 only.
  169. .TP
  170. .B : PIN %smartcard[<slot nr>[@<module>]]:<keyid> <pin code> | %prompt
  171. The smartcard selector always requires a keyid to uniquely select the correct
  172. key. The slot number defines the slot on the token, the module name refers to
  173. the module name defined in strongswan.conf(5).
  174. Instead of specifying the pin code statically,
  175. .B %prompt
  176. can be specified, which causes the daemon to ask the user for the pin code.
  177. .LP
  178. .SH FILES
  179. /etc/ipsec.secrets
  180. .SH SEE ALSO
  181. ipsec.conf(5), strongswan.conf(5), ipsec(8)
  182. .br
  183. .SH HISTORY
  184. Originally written for the FreeS/WAN project by D. Hugh Redelmeier.
  185. Updated and extended for the strongSwan project <http://www.strongswan.org> by
  186. Tobias Brunner and Andreas Steffen.
  187. .SH BUGS
  188. If an ID is \fB0.0.0.0\fP, it will match \fB%any\fP;
  189. if it is \fB0::0\fP, it will match \fB%any6\fP.