Skip to content

Commit fe2520f

Browse files
committed
docs: document new FIDO2 user record fields
1 parent 0eb3be4 commit fe2520f

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

docs/USER_RECORD.md

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ below). It's undefined how precise the URI is: during log-in it is tested
546546
against all plugged in security tokens and if there's exactly one matching
547547
private key found with it it is used.
548548

549+
`fido2HmacCredential` → An array of strings, each with a Base64-encoded FIDO2
550+
credential ID that shell be used for authentication with FIDO2 devices that
551+
implement the `hmac-secret` extension. The salt to pass to the FIDO2 device is
552+
found in `fido2HmacSalt`.
553+
549554
`privileged` → An object, which contains the fields of the `privileged` section
550555
of the user record, see below.
551556

@@ -594,21 +599,37 @@ as the lines in the traditional `~/.ssh/authorized_key` file.
594599

595600
`pkcs11EncryptedKey` → An array of objects. Each element of the array should be
596601
an object consisting of three string fields: `uri` shall contain a PKCS#11
597-
security token URI, `data` shall contain a Base64 encoded encrypted key and
602+
security token URI, `data` shall contain a Base64-encoded encrypted key and
598603
`hashedPassword` shall contain a UNIX password hash to test the key
599604
against. Authenticating with a security token against this account shall work
600605
as follows: the encrypted secret key is converted from its Base64
601606
representation into binary, then decrypted with the PKCS#11 `C_Decrypt()`
602607
function of the PKCS#11 module referenced by the specified URI, using the
603608
private key found on the same token. The resulting decrypted key is then
604609
Base64-encoded and tested against the specified UNIX hashed password. The
605-
Base64-enceded decrypted key may also be used to unlock further resources
610+
Base64-encoded decrypted key may also be used to unlock further resources
606611
during log-in, for example the LUKS or `fscrypt` storage backend. It is
607612
generally recommended that for each entry in `pkcs11EncryptedKey` there's also
608613
a matching one in `pkcs11TokenUri` and vice versa, with the same URI, appearing
609614
in the same order, but this should not be required by applications processing
610615
user records.
611616

617+
`fido2HmacSalt` → An array of objects, implementing authentication support with
618+
FIDO2 devices that implement the `hmac-secret` extension. Each element of the
619+
array should be an object consisting of three string fields: `credential`,
620+
`salt`, `hashedPassword`. The first two shall contain Base64-encoded binary
621+
data: the FIDO2 credential ID and the salt value to pass to the FIDO2
622+
device. During authentication this salt along with the credential ID is sent to
623+
the FIDO2 token, which will HMAC hash the salt with its internal secret key and
624+
return the result. This resulting binary key should then be Base64-encoded and
625+
used as string password for the further layers of the stack. The
626+
`hashedPassword` field of the `fido2HmacSalt` field shall be a UNIX password
627+
hash to test this derived secret key against for authentication. It is
628+
generally recommended that for each entry in `fido2HmacSalt` there's also a
629+
matching one in `fido2HmacCredential`, and vice versa, with the same credential
630+
ID, appearing in the same order, but this should not be required by
631+
applications processing user recrods.
632+
612633
## Fields in the `perMachine` section
613634

614635
As mentioned, the `perMachine` section contains settings that shall apply to
@@ -652,13 +673,13 @@ that may be used in this section are identical to the equally named ones in the
652673
`mountNoDevices`, `mountNoSuid`, `mountNoExecute`, `cifsDomain`,
653674
`cifsUserName`, `cifsService`, `imagePath`, `uid`, `gid`, `memberOf`,
654675
`fileSystemType`, `partitionUuid`, `luksUuid`, `fileSystemUuid`, `luksDiscard`,
655-
`luksOfflineDiscard`, `luksOfflineDiscard`, `luksCipher`, `luksCipherMode`,
656-
`luksVolumeKeySize`, `luksPbkdfHashAlgorithm`, `luksPbkdfType`,
657-
`luksPbkdfTimeCostUSec`, `luksPbkdfMemoryCost`, `luksPbkdfParallelThreads`,
658-
`rateLimitIntervalUSec`, `rateLimitBurst`, `enforcePasswordPolicy`,
659-
`autoLogin`, `stopDelayUSec`, `killProcesses`, `passwordChangeMinUSec`,
660-
`passwordChangeMaxUSec`, `passwordChangeWarnUSec`,
661-
`passwordChangeInactiveUSec`, `passwordChangeNow`, `pkcs11TokenUri`.
676+
`luksOfflineDiscard`, `luksCipher`, `luksCipherMode`, `luksVolumeKeySize`,
677+
`luksPbkdfHashAlgorithm`, `luksPbkdfType`, `luksPbkdfTimeCostUSec`,
678+
`luksPbkdfMemoryCost`, `luksPbkdfParallelThreads`, `rateLimitIntervalUSec`,
679+
`rateLimitBurst`, `enforcePasswordPolicy`, `autoLogin`, `stopDelayUSec`,
680+
`killProcesses`, `passwordChangeMinUSec`, `passwordChangeMaxUSec`,
681+
`passwordChangeWarnUSec`, `passwordChangeInactiveUSec`, `passwordChangeNow`,
682+
`pkcs11TokenUri`, `fido2HmacCredential`.
662683

663684
## Fields in the `binding` section
664685

@@ -810,7 +831,7 @@ public key.
810831
The `signature` field in the top-level user record object is an array of
811832
objects. Each object encapsulates one signature and has two fields: `data` and
812833
`key` (both are strings). The `data` field contains the actual signature,
813-
encoded in base64, the `key` field contains a copy of the public key whose
834+
encoded in Base64, the `key` field contains a copy of the public key whose
814835
private key was used to make the signature, in PEM format. Currently only
815836
signatures with Ed25519 keys are defined.
816837

@@ -872,7 +893,12 @@ in case both are set.)
872893
`pkcs11ProtectedAuthenticationPathPermitted` → a boolean. If set to true allows
873894
the receiver to use the PKCS#11 "protected authentication path" (i.e. a
874895
physical button/touch element on the security token) for authenticating the
875-
user. If false or unset authentication this way shall not be attempted.
896+
user. If false or unset, authentication this way shall not be attempted.
897+
898+
`fido2UserPresencePermitted` → a boolean. If set to true allows the receiver to
899+
use the FIDO2 "user presence" flag. This is similar to the concept of
900+
`pkcs11ProtectedAuthenticationPathPermitted`, but exposes the FIDO2 concept
901+
behind it. If false or unset authentication this way shall not be attempted.
876902

877903
## Mapping to `struct passwd` and `struct spwd`
878904

0 commit comments

Comments
 (0)