| 1 |
.TH POLICY.CONF 5 "September 2021" "@PACKAGE_VERSION@" "openCryptoki" |
| 2 |
.SH NAME |
| 3 |
policy.conf \- Configuration file for openCryptoki policies. |
| 4 |
|
| 5 |
.SH DESCRIPTION |
| 6 |
openCryptoki uses a policy configuration file at |
| 7 |
/etc/opencryptoki/policy.conf |
| 8 |
|
| 9 |
This configuration file restricts the operations of openCryptoki to a |
| 10 |
specific set of allowed operations. The policy allows users to |
| 11 |
restrict keys to a minimal cryptographic strength, restrict supported |
| 12 |
elliptic curves, mechanisms, MGFs, KDFs, or PRFs. |
| 13 |
|
| 14 |
.SH SYNTAX |
| 15 |
This file starts with a version specification of the form |
| 16 |
\fBversion policy-0\fR |
| 17 |
followed by policy constraints. |
| 18 |
|
| 19 |
.P |
| 20 |
|
| 21 |
A policy constraint assigns a value to a configuration key. The |
| 22 |
syntax depends of the value of the key: |
| 23 |
|
| 24 |
.TP |
| 25 |
.BR strength |
| 26 |
|
| 27 |
This key defines the minimal required strength for keys, and digest |
| 28 |
and signature sizes. It corresponds to the definition in |
| 29 |
/etc/opencryptoki/strength.conf. Valid values are 0, 112, 128, 192, |
| 30 |
and 256. The special value 0 allows every key and arbitrary size of |
| 31 |
digests and signatures. The format is a simple assignment: |
| 32 |
|
| 33 |
strength = number |
| 34 |
|
| 35 |
If other values are used, they are rounded up to the next supported |
| 36 |
value. Values greater than 256 are rounded down to 256. |
| 37 |
|
| 38 |
.TP |
| 39 |
.BR allowedmechs |
| 40 |
|
| 41 |
This key specifies a list of mechanisms that are allowed by this |
| 42 |
policy. The list should contain a comma-separated list of |
| 43 |
.BR CKM_ |
| 44 |
constants supported by openCryptoki. The list is placed inside |
| 45 |
brackets: |
| 46 |
|
| 47 |
allowedmechs ( mech1, mech2 ) |
| 48 |
|
| 49 |
Note: This key is optional. If not present, all mechanisms are |
| 50 |
allowed. If an empty list is provided, no mechanism would be allowed. |
| 51 |
.TP |
| 52 |
.BR allowedcurves |
| 53 |
|
| 54 |
This key specifies a list of allowed elliptic curves. Keys that do |
| 55 |
not belong to any of the allowed curves cannot be created or used. |
| 56 |
The list has the same format as the |
| 57 |
.BR allowedmechs |
| 58 |
key: |
| 59 |
|
| 60 |
allowedcurves ( curve1, curve2 ) |
| 61 |
|
| 62 |
Valid curve names are: |
| 63 |
|
| 64 |
.RS |
| 65 |
.IP \(bu |
| 66 |
BRAINPOOL_P160R1 |
| 67 |
.IP \(bu |
| 68 |
BRAINPOOL_P160T1 |
| 69 |
.IP \(bu |
| 70 |
BRAINPOOL_P192R1 |
| 71 |
.IP \(bu |
| 72 |
BRAINPOOL_P192T1 |
| 73 |
.IP \(bu |
| 74 |
BRAINPOOL_P224R1 |
| 75 |
.IP \(bu |
| 76 |
BRAINPOOL_P224T1 |
| 77 |
.IP \(bu |
| 78 |
BRAINPOOL_P256R1 |
| 79 |
.IP \(bu |
| 80 |
BRAINPOOL_P256T1 |
| 81 |
.IP \(bu |
| 82 |
BRAINPOOL_P320R1 |
| 83 |
.IP \(bu |
| 84 |
BRAINPOOL_P320T1 |
| 85 |
.IP \(bu |
| 86 |
BRAINPOOL_P384R1 |
| 87 |
.IP \(bu |
| 88 |
BRAINPOOL_P384T1 |
| 89 |
.IP \(bu |
| 90 |
BRAINPOOL_P512R1 |
| 91 |
.IP \(bu |
| 92 |
BRAINPOOL_P512T1 |
| 93 |
.IP \(bu |
| 94 |
PRIME192V1 |
| 95 |
.IP \(bu |
| 96 |
SECP224R1 |
| 97 |
.IP \(bu |
| 98 |
PRIME256V1 |
| 99 |
.IP \(bu |
| 100 |
SECP384R1 |
| 101 |
.IP \(bu |
| 102 |
SECP521R1 |
| 103 |
.IP \(bu |
| 104 |
SECP256K1 |
| 105 |
.IP \(bu |
| 106 |
CURVE25519 |
| 107 |
.IP \(bu |
| 108 |
CURVE448 |
| 109 |
.IP \(bu |
| 110 |
ED25519 |
| 111 |
.IP \(bu |
| 112 |
ED448 |
| 113 |
.RE |
| 114 |
|
| 115 |
Note: This key is optional. If not present, all curves are allowed. |
| 116 |
An empty list allows no curve. |
| 117 |
.TP |
| 118 |
.BR allowedmgfs |
| 119 |
|
| 120 |
This key specifies the allowed Message Generation Functions (MGFs) for |
| 121 |
use in RSA OAEP and RSA PSS. The value is a list of |
| 122 |
.BR CKG_ |
| 123 |
constants supported by openCryptoki. The list has the same format as |
| 124 |
the |
| 125 |
.BR allowedmechs |
| 126 |
key: |
| 127 |
|
| 128 |
allowedmgfs ( mgf1, mgf2 ) |
| 129 |
|
| 130 |
Note: This key is optional. If not present, all MGFs are allowed. An |
| 131 |
empty list allows no MGF. |
| 132 |
.TP |
| 133 |
.BR allowedkdfs |
| 134 |
|
| 135 |
This key specifies the allowed Key Derivation Functions (KDFs) for use |
| 136 |
in ECDH key derivation and Kyber KEM. The value is a list of |
| 137 |
.BR CKD_ |
| 138 |
constants supported by openCryptoki. This list has the same format as |
| 139 |
the |
| 140 |
.BR allowedmechs |
| 141 |
key: |
| 142 |
|
| 143 |
allowedkdfs ( kdf1, kdf2 ) |
| 144 |
|
| 145 |
Note: This key is optional. If not present, all KDFs are allowed. An |
| 146 |
empty list allows no KDF. |
| 147 |
.TP |
| 148 |
.BR allowedprfs |
| 149 |
|
| 150 |
This key specifies the allowed Pseudo-Random Functions (PRFs) for use |
| 151 |
in PKCS #5 PBKDF. The value is a list of PRFs. Currently, the only |
| 152 |
supported value is |
| 153 |
.BR CKP_PKCS5_PBKD2_HMAC_SHA256 |
| 154 |
.BR CKP_PKCS5_PBKD2_HMAC_SHA512 |
| 155 |
which leads to the list |
| 156 |
|
| 157 |
allowedprfs ( CKP_PKCS5_PBKD2_HMAC_SHA512, CKP_PKCS5_PBKD2_HMAC_SHA256 ) |
| 158 |
|
| 159 |
Note: This key is optional. If not present, all PRFs are allowed. An |
| 160 |
empty list allows no PRF. |
| 161 |
|
| 162 |
.SH NOTES |
| 163 |
|
| 164 |
The policy configuration file has to be owned by \fBroot:@pkcs_group@\fP and |
| 165 |
have mode 0640. Otherwise, openCryptoki will return |
| 166 |
\fBCKR_FUNCTION_FAILED\fR on \fBC_Initialize\fR and log the reason |
| 167 |
into syslog. |
| 168 |
|
| 169 |
.PP |
| 170 |
|
| 171 |
The pound sign ('#') is used to indicate a comment. Both the comment |
| 172 |
character and any text after it, up to the end of the line, are |
| 173 |
ignored. The comment character can be used at the beginning of a line |
| 174 |
(including before the file version specification), after the strength |
| 175 |
value, after a comma, and before and after the bracket. |
| 176 |
|
| 177 |
.PP |
| 178 |
Since the policy indirectly refers to a strength configuration, a |
| 179 |
strength configuration has to exist and be valid. If no strength |
| 180 |
configuration exists, no policy will be enforced. If an existing |
| 181 |
policy configuration is invalid, openCryptoki cannot be used. |
| 182 |
|
| 183 |
.PP |
| 184 |
|
| 185 |
openCryptoki uses some cryptographic operations to store token |
| 186 |
objects. These operations have to be allowed by the policy. Which |
| 187 |
operations are needed depends on the token store format and the token |
| 188 |
(since the ICSF Token as a remote token uses different crypto |
| 189 |
operations to store its management data): |
| 190 |
|
| 191 |
.RS |
| 192 |
.IP "FIPS compliant format" |
| 193 |
Token stores in the FIPS compliant format need the mechanisms |
| 194 |
.BR CKM_AES_KEY_GEN, |
| 195 |
.BR CKM_AES_KEY_WRAP, |
| 196 |
.BR CKM_AES_GCM, |
| 197 |
.BR CKM_PKCS5_PBKD2, |
| 198 |
the PRF |
| 199 |
.BR CKP_PKCS5_PBKD2_HMAC_SHA512, |
| 200 |
and must allow 256 bit AES keys. |
| 201 |
.IP "legacy format" |
| 202 |
Token stores in legacy format need the mechanisms |
| 203 |
.BR CKM_DES3_KEY_GEN, |
| 204 |
.BR CKM_DES3_CBC, |
| 205 |
.BR CKM_AES_KEY_GEN, |
| 206 |
.BR CKM_AES_CBC, |
| 207 |
.BR CKM_SHA1, |
| 208 |
.BR CKM_MD5 |
| 209 |
and must allow 2-key TDES keys (80 bit symmetric keys with 64 bit signatures). |
| 210 |
.IP "ICSF Token store" |
| 211 |
.BR CKM_AES_KEY_GEN, |
| 212 |
.BR CKM_AES_CBC, |
| 213 |
.BR CKM_SHA1, |
| 214 |
.BR CKM_MD5 |
| 215 |
.BR CKM_PKCS5_PBKD2, |
| 216 |
the PRF |
| 217 |
.BR CKP_PKCS5_PBKD2_HMAC_SHA256, |
| 218 |
and must allow 256 bit AES keys. |
| 219 |
.RE |
| 220 |
|
| 221 |
Tokens cannot be loaded if their token store format is not supported |
| 222 |
by the policy. If a token cannot be loaded, a message is printed into |
| 223 |
syslog detailing the policy violation. To fix this problem, make sure |
| 224 |
the token format is allowed by your policy (either by satisfying above |
| 225 |
constraints or by temporarily removing /etc/opencryptoki/policy.conf) |
| 226 |
and migrate your token store, e.g., to the FIPS-compliant format. |
| 227 |
|
| 228 |
.SH "SEE ALSO" |
| 229 |
.PD 0 |
| 230 |
.TP |
| 231 |
\fBstrength.conf\fP(5), |
| 232 |
.TP |
| 233 |
\fBopencryptoki\fP(7), |
| 234 |
.TP |
| 235 |
\fBpkcstok_migrate\fP(1), |
| 236 |
.TP |
| 237 |
/usr/share/doc/opencryptoki/policy-example.conf |
| 238 |
.PD |