Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man8 / ipseckey.8
blob4d23bedc9fba81f60eecc620c56ca3dbe7c5e58b
1 '\" te
2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH IPSECKEY 8 "Sep 25, 2008"
7 .SH NAME
8 ipseckey \- manually manipulate an IPsec Security Association Database (SADB)
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBipseckey\fR  [\fB-nvp\fR]
13 .fi
15 .LP
16 .nf
17 \fBipseckey\fR  [\fB-nvp\fR] \fB-f\fR \fIfilename\fR
18 .fi
20 .LP
21 .nf
22 \fBipseckey\fR  \fB-c\fR \fIfilename\fR
23 .fi
25 .LP
26 .nf
27 \fBipseckey\fR  [\fB-nvp\fR] [delete | delete-pair | get] SA_TYPE {EXTENSION \fIvalue\fR...}
28 .fi
30 .LP
31 .nf
32 \fBipseckey\fR  [\fB-np\fR] [monitor |  passive_monitor |  pmonitor]
33 .fi
35 .LP
36 .nf
37 \fBipseckey\fR  [\fB-nvp\fR] flush {SA_TYPE}
38 .fi
40 .LP
41 .nf
42 \fBipseckey\fR  [\fB-nvp\fR] dump {SA_TYPE}
43 .fi
45 .LP
46 .nf
47 \fBipseckey\fR  [\fB-nvp\fR] save SA_TYPE {\fIfilename\fR}
48 .fi
50 .LP
51 .nf
52 \fBipseckey\fR  [\fB-nvp\fR] \fB-s\fR \fIfilename\fR
53 .fi
55 .SH DESCRIPTION
56 .sp
57 .LP
58 The \fBipseckey\fR command is used to manually manipulate the security
59 association databases of the network security services, \fBipsecah\fR(7P) and
60 \fBipsecesp\fR(7P). You can use the \fBipseckey\fR command to set up security
61 associations between communicating parties when automated key management is not
62 available.
63 .sp
64 .LP
65 While the \fBipseckey\fR utility has only a limited number of general options,
66 it supports a rich command language. The user may specify requests to be
67 delivered by means of a programmatic interface specific for manual keying. See
68 \fBpf_key\fR(7P). When \fBipseckey\fR is invoked with no arguments, it will
69 enter an interactive mode which prints a prompt to the standard output and
70 accepts commands from the standard input until the end-of-file is reached. Some
71 commands require an explicit security association ("\fBSA\fR") type, while
72 others permit the \fBSA\fR type to be unspecified and act on all \fBSA\fR
73 types.
74 .sp
75 .LP
76 \fBipseckey\fR uses a \fBPF_KEY\fR socket and the message types \fBSADB_ADD\fR,
77 \fBSADB_DELETE\fR, \fBSADB_GET\fR, \fBSADB_UPDATE\fR, \fBSADB_FLUSH\fR, and
78 \fBSADB_X_PROMISC\fR. Thus, you must be a superuser to use this command.
79 .sp
80 .LP
81 \fBipseckey\fR handles sensitive cryptographic keying information. Please read
82 the \fBSecurity\fR section for details on how to use this command securely.
83 .SH OPTIONS
84 .sp
85 .ne 2
86 .na
87 \fB\fB-c\fR [\fIfilename\fR]\fR
88 .ad
89 .sp .6
90 .RS 4n
91 Analogous to the \fB-f\fR option (see following), except that the input is not
92 executed but only checked for syntactical correctness. Errors are reported to
93 \fBstderr\fR. This option is provided to debug configurations without making
94 changes. See \fBSECURITY\fR and "Service Management Facility" for more
95 information.
96 .RE
98 .sp
99 .ne 2
101 \fB\fB-f\fR [\fIfilename\fR]\fR
103 .sp .6
104 .RS 4n
105 Read commands from an input file, \fIfilename\fR. The lines of the input file
106 are identical to the command line language. The \fBload\fR command provides
107 similar functionality. The \fB-s\fR option or the \fBsave\fR command can
108 generate files readable by the \fB-f\fR argument.
112 .ne 2
114 \fB\fB-n\fR\fR
116 .sp .6
117 .RS 4n
118 Prevent attempts to print host and network names symbolically when reporting
119 actions. This is useful, for example, when all name servers are down or are
120 otherwise unreachable.
124 .ne 2
126 \fB\fB-p\fR\fR
128 .sp .6
129 .RS 4n
130 Paranoid. Do not print any keying material, even if saving \fBSA\fRs. Instead
131 of an actual hexadecimal digit, print an \fBX\fR when this flag is turned on.
135 .ne 2
137 \fB\fB-s\fR [\fIfilename\fR]\fR
139 .sp .6
140 .RS 4n
141 The opposite of the \fB-f\fR option. If '\fB-\fR' is given for a
142 \fIfilename\fR, then the output goes to the standard output. A snapshot of all
143 current \fBSA\fR tables will be output in a form readable by the \fB-f\fR
144 option. The output will be a series of \fBadd\fR commands, but with some names
145 not used. This occurs because a single name may often indicate multiple
146 addresses.
150 .ne 2
152 \fB\fB-v\fR\fR
154 .sp .6
155 .RS 4n
156 Verbose. Print the messages being sent into the \fBPF_KEY\fR socket, and print
157 raw seconds values for lifetimes.
160 .SH COMMANDS
162 .ne 2
164 \fB\fBadd\fR\fR
166 .sp .6
167 .RS 4n
168 Add an \fBSA\fR. Because it involves the transfer of keying material, it cannot
169 be invoked from the shell, lest the keys be visible in \fBps\fR(1) output. It
170 can be used either from the interactive \fBipseckey>\fR prompt or in a command
171 file specified by the \fB-f\fR command. The \fBadd\fR command accepts all
172 extension-value pairs described below.
176 .ne 2
178 \fB\fBupdate\fR\fR
180 .sp .6
181 .RS 4n
182 Update \fBSA\fR lifetime, and in the cases of larval \fBSA\fRs (leftover from
183 aborted automated key management), keying material and other extensions. Like
184 \fBadd\fR, this command cannot be invoked from the shell because keying
185 material would be seen by the \fBps\fR(1) command. It can be used either from
186 the interactive \fBipseckey>\fR prompt or in a command file specified by the
187 \fB-f\fR command. The \fBupdate\fR command accepts all extension-value pairs,
188 but normally is only used for \fBSA\fR lifetime updates.
192 .ne 2
194 \fB\fBupdate-pair\fR\fR
196 .sp .6
197 .RS 4n
198 As update, but apply the update to the SA and its paired SA, if there is one.
202 .ne 2
204 \fB\fBdelete\fR\fR
206 .sp .6
207 .RS 4n
208 Delete a specific \fBSA\fR from a specific \fBSADB\fR. This command requires
209 the \fBspi\fR extension, and the \fBdest\fR extension for IPsec \fBSA\fRs.
210 Other extension-value pairs are superfluous for a delete message. If the SA to
211 be deleted is paired with another SA, the SA is deleted and the paired SA is
212 updated to indicate that it is now unpaired.
216 .ne 2
218 \fB\fBdelete-pair\fR\fR
220 .sp .6
221 .RS 4n
222 Delete a specific SA from a specific SADB. If the SA is paired with another SA,
223 delete that SA too. This command requires the \fBspi\fR extension and the
224 \fBdest\fR extension for the IPsec SA, or its pair.
228 .ne 2
230 \fB\fBget\fR\fR
232 .sp .6
233 .RS 4n
234 Lookup and display a security association from a specific \fBSADB\fR. Like
235 \fBdelete\fR, this command only requires \fBspi\fR and \fBdest\fR for IPsec.
239 .ne 2
241 \fB\fBflush\fR\fR
243 .sp .6
244 .RS 4n
245 Remove all \fBSA\fR for a given \fBSA_TYPE\fR, or all \fBSA\fR for all types.
249 .ne 2
251 \fB\fBmonitor\fR\fR
253 .sp .6
254 .RS 4n
255 Continuously report on any \fBPF_KEY\fR messages. This uses the
256 \fBSADB_X_PROMISC\fR message to enable messages that a normal \fBPF_KEY\fR
257 socket would not receive to be received. See \fBpf_key\fR(7P).
261 .ne 2
263 \fB\fBpassive_monitor\fR\fR
265 .sp .6
266 .RS 4n
267 Like monitor, except that it does not use the \fBSADB_X_PROMISC\fR message.
271 .ne 2
273 \fB\fBpmonitor\fR\fR
275 .sp .6
276 .RS 4n
277 Synonym for \fBpassive_monitor\fR.
281 .ne 2
283 \fB\fBdump\fR\fR
285 .sp .6
286 .RS 4n
287 Will display all \fBSA\fRs for a given \fBSA\fR type, or will display all
288 \fBSA\fRs. Because of the large amount of data generated by this command, there
289 is no guarantee that all \fBSA\fR information will be successfully delivered,
290 or that this command will even complete.
294 .ne 2
296 \fB\fBsave\fR\fR
298 .sp .6
299 .RS 4n
300 Is the command analog of the \fB-s\fR option. It is included as a command to
301 provide a way to snapshot a particular \fBSA\fR type, for example, \fBesp\fR or
302 \fBah\fR.
306 .ne 2
308 \fB\fBhelp\fR\fR
310 .sp .6
311 .RS 4n
312 Prints a brief summary of commands.
315 .SS "\fBSA_TYPE\fR"
317 .ne 2
319 \fB\fBall\fR\fR
321 .sp .6
322 .RS 4n
323 Specifies all known \fBSA\fR types. This type is only used for the \fBflush\fR
324 and \fBdump\fR commands. This is equivalent to having no \fBSA\fR type for
325 these commands.
329 .ne 2
331 \fB\fBah\fR\fR
333 .sp .6
334 .RS 4n
335 Specifies the IPsec Authentication Header ("\fBAH\fR") \fBSA\fR.
339 .ne 2
341 \fB\fBesp\fR\fR
343 .sp .6
344 .RS 4n
345 Specifies the IPsec Encapsulating Security Payload ("\fBESP\fR") \fBSA\fR.
348 .SH EXTENSION VALUE TYPES
351 Commands like \fBadd\fR, \fBdelete\fR, \fBget\fR, and \fBupdate\fR require that
352 certain extensions and associated values be specified. The extensions will be
353 listed here, followed by the commands that use them, and the commands that
354 require them. Requirements are currently documented based upon the IPsec
355 definitions of an \fBSA\fR. Required extensions may change in the future.
356 \fB<number>\fR can be in either hex (\fB0xnnn\fR), decimal (\fBnnn\fR) or octal
357 (\fB0nnn\fR).\fB<string>\fR is a text string. \fB<hexstr>\fR is a long
358 hexadecimal number with a bit-length. Extensions are usually paired with
359 values; however, some extensions require two values after them.
361 .ne 2
363 \fB\fBspi \fI<number>\fR\fR\fR
365 .sp .6
366 .RS 4n
367 Specifies the security parameters index of the \fBSA\fR. This extension is
368 required for the \fBadd\fR, \fBdelete\fR, \fBget\fR and \fBupdate\fR commands.
372 .ne 2
374 \fB\fBpair-spi \fI<number>\fR\fR\fR
376 .sp .6
377 .RS 4n
378 When \fBpair-spi\fR is used with the \fBadd\fR or \fBupdate\fR commands, the SA
379 being added or updated will be paired with the SA defined by \fBpair-spi\fR. A
380 pair of SAs can be updated or deleted with a single command.
382 The two SAs that make up the pair need to be in opposite directions from the
383 same pair of IP addresses. The command will fail if either of the SAs specified
384 are already paired with another SA.
386 If the pair-spi token is used in a command and the SA defined by pair-spi does
387 not exist, the command will fail. If the command was \fBadd\fR and the pairing
388 failed, the SA to be added will instead be removed.
392 .ne 2
394 \fB\fBinbound | outbound\fR\fR
396 .sp .6
397 .RS 4n
398 These optional flags specify the direction of the SA. When the \fBinbound\fR or
399 \fBoutbound\fR flag is specified with the \fBadd\fR command,  the kernel will
400 insert the new SA into the specified hash table for faster lookups. If the flag
401 is omitted, the kernel will decide into which hash table to insert the new SA
402 based on its knowledge the IP addresses specified with the \fBsrc\fR and
403 \fBdst\fR extensions.
405 When these flags are used with the \fBupdate\fR, \fBdelete\fR,
406 \fBupdate-pair\fR or \fBget\fR commands, the flags provide a hint as to the
407 hash table in which the kernel should find the SA.
411 .ne 2
413 \fB\fBreplay\fR \fI<number>\fR\fR
415 .sp .6
416 .RS 4n
417 Specifies the replay window size. If not specified, the replay window size is
418 assumed to be zero. It is not recommended that manually added \fBSA\fRs have a
419 replay window. This extension is used by the \fBadd\fR and \fBupdate\fR
420 commands.
424 .ne 2
426 \fB\fBreplay_value\fR \fI<number>\fR\fR
428 .sp .6
429 .RS 4n
430 Specifies the replay value of the SA. This extension is used by the \fBadd\fR
431 and \fBupdate\fR commands.
435 .ne 2
437 \fB\fBstate \fI<string>\fR|\fI<number>\fR\fR\fR
439 .sp .6
440 .RS 4n
441 Specifies the \fBSA\fR state, either by numeric value or by the strings
442 "\fBlarval\fR", "\fBmature\fR", "\fBdying\fR" or "\fBdead\fR". If not
443 specified, the value defaults to \fBmature\fR. This extension is used by the
444 \fBadd\fR and \fBupdate\fR commands.
448 .ne 2
450 \fB\fBauth_alg \fI<string>\fR|\fI<number>\fR\fR\fR
454 \fB\fBauthalg <string>|<number>\fR\fR
456 .sp .6
457 .RS 4n
458 Specifies the authentication algorithm for an \fBSA\fR, either by numeric
459 value, or by strings indicating an algorithm name. Current authentication
460 algorithms include:
462 .ne 2
464 \fB\fBHMAC-MD5\fR\fR
466 .sp .6
467 .RS 4n
468 \fBmd5\fR, \fBhmac-md5\fR
472 .ne 2
474 \fB\fBHMAC-SH-1\fR\fR
476 .sp .6
477 .RS 4n
478 \fBsha\fR, \fBsha-1\fR, \fBhmac-sha1\fR, \fBhmac-sha\fR
482 .ne 2
484 \fB\fBHMAC-SHA-256\fR\fR
486 .sp .6
487 .RS 4n
488 \fBsha256\fR, \fBsha-256\fR, \fBhmac-sha256\fR, \fBhmac-sha-256\fR
492 .ne 2
494 \fB\fBHMAC-SHA-384\fR\fR
496 .sp .6
497 .RS 4n
498 \fBsha384\fR, \fBsha-384\fR, \fBhmac-sha384\fR, \fBhmac-sha-384\fR
502 .ne 2
504 \fB\fBHMAC-SHA-512\fR\fR
506 .sp .6
507 .RS 4n
508 \fBsha512\fR, \fBsha-512\fR, \fBhmac-sha512\fR, \fBhmac-sha-512\fR
511 Often, algorithm names will have several synonyms. This extension is required
512 by the \fBadd\fR command for certain \fBSA\fR types. It is also used by the
513 \fBupdate\fR command.
515 Use the \fBipsecalgs\fR(8) command to obtain the complete list of
516 authentication algorithms.
520 .ne 2
522 \fB\fBencr_alg \fI<string>\fR|\fI<number>\fR\fR\fR
526 \fB\fBencralg \fI<string>\fR|\fI<number>\fR\fR\fR
528 .sp .6
529 .RS 4n
530 Specifies the encryption algorithm for an SA, either by numeric value, or by
531 strings indicating an algorithm name. Current encryption algorithms include DES
532 ("\fBdes\fR"), Triple-DES ("\fB3des\fR"), Blowfish ("blowfish"), and AES
533 ("aes"). This extension is required by the add command for certain \fBSA\fR
534 types. It is also used by the \fBupdate\fR command.
536 Use the \fBipsecalgs\fR(8) command to obtain the complete list of encryption
537 algorithms.
542 The next six extensions are lifetime extensions. There are two varieties,
543 "\fBhard\fR" and "\fBsoft\fR". If a \fBhard\fR lifetime expires, the \fBSA\fR
544 will be deleted automatically by the system. If a \fBsoft\fR lifetime expires,
545 an \fBSADB_EXPIRE\fR message will be transmitted by the system, and its state
546 will be downgraded to \fBdying\fR from \fBmature\fR. See \fBpf_key\fR(7P). The
547 \fBmonitor\fR command to \fBkey\fR allows you to view \fBSADB_EXPIRE\fR
548 messages.
550 .ne 2
552 \fB\fBidle_addtime\fR \fI<number>\fR\fR
556 \fB\fBidle_usetime\fR \fI<number>\fR\fR
558 .sp .6
559 .RS 4n
560 Specifies the number of seconds that this SA can exist if the SA is not used
561 before the SA is revalidated. If this extension is not present, the default
562 value is half of the \fBhard_addtime\fR (see below). This extension is used by
563 the \fBadd\fR and \fBupdate\fR commands.
567 .ne 2
569 \fB\fBsoft_bytes \fI<number>\fR\fR\fR
573 \fB\fBhard_bytes \fI<number>\fR\fR\fR
575 .sp .6
576 .RS 4n
577 Specifies the number of bytes that this \fBSA\fR can protect. If this extension
578 is not present, the default value is zero, which means that the \fBSA\fR will
579 not expire based on the number of bytes protected. This extension is used by
580 the \fBadd\fR and \fBupdate\fR commands.
584 .ne 2
586 \fB\fBsoft_addtime \fI<number>\fR\fR\fR
590 \fB\fBhard_addtime \fI<number>\fR\fR\fR
592 .sp .6
593 .RS 4n
594 Specifies the number of seconds that this \fBSA\fR can exist after being added
595 or updated from a larval \fBSA\fR. An update of a mature \fBSA\fR does not
596 reset the initial time that it was added. If this extension is not present, the
597 default value is zero, which means the \fBSA\fR will not expire based on how
598 long it has been since it was added. This extension is used by the \fBadd\fR
599 and \fBupdate\fR commands.
603 .ne 2
605 \fB\fBsoft_usetime \fI<number>\fR\fR\fR
609 \fB\fBhard_usetime \fI<number>\fR\fR\fR
611 .sp .6
612 .RS 4n
613 Specifies the number of seconds this \fBSA\fR can exist after first being used.
614 If this extension is not present, the default value is zero, which means the
615 \fBSA\fR will not expire based on how long it has been since it was added. This
616 extension is used by the \fBadd\fR and \fBupdate\fR commands.
620 .ne 2
622 \fB\fBsaddr \fIaddress\fR | \fIname\fR\fR\fR
626 \fB\fBsrcaddr \fIaddress\fR | \fIname\fR\fR\fR
630 \fB\fBsaddr6 \fIIPv6 address\fR\fR\fR
634 \fB\fBsrcaddr6 \fIIPv6 address\fR\fR\fR
638 \fB\fBsrc \fIaddress\fR | \fIname\fR\fR\fR
642 \fB\fBsrc6 \fIIPv6 address\fR\fR\fR
644 .sp .6
645 .RS 4n
646 \fBsrcaddr \fIaddress\fR\fR and \fBsrc \fIaddress\fR\fR are synonyms that
647 indicate the source address of the \fBSA\fR. If unspecified, the source address
648 will either remain unset, or it will be set to a wildcard address if a
649 destination address was supplied. To not specify the source address is valid
650 for IPsec \fBSA\fRs. Future \fBSA\fR types may alter this assumption. This
651 extension is used by the \fBadd\fR, \fBupdate\fR, \fBget\fR and \fBdelete\fR
652 commands.
656 .ne 2
658 \fB\fBdaddr \fI<address>\fR|\fI<name>\fR\fR\fR
662 \fB\fBdstaddr \fI<address>\fR|\fI<name>\fR\fR\fR
666 \fB\fBdaddr6 \fI<IPv6 address>\fR|\fI<name>\fR\fR\fR
670 \fB\fBdstaddr6 \fI<IPv6 address>\fR|\fI<name>\fR\fR\fR
674 \fB\fBdst \fI<addr>\fR|\fI<name>\fR\fR\fR
678 \fB\fBdst6 \fI<IPv6 address>\fR|\fI<name>\fR\fR\fR
680 .sp .6
681 .RS 4n
682 \fBdstaddr \fI<addr>\fR\fR and \fBdst \fI<addr>\fR\fR are synonyms that
683 indicate the destination address of the \fBSA\fR. If unspecified, the
684 destination address will remain unset. Because IPsec \fBSA\fRs require a
685 specified destination address and \fBspi\fR for identification, this extension,
686 with a specific value, is required for the \fBadd\fR, \fBupdate\fR, \fBget\fR
687 and \fBdelete\fR commands.
689 If a name is given, \fBipseckey\fR will attempt to invoke the command on
690 multiple \fBSA\fRs with all of the destination addresses that the name can
691 identify. This is similar to how \fBipsecconf\fR handles addresses.
693 If \fBdst6\fR or \fBdstaddr6\fR is specified, only the IPv6 addresses
694 identified by a name are used.
698 .ne 2
700 \fB\fBsport\fR \fI<portnum>\fR\fR
702 .sp .6
703 .RS 4n
704 \fBsport\fR specifies the source port number for an SA. It should be used in
705 combination with an upper-layer protocol (see below), but it does not have to
710 .ne 2
712 \fB\fBdport\fR \fI<portnum>\fR\fR
714 .sp .6
715 .RS 4n
716 sport specifies the destination port number for an SA. It should be used in
717 combination with an upper-layer protocol (see below), but it does not have to
722 .ne 2
724 \fB\fBencap\fR \fI<protocol>\fR\fR
726 .sp .6
727 .RS 4n
728 Identifies the protocol used to encapsulate NAT-traversal IPsec packets. Other
729 NAT-traversal parameters (\fBnat_*\fR) are below.  The only acceptable value
730 for \fI<protocol>\fR currently is \fBudp\fR.
734 .ne 2
736 \fB\fBproto\fR \fI<protocol number>\fR\fR
740 \fB\fBulp\fR \fI<protocol number>\fR\fR
742 .sp .6
743 .RS 4n
744 \fBproto\fR, and its synonym \fBulp\fR, specify the IP protocol number of the
749 .ne 2
751 \fB\fBnat_loc\fR \fI<address>\fR|\fI<name>\fR\fR
753 .sp .6
754 .RS 4n
755 If the local address in the SA (source or destination) is behind a NAT, this
756 extension indicates the NAT node's globally-routable address. This address can
757 match the SA's local address if there is a \fBnat_lport\fR (see below)
758 specified.
762 .ne 2
764 \fB\fBnat_rem\fR \fI<address>\fR|\fI<name>\fR\fR
766 .sp .6
767 .RS 4n
768 If the remote address in the SA (source or destination) is behind a NAT, this
769 extension indicates that node's internal (that is, behind-the-NAT) address.
770 This address can match the SA's local address if there is a \fBnat_rport\fR
771 (see below) specified.
775 .ne 2
777 \fB\fBnat_lport\fR \fI<portnum>\fR\fR
779 .sp .6
780 .RS 4n
781 Identifies the local UDP port on which encapsulation of ESP occurs.
785 .ne 2
787 \fB\fBnat_rport\fR \fI<portnum>\fR\fR
789 .sp .6
790 .RS 4n
791 Identifies the remote UDP port on which encapsulation of ESP occurs.
795 .ne 2
797 \fB\fBisrc\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
801 \fB\fBinnersrc\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
805 \fB\fBisrc6\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
809 \fB\fBinnersrc6\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
813 \fB\fBproxyaddr\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
817 \fB\fBproxy\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
819 .sp .6
820 .RS 4n
821 \fBisrc\fR \fI<address>\fR[/\fI<prefix>\fR] and \fBinnersrc\fR
822 \fI<address>\fR[/\fI<prefix>\fR] are synonyms. They indicate the inner source
823 address for a tunnel-mode SA.
825 An inner-source can be a prefix instead of an address. As with other address
826 extensions, there are IPv6-specific forms. In such cases, use only
827 IPv6-specific addresses or prefixes.
829 Previous versions referred to this value as the proxy address. The usage, while
830 deprecated, remains.
834 .ne 2
836 \fB\fBidst\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
840 \fB\fBinnerdst\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
844 \fB\fBidst6\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
848 \fB\fBinnerdst6\fR \fI<address>\fR | \fI<name>\fR[/\fI<prefix>\fR]\fR
850 .sp .6
851 .RS 4n
852 \fBidst\fR \fI<address>\fR[/\fI<prefix>\fR] and \fBinnerdst\fR
853 \fI<address>\fR[/\fI<prefix>\fR] are synonyms. They indicate the inner
854 destination address for a tunnel-mode SA.
856 An inner-destination can be a prefix instead of an address. As with other
857 address extensions, there are IPv6-specific forms. In such cases, use only
858 IPv6-specific addresses or prefixes.
862 .ne 2
864 \fB\fBinnersport\fR \fI<portnum>\fR\fR
868 \fB\fBisport\fR \fI<portnum>\fR\fR
870 .sp .6
871 .RS 4n
872 \fBinnersport\fR specifies the source port number of the inner header for a
873 tunnel-mode SA. It should be used in combination with an upper-layer protocol
874 (see below), but it does not have to be.
878 .ne 2
880 \fB\fBinnerdport\fR \fI<portnum>\fR\fR
884 \fB\fBidport\fR \fI<portnum>\fR\fR
886 .sp .6
887 .RS 4n
888 \fBinnerdport\fR specifies the destination port number of the inner header for
889 a tunnel-mode SA. It should be used in combination with an upper-layer protocol
890 (see below), but it does not have to be.
894 .ne 2
896 \fB\fBiproto\fR \fI<protocol number>\fR\fBiulp\fR \fI<protocol number>\fR\fR
898 .sp .6
899 .RS 4n
900 \fBiproto\fR, and its synonym \fBiulp\fR, specify the IP protocol number of the
901 inner header of a tunnel-mode SA.
905 .ne 2
907 \fB\fBauthkey \fI<hexstring>\fR\fR\fR
909 .sp .6
910 .RS 4n
911 Specifies the authentication key for this \fBSA\fR. The key is expressed as a
912 string of hexadecimal digits, with an optional \fB/\fR at the end, for example,
913 \fB123/12\fR. Bits are counted from the most-significant bits down. For
914 example, to express three '1' bits, the proper syntax is the string
915 "\fBe/3\fR". For multi-key algorithms, the string is the concatenation of the
916 multiple keys. This extension is used by the \fBadd\fR and \fBupdate\fR
917 commands.
921 .ne 2
923 \fB\fBencrkey \fI<hexstring>\fR\fR\fR
925 .sp .6
926 .RS 4n
927 Specifies the encryption key for this \fBSA\fR. The syntax of the key is the
928 same as \fBauthkey\fR. A concrete example of a multi-key encryption algorithm
929 is \fB3des\fR, which would express itself as a 192-bit key, which is three
930 64-bit parity-included \fBDES\fR keys. This extension is used by the \fBadd\fR
931 and \fBupdate\fR commands.
936 Certificate identities are very useful in the context of automated key
937 management, as they tie the \fBSA\fR to the public key certificates used in
938 most automated key management protocols. They are less useful for manually
939 added \fBSA\fRs. Unlike other extensions, \fBsrcidtype\fR takes two values, a
940 \fItype\fR, and an actual \fIvalue\fR. The type can be one of the following:
942 .ne 2
944 \fB\fBprefix\fR\fR
946 .sp .6
947 .RS 4n
948 An address prefix.
952 .ne 2
954 \fB\fBfqdn\fR\fR
956 .sp .6
957 .RS 4n
958 A fully-qualified domain name.
962 .ne 2
964 \fB\fBdomain\fR\fR
966 .sp .6
967 .RS 4n
968 Domain name, synonym for \fBfqdn\fR.
972 .ne 2
974 \fB\fBuser_fqdn\fR\fR
976 .sp .6
977 .RS 4n
978 User identity of the form \fB\fIuser\fR@\fIfqdn\fR\fR.
982 .ne 2
984 \fB\fBmailbox\fR\fR
986 .sp .6
987 .RS 4n
988 Synonym for \fBuser_fqdn\fR.
993 The \fIvalue\fR is an arbitrary text string that should identify the
994 certificate.
996 .ne 2
998 \fB\fBsrcidtype \fI<type, value>\fR\fR\fR
1000 .sp .6
1001 .RS 4n
1002 Specifies a source certificate identity for this \fBSA\fR. This extension is
1003 used by the \fBadd\fR and \fBupdate\fR commands.
1007 .ne 2
1009 \fB\fBdstidtype \fI<type, value>\fR\fR\fR
1011 .sp .6
1012 .RS 4n
1013 Specifies a destination certificate identity for this \fBSA\fR. This extension
1014 is used by the \fBadd\fR and \fBupdate\fR commands
1017 .SS "Tunnel Mode versus Transport Mode SAs"
1020 An IPsec SA is a Tunnel Mode SA if the "proto" value is either 4 (\fBipip\fR)
1021 or 41 (\fBipv6\fR) \fBand\fR there is an inner-address or inner-port value
1022 specified. Otherwise, the SA is a Transport Mode SA.
1023 .SH SECURITY
1026 Keying material is very sensitive and should be generated as randomly as
1027 possible. Some algorithms have known weak keys. IPsec algorithms have built-in
1028 weak key checks, so that if a weak key is in a newly added \fBSA\fR, the
1029 \fBadd\fR command will fail with an invalid value.
1032 The \fBipseckey\fR command allows a privileged user to enter cryptographic
1033 keying information. If an adversary gains access to such information, the
1034 security of IPsec traffic is compromised. The following issues should be taken
1035 into account when using the \fBipseckey\fR command.
1036 .RS +4
1039 Is the \fBTTY\fR going over a network (interactive mode)?
1040 .RS +4
1042 .ie t \(bu
1043 .el o
1044 If it is, then the security of the keying material is the security of the
1045 network path for this \fBTTY\fR's traffic. Using \fBipseckey\fR over a
1046 clear-text \fBtelnet\fR or \fBrlogin\fR session is risky.
1048 .RS +4
1050 .ie t \(bu
1051 .el o
1052 Even local windows might be vulnerable to attacks where a concealed program
1053 that reads window events is present.
1056 .RS +4
1059 Is the file accessed over the network or readable to the world (\fB-f\fR
1060 option)?
1061 .RS +4
1063 .ie t \(bu
1064 .el o
1065 A network-mounted file can be sniffed by an adversary as it is being read.
1067 .RS +4
1069 .ie t \(bu
1070 .el o
1071 A world-readable file with keying material in it is also risky.
1074 .RS +4
1077 The \fBipseckey\fR command is designed to be managed by the \fBmanual-key\fR
1078 \fBsmf\fR(5) service. Because the \fBsmf\fR(5) log files are world-readable,
1079 the \fBipseckey\fR does not record any syntax errors in the log files, as these
1080 errors might include secret information.
1082 If a syntax error is found when the \fBmanual-key\fR \fBsmf\fR(5) service is
1083 enabled, the service enters maintenance mode. The log file will indicate that
1084 there was a syntax error, but will not specify what the error was.
1086 The administrator should use \fBipeckey\fR \fB-c\fR \fIfilename\fR from the
1087 command line to discover the cause of the errors. See \fBOPTIONS\fR.
1091 If your source address is a host that can be looked up over the network and
1092 your naming system itself is compromised, then any names used will not be
1093 trustworthy.
1096 Security weaknesses often lie in misapplication of tools, not in the tools
1097 themselves. Administrators are urged to be cautious when using \fBipseckey\fR.
1098 The safest mode of operation is probably on a console or other hard-connected
1099 \fBTTY\fR.
1102 For further thoughts on this subject, see the afterward by Matt Blaze in Bruce
1103 Schneier's \fIApplied Cryptography: Protocols, Algorithms, and Source Code in
1104 C\fR.
1105 .SS "Service Management Facility"
1108 IPsec manual keys are managed by the service management facility, \fBsmf\fR(5).
1109 The services listed below manage the components of IPsec. These services are
1110 delivered as follows:
1112 .in +2
1114 svc:/network/ipsec/policy:default (enabled)
1115 svc:/network/ipsec/ipsecalgs:default (enabled)
1116 svc:/network/ipsec/manual-key:default (disabled)
1117 svc:/network/ipsec/ike:default (disabled)
1119 .in -2
1124 The manual-key service is delivered disabled. The system administrator must
1125 create manual IPsec Security Associations (SAs), as described in this man page,
1126 before enabling that service.
1129 The policy service is delivered enabled, but without a configuration file, so
1130 that, as a starting condition, packets are not protected by IPsec. After you
1131 create the configuration file \fB/etc/inet/ipsecinit.conf\fR and refresh the
1132 service (\fBsvcadm refresh\fR, see below), the policy contained in the
1133 configuration file is applied. If there is an error in this file, the service
1134 enters maintenance mode. See \fBipsecconf\fR(8).
1137 Services that are delivered disabled are delivered that way because the system
1138 administrator must create configuration files for those services before
1139 enabling them. See \fBike.config\fR(4) for the \fBike\fR service.
1142 See \fBipsecalgs\fR(8) for the \fBipsecalgs\fR service.
1145 The correct administrative procedure is to create the configuration file for
1146 each service, then enable each service using \fBsvcadm\fR(8).
1149 If the configuration needs to be changed, edit the configuration file then
1150 refresh the service, as follows:
1152 .in +2
1154 example# \fBsvcadm refresh manual-key\fR
1156 .in -2
1161 \fBWarning:\fR To prevent \fBipseckey\fR complaining about duplicate
1162 Associations, the \fBipseckey\fR command flushes the Security Association Data
1163 Base (SADB) when the \fBipseckey\fR command is run from \fBsmf\fR(5), before
1164 adding any new Security Associations defined in the configuration file. This
1165 differs from the command line behavior where the SADB is not flushed before
1166 adding new Security Associations.
1169 The \fBsmf\fR(5) framework will record any errors in the service-specific log
1170 file. Use any of the following commands to examine the \fBlogfile\fR property:
1172 .in +2
1174 example# \fBsvcs -l manual-key\fR
1175 example# \fBsvcprop manual-key\fR
1176 example# \fBsvccfg -s manual-key listprop\fR
1178 .in -2
1183 The following property is defined for the \fBmanual-key\fR service:
1185 .in +2
1187 config/config_file
1189 .in -2
1194 This property can be modified using \fBsvccfg\fR(8) by users who have been
1195 assigned the following authorization:
1197 .in +2
1199 solaris.smf.value.ipsec
1201 .in -2
1206 See \fBauths\fR(1), \fBuser_attr\fR(4), \fBrbac\fR(5).
1209 The service needs to be refreshed using \fBsvcadm\fR(8) before the new
1210 property is effective. General non-modifiable properties can be viewed with the
1211 \fBsvcprop\fR(1) command.
1213 .in +2
1215 # \fBsvccfg -s ipsec/manual-key setprop config/config_file = \e
1216 /new/config_file\fR
1217 # \fBsvcadm refresh manual-key\fR
1219 .in -2
1224 Administrative actions on this service, such as enabling, disabling,
1225 refreshing, and requesting restart can be performed using \fBsvcadm\fR(8). A
1226 user who has been assigned the authorization shown below can perform these
1227 actions:
1229 .in +2
1231 solaris.smf.manage.ipsec
1233 .in -2
1238 The service's status can be queried using the \fBsvcs\fR(1) command.
1241 The \fBipseckey\fR command is designed to be run under \fBsmf\fR(5) management.
1242 While the \fBipsecconf\fR command can be run from the command line, this is
1243 discouraged. If the \fBipseckey\fR command is to be run from the command line,
1244 the \fBmanual-key\fR \fBsmf\fR(5) service should be disabled first. See
1245 \fBsvcadm\fR(8).
1246 .SH EXAMPLES
1248 \fBExample 1 \fREmptying Out All \fBSA\fRs
1251 To empty out all \fBSA\fR:
1254 .in +2
1256 example# \fBipseckey flush\fR
1258 .in -2
1262 \fBExample 2 \fRFlushing Out IPsec AH \fBSA\fRs Only
1265 To flush out only IPsec \fBAH\fR \fBSA\fRs:
1268 .in +2
1270 example# \fBipseckey flush ah\fR
1272 .in -2
1276 \fBExample 3 \fRSaving All \fBSA\fRs To Standard Output
1279 To save all \fBSA\fRs to the standard output:
1282 .in +2
1284 example# \fBipseckey save all\fR
1286 .in -2
1290 \fBExample 4 \fRSaving \fBESP\fR \fBSA\fRs To The File \fB/tmp/snapshot\fR
1293 To save \fBESP\fR \fBSA\fRs to the file \fB/tmp/snapshot\fR:
1296 .in +2
1298 example# \fBipseckey save esp /tmp/snapshot\fR
1300 .in -2
1304 \fBExample 5 \fRDeleting an IPsec \fBSA\fR
1307 To delete an IPsec \fBSA\fR, only the \fBSPI\fR and the destination address are
1308 needed:
1311 .in +2
1313 example# \fBipseckey delete esp spi 0x2112 dst 224.0.0.1\fR
1315 .in -2
1320 An alternative would be to delete the SA and the SAs pair if it has one:
1323 .in +2
1325 example# \fBipseckey delete-pair esp spi 0x2112 dst 224.0.0.1\fR
1327 .in -2
1331 \fBExample 6 \fRGetting Information on an IPsec \fBSA\fR
1334 Likewise, getting information on a \fBSA\fR only requires the destination
1335 address and \fBSPI\fR:
1338 .in +2
1340 example# \fBipseckey get ah spi 0x5150 dst mypeer\fR
1342 .in -2
1346 \fBExample 7 \fRAdding or Updating IPsec \fBSA\fRs
1349 Adding or updating \fBSA\fRs requires entering interactive mode:
1352 .in +2
1354 example# \fBipseckey\fR
1355 ipseckey> \fBadd ah spi 0x90125 src me.domain.com dst you.domain.com \e
1356           authalg md5 authkey 1234567890abcdef1234567890abcdef\fR
1357 ipseckey> \fBupdate ah spi 0x90125 dst you.domain.com hard_bytes \e
1358           16000000\fR
1359 ipseckey> \fBexit\fR
1361 .in -2
1366 Adding two SAs that are linked together as a pair:
1369 .in +2
1371 example# \fBipseckey\fR
1372 ipseckey> \fBadd esp spi 0x2345 src me.domain.com dst you.domain.com \e
1373    authalg md5 authkey bde359723576fdea08e56cbe876e24ad \e
1374    encralg des encrkey be02938e7def2839\fR
1375 ipseckey> \fBadd esp spi 0x5432 src me.domain.com dst you.domain.com \e
1376    authalg md5 authkey bde359723576fdea08e56cbe876e24ad \e
1377    encralg des encrkey be02938e7def2839 pair-spi 0x2345\fR
1378 ipseckey> \fBexit\fR
1380 .in -2
1384 \fBExample 8 \fRAdding an \fBSA\fR in the Opposite Direction
1387 In the case of IPsec, \fBSA\fRs are unidirectional. To communicate securely, a
1388 second \fBSA\fR needs to be added in the opposite direction. The peer machine
1389 also needs to add both \fBSA\fRs.
1392 .in +2
1394 example# \fBipseckey\fR
1395 ipseckey> \fBadd ah spi 0x2112 src you.domain.com dst me.domain.com \e
1396           authalg md5 authkey bde359723576fdea08e56cbe876e24ad \e
1397           hard_bytes 16000000\fR
1398 ipseckey> \fBexit\fR
1400 .in -2
1404 \fBExample 9 \fRMonitoring \fBPF_KEY\fR Messages
1407 Monitoring for \fBPF_KEY\fR messages is straightforward:
1410 .in +2
1412 example# \fBipseckey monitor\fR
1414 .in -2
1418 \fBExample 10 \fRUsing Commands in a File
1421 Commands can be placed in a file that can be parsed with the \fB-f\fR option.
1422 This file may contain comment lines that begin with the "#" symbol. For
1423 example:
1426 .in +2
1428 # This is a sample file for flushing out the ESP table and
1429 # adding a pair of SAs.
1431 flush esp
1433 ### Watch out!  I have keying material in this file.  See the
1434 ### SECURITY section in this manual page for why this can be
1435 ### dangerous .
1437 add esp spi 0x2112 src me.domain.com dst you.domain.com \e
1438     authalg md5 authkey bde359723576fdea08e56cbe876e24ad \e
1439     encralg des encrkey be02938e7def2839 hard_usetime 28800
1440 add esp spi 0x5150 src you.domain.com dst me.domain.com \e
1441     authalg md5 authkey 930987dbe09743ade09d92b4097d9e93 \e
1442     encralg des encrkey 8bd4a52e10127deb hard_usetime 28800
1444 ## End of file  -  This is a gratuitous comment
1446 .in -2
1449 \fBExample 11 \fRAdding SAs for IPv6 Addresses
1452 The following commands from the interactive-mode create an SA to protect IPv6
1453 traffic between the site-local addresses
1456 .in +2
1458 example # \fBipseckey\fR
1459 ipseckey> \fBadd esp spi 0x6789 src6 fec0:bbbb::4483 dst6 fec0:bbbb::7843\e
1460            authalg md5 authkey bde359723576fdea08e56cbe876e24ad \e
1461           encralg des encrkey be02938e7def2839 hard_usetime 28800\fR
1462 ipseckey>\fBexit\fR
1464 .in -2
1468 \fBExample 12 \fRLinking Two SAs as a Pair
1471 The following command links two SAs together, as a pair:
1474 .in +2
1476 example# \fBipseckey update esp spi 0x123456 dst 192.168.99.2 \e
1477 pair-spi 0x654321\fR
1479 .in -2
1482 .SH FILES
1484 .ne 2
1486 \fB\fB/etc/inet/secret/ipseckeys\fR\fR
1488 .sp .6
1489 .RS 4n
1490 Default configuration file used at boot time. See "Service Management Facility"
1491 and \fBSECURITY\fR for more information.
1494 .SH ATTRIBUTES
1497 See \fBattributes\fR(5) for descriptions of the following attributes:
1502 box;
1503 c | c
1504 l | l .
1505 ATTRIBUTE TYPE  ATTRIBUTE VALUE
1506 Interface Stability     Committed
1509 .SH SEE ALSO
1512 \fBps\fR(1), \fBsvcprop\fR(1), \fBsvcs\fR(1), \fBipsecconf\fR(8),
1513 \fBipsecalgs\fR(8), \fBroute\fR(8), \fBsvcadm\fR(8), \fBsvccfg\fR(8),
1514 \fBike.config\fR(4), \fBattributes\fR(5), \fBsmf\fR(5), \fBipsec\fR(7P),
1515 \fBipsecah\fR(7P), \fBipsecesp\fR(7P), \fBpf_key\fR(7P)
1518 Schneier, B., \fIApplied Cryptography: Protocols, Algorithms, and Source Code
1519 in C\fR. Second ed. New York, New York: John Wiley & Sons, 1996.
1520 .SH DIAGNOSTICS
1523 The \fBipseckey\fR command parses the configuration file and reports any
1524 errors. In the case of multiple errors, \fBipseckey\fR reports as many of these
1525 as possible.
1528 The \fBipseckey\fR command does not attempt to use a \fBCOMMAND\fR that has a
1529 syntax error. A \fBCOMMAND\fR might be syntactically correct but can
1530 nevertheless generate an error because the kernel rejected the request made to
1531 \fBpf_key\fR(7P). This might occur because a key had an invalid length or
1532 because an unsupported algorithm was specified.
1535 If there are any errors in the configuration file, ipseckey reports the number
1536 of valid COMMANDS and the total number of COMMANDS parsed.
1538 .ne 2
1540 \fB\fBParse error on line \fIN\fR.\fR\fR
1542 .sp .6
1543 .RS 4n
1544 If an interactive use of \fBipseckey\fR would print usage information, this
1545 would print instead. Usually proceeded by another diagnostic. Because
1546 \fBCOMMANDS\fR can cover more than a single line in the configuration file by
1547 using the backslash character to delimit lines, its not always possible to
1548 pinpoint in the configuration file the exact line that caused the error.
1552 .ne 2
1554 \fB\fBUnexpected end of command line.\fR\fR
1556 .sp .6
1557 .RS 4n
1558 An additional argument was expected on the command line.
1562 .ne 2
1564 \fBUnknown\fR
1566 .sp .6
1567 .RS 4n
1568 A value for a specific extension was unknown.
1572 .ne 2
1574 \fB\fBAddress type \fIN\fR not supported.\fR\fR
1576 .sp .6
1577 .RS 4n
1578 A name-to-address lookup returned an unsupported address family.
1582 .ne 2
1584 \fB\fB\fIN\fR is not a bit specifier\fR\fR
1588 \fB\fBbit length \fIN\fR is too big for\fR\fR
1592 \fB\fBstring is not a hex string\fR\fR
1594 .sp .6
1595 .RS 4n
1596 Keying material was not entered appropriately.
1600 .ne 2
1602 \fB\fBCan only specify single\fR\fR
1604 .sp .6
1605 .RS 4n
1606 A duplicate extension was entered.
1610 .ne 2
1612 \fB\fBDon't use extension for \fI<string>\fR for \fI<command>\fR\&.\fR\fR
1614 .sp .6
1615 .RS 4n
1616 An extension not used by a command was used.
1620 .ne 2
1622 \fB\fBOne of the entered values is incorrect: Diagnostic code \fINN\fR:
1623 \fI<msg>\fR\fR\fR
1625 .sp .6
1626 .RS 4n
1627 This is a general invalid parameter error. The diagnostic code and message
1628 provides more detail about what precise value was incorrect and why.
1631 .SH NOTES
1634 In spite of its IPsec-specific name, \fBipseckey\fR is analogous to
1635 \fBroute\fR(8), in that it is a command-line interface to a socket-based
1636 administration engine, in this case, \fBPF_KEY\fR. \fBPF_KEY\fR was originally
1637 developed at the United States Naval Research Laboratory.
1640 To have machines communicate securely with manual keying, \fBSA\fRs need to be
1641 added by all communicating parties. If two nodes wish to communicate securely,
1642 both nodes need the appropriate \fBSA\fRs added.
1645 In the future \fBipseckey\fR may be invoked under additional names as other
1646 security protocols become available to \fBPF_KEY\fR.
1649 This command requires \fBsys_ip_config\fR privilege to operate and thus can run
1650 in the global zone and in exclusive-IP zones. The global zone can set up
1651 security associations with \fBipseckey\fR to protect traffic for shared-IP
1652 zones on the system.