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