Skip to content

Biometric data

Clocks can collect fingerprint, face and palm templates, face and attendance photos, and identity documents. Many jurisdictions restrict how such data is kept and require consent. So Hour Advantage keeps none of it unless you turn it on. It also lets you refuse or withdraw it per person.

You control this data at three levels:

LevelControlDefault
EndpointOption biometrics: whether the endpoint collects the data at all.Off
PersonFlag allow_biometrics in the person’s sync group.Allowed
Sync grouppeople.biometrics: whether templates and photos move between members.Off

The event types concerned are biometric, biometric.photo, user.photo, photo and id_card (events).

Unless an endpoint sets the option biometrics = true, Connect drops the five event types above before they are stored, whatever its package emits. Packages read the same option to decide whether to ask devices for the data at all. ZKTeco clocks are told to upload templates and photos only when it is on (ZKTeco endpoint options).

[[endpoint]]
id = "office"
listener = "public"
path = "/office"
package = "[email protected]"
options = { timezone = "America/Chicago", biometrics = true }

Or with hourctl:

Terminal window
hourctl endpoint set office --option biometrics=true

drop_events on an endpoint drops any other event types before they are stored (endpoint options). Every event an endpoint drops is counted in houradvantage_events_dropped_total{endpoint,type,reason}. This holds for drop_events and for not collecting biometrics.

A sink without an events filter is not sent biometric, biometric.deleted, biometric.photo, user.photo, user.extended, photo, id_card or biometric.refused. Only a sink that names them receives them (the default set).

Whether a person may have biometrics is their flag in their sync group. Every endpoint is in a sync group. It is one of its own, keeping nothing, unless it names another. So every endpoint has the flag, whatever the group keeps. A person with no flag is allowed.

Terminal window
hourctl sync biometrics <GROUP> <USER_ID> # show
hourctl sync biometrics <GROUP> <USER_ID> --refuse
hourctl sync biometrics <GROUP> <USER_ID> --allow

An endpoint’s own group is named after the endpoint. For an endpoint office with no named group, use hourctl sync biometrics office 1001 --refuse.

RouteBodyAnswer
GET /api/tenants/{tenant}/sync/{group}/people/{user_id}/biometrics{"user_id", "allow_biometrics"}
PUT /api/tenants/{tenant}/sync/{group}/people/{user_id}/biometrics{"allow": false} or {"allow": true}{"user_id", "allow_biometrics", "withdrawn"?}

Both answer 404 for an unknown group. In a group that keeps people, the flag is also the person’s biometrics field. Writing either one sets the same flag. In other groups the person needs no record.

Connect enforces the flag itself, whatever the endpoint’s options and its package do.

A biometric, biometric.photo or user.photo event of a refused person is dropped before it is stored, sent to a sink or taken into the group. Then:

  1. The device is sent its package’s delete_biometrics (for a template) or delete_user_photo (for a photo) in the urgent lane. A held device gets the delete once it is released.
  2. A biometric.refused event is sent per person and event type. It carries user_id, kind, count, reason and the delete’s action_id. It carries error when the delete could not be queued (for example, the package offers no such action).
  3. The audit trail (as user houradvantage) and the log record it.

The delete reports its own result in an action.result event.

An action is refused when it carries or enrols templates or photos of a refused person, named by its user_id or new_user_id. An action qualifies when it is set_biometric, set_user_photo or enroll_biometric. It also qualifies when any action is given a non-empty template, templates, biometrics, jpeg_base64 or face_photo parameter (for example change_user_id with templates).

Where the action comes fromResult
POST /api/tenants/{tenant}/devices/{endpoint}/{device}/actions (hourctl action)403
A jobThe device’s execution fails with the refusal as its reason.
A credential written to a group’s registry (PUT /api/tenants/{tenant}/sync/{group}/people/{user_id}/credentials/{kind}/{slot})422. So the sync engine has none to send.

Refusing a person who was allowed withdraws their biometrics:

  1. Their biometric, biometric.photo and user.photo events are removed from the event log, delivered to the sinks or not.
  2. In a group that keeps people, every template and photo the registry holds of them is deleted. The deletions are recorded as tombstones. So the change feed and person.changed report them.
  3. Every allowed device of the group’s endpoints is sent delete_biometrics and delete_user_photo for them, in the urgent lane. A device whose package offers neither is skipped.

The PUT answers what was done:

{
"user_id": "1001",
"allow_biometrics": false,
"withdrawn": {
"events_purged": 12,
"undelivered_purged": 0,
"deletes": [
{ "endpoint": "office", "device": "<DEVICE>", "action": "delete_biometrics", "action_id": 42 }
]
}
}
FieldMeaning
events_purgedBiometric events of the person removed from the event log.
undelivered_purgedOf those, the ones a sink had not taken yet.
deletesOne entry per delete per device. It holds endpoint, device, action, and action_id, or error when it could not be queued.

The audit trail records the counts. When the flag is withdrawn by writing "biometrics": false on a person through the registry, the counts are in the audit trail only.

What a device does with the bytes of a deleted template is up to the device. Some keep them in storage until overwritten. The package’s documentation says so where it is known.

A group that keeps people carries templates and photos between its members only with people.biometrics = true. That setting requires HOURADVANTAGE_SECRET_KEY. Templates, face photos and display photos are sealed at rest (sync data protection).

Terminal window
hourctl sync set hq people.biometrics=true
  • Templates and photos move between clocks, never to sinks. An endpoint that drops biometric events still feeds the group’s registry.
  • For a refused person, none is kept. One written through the API is refused (422). One a clock uploads is never taken in and is deleted from that clock.
  • Setting "biometrics": true (or null) on the person lets them be enrolled again.

A package can read the flag so it does not ask a device for data that would be dropped. allow_biometrics(ctx, user_id) is false for a refused person. ctx.biometrics_refused lists the refused user ids (helpers). A package cannot override the flag. Connect checks every event a package emits.

PlaceWhat it shows
Audit trail, command and action history, the live stream, stored commands once the device has themCommand parameters marked sensitive (templates, photos) appear only as their size. It looks like <redacted N bytes> (sensitive values).
hourctl wireDevice traffic as it is, templates included. It is never stored.
Traffic log (/api/tenants/{tenant}/traffic, in each instance’s memory)Up to limits.traffic_body_bytes (16 KiB by default) of each message body. Set it to 0 where that matters (settings).
Terminal window
hourctl settings set traffic_body_bytes=0