# Company security

Rules that hold for everyone in a company, and the company's audit trail, on the company's **Security** page in the console (in the side bar beside People and Billing). Any member can read the page; only an owner can change it.

## Require an authenticator for every member

With this on, every member of the company signs in to the console with their password and a 6-digit code from an authenticator app, as described in [Console account security](https://rezincore.com/docs/account-security.md#authenticator-app).

| Plan | What you get |
|---|---|
| Free, Pro | Not available. Each person chooses for themselves. |
| Team | An owner switches it on or off. |
| Compliance | Always on. It cannot be switched off. |

**Switching it on.** Open **Security**, tick **Require an authenticator for every member**. You need your own authenticator on first, so you cannot lock yourself out. The page lists who has one and who has not.

**Someone without one.** The company's pages show them a short explanation and a button that walks them through it: scan the code, type the code the app shows, keep the recovery codes. Until it is done, in this company only:

- its projects, people, billing and settings do not open for them in the console (they can still leave the company);
- their [personal access tokens](https://rezincore.com/docs/tools/access-tokens.md) and connected assistants are refused for its projects with `authenticator_required`, and listing projects marks those projects with `authenticatorRequired: true`.

Other companies they belong to open as before, and their tokens still reach those companies' projects.

Signing in with Google or GitHub does not get round it: the walk-through comes after the provider in the same way.

**Grace period.** An owner can give people time: none (at their next sign-in), or 1, 3, 7, 14 or 30 days. On the Compliance plan, where the rule is always on, people have 7 days until an owner chooses a period; an owner's choice, none included, always stands. The time is counted from the latest of when the rule was switched on, when the plan that requires it started, and when the person joined. During it they see a reminder at the top of every page with the date.

**While the rule is in force** a member cannot turn their own authenticator off. If they leave the company, or the company moves to a plan without the feature, the rule stops holding them.

**Not affected.** Rezin Core staff you give [support access](https://rezincore.com/docs/security.md) to are not members of your company, so the rule does not apply to them; staff emergency access already needs the staff member's own authenticator.

Switching it on or off and changing the grace period are on the record as `console.company.require_authenticator`, with who did it.

## Single sign-on

People sign in to the console through your company's own sign-in service, using OpenID Connect. Okta, Microsoft Entra ID, Google Workspace, Keycloak, Auth0 and most others speak it. Team and Compliance plans; owners set it up on **Security**.

### Set it up

1. In your provider, create an application of the "web" kind (OpenID Connect, authorization code). Give it the sign-in address shown on the Security page: `https://console.rezincore.com/api/auth/sso/callback`. Ask for the `openid`, `email` and `profile` scopes.
2. On **Security**, under Single sign-on, enter the provider's **issuer** (the address its documentation calls the issuer or authority; Rezin Core reads `<issuer>/.well-known/openid-configuration` to find the rest), the **client ID** and the **client secret**, and the **role for someone new** (Developer or Read only). **Check and save** reads the provider's configuration there and then and says plainly if it cannot.
3. Add each email **domain** your people use and prove it: add a DNS TXT record named `_rezin-core.<your domain>` with the value shown, then choose **Check**. A domain belongs to one company once proved.
4. Tick **Let people sign in with single sign-on**.

The client secret is kept sealed with the server's key. It is never shown again, never written to the record and never put in an error; to change it, paste a new one.

### Signing in

On the sign-in screen, **Sign in with single sign-on**, then the work address. The address decides which company's service the browser is sent to.

- **One person, one account.** Your provider's own ID for the person is what signs them in from then on.
- **Someone new** gets a console account with no password and becomes a member of the company with the role you chose.
- **Someone who already has a console account** under that address is linked to it and joins the company, because the address is in a domain you proved. An address in any other domain is refused: an email alone is never enough to reach an account.
- The provider must give an email address it does not say is unverified.
- **The authenticator still applies.** Someone with an authenticator is asked for its code after your provider, and the company's [authenticator rule](#require-an-authenticator-for-every-member) holds as for any sign-in.
- **Rezin Core staff accounts never sign in through a client's provider**, even if an address matched. A domain that any staff account uses cannot be claimed.

Every attempt is on the record as `console.login` with method `sso`; a new account, a link and a new membership are `console.sso.account_made`, `console.sso.link` and `console.sso.member_add`; settings changes are `console.sso.configure`, `.settings`, `.domain_add`, `.domain_check` and `.domain_remove`.

### Single sign-on only

Tick **Single sign-on only** and passwords, Google and GitHub are refused for every address in your proved domains, whether or not the account exists (the sign-in screen sends them to single sign-on instead). One owner is kept as **the way back in**: they still sign in with their password, and must have a password and an authenticator to be chosen. Choose who before you switch it on.

Rezin Core staff accounts are never held by it. Switching single sign-on off, removing it, or removing the last proved domain lets passwords back in.

### Not built

SAML. Signing out of your provider does not sign anyone out of the console (sessions end after 15 idle minutes and 12 hours at most). People are not removed from the company when your provider removes them: remove them under **People**.

## Audit trail export

Every sign-in, refusal and change in your projects is written to an audit trail where each entry carries the hash of the one before it. An owner can take a copy of it for a range of days and check it without Rezin Core.

| Plan | What you get |
|---|---|
| Free, Pro | Not available. Each project's Record page still shows its trail. |
| Team, Compliance | Owners export any range of up to 366 days at a time, five times a day. |

**What is in it.** Every entry for the company's projects in the range (days are UTC, both ends included): the sign-ins and changes inside each project's own organizations, the console's entries for each project (who opened, ran or changed what, including Rezin Core staff visits), and the company's own entries such as switching a rule on. Nothing of any other company.

**Asking for one.** On **Security**, choose the first and last day and **Export**. It is built in the background; the list shows when it is ready, how many entries it holds, and the SHA-256 of each file. Each export is two files, the same entries in each:

- **CSV**, for a spreadsheet. The `detail` column holds JSON.
- **JSON lines**, one entry per line, for a program.

Downloads work for **7 days**, then the files are deleted. While they wait they are stored sealed with the server's key. Asking for an export, its being ready (with both files' SHA-256) and each download are themselves on the trail as `console.audit_export.request`, `.ready` and `.download`, so a later export shows who took a copy and when.

**The columns.** `seq` (the entry's number, unique across the service), `at` (UTC, to the microsecond), `chain`, `organization_id`, `facility_id`, `actor_user_id`, `operator_id`, `session_id`, `app`, `action`, `resource_type`, `resource_id`, `resident_id`, `outcome`, `ip`, `detail`, and three for checking: `prev_hash`, `hash` and `canonical`.

### Checking an export yourself

The rule every entry follows is:

    hash = SHA-256( prev_hash as bytes  followed by  canonical as UTF-8 text )

`canonical` is the exact text that was hashed: a JSON array of the entry's fields in this order: `seq`, `at` (without the `Z`), `organization_id`, `facility_id`, `actor_user_id`, `operator_id`, `session_id`, `app`, `action`, `resource_type`, `resource_id`, `resident_id`, `outcome`, `ip`, `detail`. So a check has three parts:

1. Each entry's `hash` is the SHA-256 of its `prev_hash` and `canonical`.
2. `canonical`, read as JSON, says exactly what the entry's own columns say.
3. Within one `chain` that names an organization, each entry's `prev_hash` is the `hash` of the entry before it. A missing, added or changed entry breaks the link.

Entries whose `chain` is `console` share one chain with every other company on Rezin Core, so the entries between yours are not in your file; for those, parts 1 and 2 are checked and part 3 cannot be. The first entry of each chain names the hash before it, and the last names where it ends, so two exports of neighbouring ranges join end to start.

A small script does all three. It needs only Node 18 or later, reads the file and sends nothing anywhere: download it and run it:

    curl -fsSL https://rezincore.com/docs/downloads/verify-audit-export.mjs -o verify-audit-export.mjs
    node verify-audit-export.mjs audit-trail-2026-11-01-to-2026-11-27.jsonl

It works on the CSV too. It prints each chain with its first and last entry and ends with `All N entries check out.`, or lists each entry that fails and exits with status 1. It is short enough to read before you run it, and the rule above is enough to write your own.

**Limits.** An export covers at most 366 days and a million entries; ask for several for more. The trail's own record of the newest entries is on this server: comparing the last `hash` with a copy you kept from an earlier export is how you would notice entries removed from the end.
