Categorygithub.com/archaron/go-yubiserv
repository
0.0.4
Repository: https://github.com/archaron/go-yubiserv.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

go-yubiserv

Service for Yubikey local validation. Supports SQLite and Hashicorp Valut keystores.

Command line parameters and environment variables

Command line argEnvironment variableDefault valueDescription
--config value, -c valueYSR_CONFIGconfig.yamlConfiguration file name
--debug, -dYSR_DEBUGfalseEnable debug log messages
--log-formatYSR_LOGGER_FORMATconsoleLog format: console/json
--api-address valueYSR_API_ADDRESS:8433Validation API bind address
--api-timeout valueYSR_API_TIMEOUT1sValidation API connect/read timeout
--api-secret valueYSR_API_SECRETBase64-encoded string for HMAC signature verification, empty to disable check
--api-tls-cert valueYSR_TLS_CERTValidation API TLS certificate file path. If empty, will use HTTP mode
--api-tls-key valueYSR_TLS_KEYValidation API TLS private key file path. If empty, will use HTTP mode
--keystore valueYSR_KEYSTOREvaultKey store: vault/sqlite
--sqlite-dbpath valueYSR_SQLITE_DBPATHyubiserv.dbSQLite3 database path
--vault-address valueYSR_VAULT_ADDRESShttps://127.0.0.1:8200Vault server address
--vault-role-id valueYSR_VAULT_ROLE_IDrole_id for Vault auth, overrides role-file
--vault-role-file valueYSR_VAULT_ROLE_FILErole_idPath to file containing role_id for Vault auth
--vault-secret-id valueYSR_VAULT_SECRET_IDsecret_id for Vault auth, overrides secret-id
--vault-secret-file valueYSR_VAULT_SECRET_FILEsecret_idPath to file containing secret_id for Vault auth
--vault-pathYSR_VAULT_PATHsecret/data/yubiservVault path to KV secrets store

Vault key store details

All secrets are kept in vault KV storage:

path: {vault-path}/<public-id> Example: secret/data/yubiserv/vvcccciiktcv

data:

{
  "aes_key": "1234567890abcdef0123456789abcdef",
  "private_id": "01234567890a"
}

Both AES key and private identifier can be randomly generated with yubikey manager when creating new OTP slot.

SQLite3 key store details

yubiserv generate --start 1 --count 3

Can be used to generate some keys. Use --save argument to generate and save to DB.

... TODO ...

Typical usage:

SQLite3 key store in HTTPS TLS mode

yubiserv --keystore=sqlite --api-secret=ynS/XoXc2gwGDBssYSu2w21Aky4= --api-tls-key=./yubiserv.key.pem --api-tls-cert=./yubiserv.cert.pem

Vault key store in plain HTTP mode

yubiserv --api-secret=ynS/XoXc2gwGDBssYSu2w21Aky4= --vault-address=https://127.0.0.1:8200 --vault-path="secret/service/yubiserv"

Configuration file example (not required)

shutdown_timeout: 30s
api:
  address: :8443
  secret: ynS/XoXc2gwGDBssYSu2w21Aky4=
  timeout: 1s
  tls_cert: ./fullchain.pem
  tls_key: ./privkey.pem

logger:
  color: true
  format: console
  full_caller: false
  level: debug
  no_disclaimer: true
  sampling:
    initial: 100
    thereafter: 100
  trace_level: fatal

vault:
  address: https://127.0.0.1:8200
  role_file: role_id
  secret_file: secret_id