# Manage access and security

> How identity, roles, app access and app data are kept separate and under IT control.

Source: https://diakrin.com/docs/security

Your company identity proves who is signing in. Diakrin organization membership and app permissions determine what that person may do. The deployed app decides which records they reach.

## Three separate access decisions

```diagram access-layers
Passing one layer never skips the next. A successful company sign-in, for example, does not grant access to any app or its data.
```

| Layer | Controls |
| --- | --- |
| Identity provider | Sign-in, identity-provider assignment and company authentication policy |
| Diakrin organization and project | Membership, roles, assigned apps and permitted actions |
| Deployed company application | Application audience and access to business records |

An email domain, successful SSO, provider group or console role does not grant unrestricted company-data access. App and project permissions can narrow organization-level access. Use Member access when a person should be contained to assigned apps.

## Protect credentials

Employees use company SSO after activation. Administrators never need to share identity-provider private keys, passwords, authentication-service secrets or cloud credentials with employees.

> [!SELF-HOSTED]
> Employees sign in with a local password account or, if configured, the company OIDC connection. Password sessions last up to 8 hours and company OIDC sessions up to 1 hour. Sessions are held by your installation and can be revoked there.

Treat invitation codes and coding-tool tokens as sensitive. Share invitation codes only with the intended recipient. Store MCP tokens in the coding tool’s local secret environment and revoke exposed tokens. Keep secrets out of chat, screenshots and source control.

## Remove access deliberately

Remove the person from the Diakrin organization when they leave. This revokes their app and project grants, ends their recorded app sign-in sessions and stops their coding-tool tokens. Remove their identity-provider application assignment as well.

> [!SAAS]
> With [SCIM provisioning](/docs/provisioning), deactivating the person in your identity provider removes their membership on the next sync.

Without SCIM, an identity-provider disablement can stop future sign-ins without immediately ending an existing Diakrin session, so do not use it as the only offboarding step.

Role changes can revoke existing project grants and coding-tool connections. Reassign only the access that should remain. Keep a second verified Owner for recovery; the last Owner cannot leave.

## MFA and logout

Apply your company’s MFA policy to the identity-provider application. If Diakrin asks for an additional account-security challenge, complete it; an IdP MFA event does not automatically satisfy every Diakrin session-assurance requirement.

> [!SELF-HOSTED]
> Diakrin does not add its own two-step challenge to local password accounts. Use the company OIDC connection to apply your identity provider's MFA.

Diakrin sign-out ends the console session but does not promise a global logout from your identity provider or other apps. On shared devices, also end the provider session and close the browser as your company policy requires.

## Your apps' data

With BYOC, each app keeps its data in your cloud: its own database, files under its own storage folder, logs and secrets. Diakrin's runner in your cloud reports what is there about every six hours, so IT and the app builder can see it on the app's **Data** section and IT can see every app under **Govern → App data**.

```diagram data-boundary
Only metadata leaves your cloud. IT controls travel the other way, and your cloud applies each one and returns a signed receipt.
```

> [!NOTE]
> The data report is collected on AWS today, not yet on Google Cloud. A Google Cloud app's sections show **Unavailable**, which means unknown, not empty.

- **What is reported:** database and table sizes, estimated row counts, table and column names, file counts and bytes, log volume and retention, secret counts and rotation age, encryption, backups and public-access protection. Row values, file contents and secret values are never collected. IT can turn off column-name hints for the organization.
- **Risk score:** fixed weights for sensitive classification, public files, missing encryption or backups, no retention, broad audience, public edge, no data owner, column names that suggest personal data, and large volume. Findings from Amazon Macie or Google Sensitive Data Protection raise it. The score explains itself; it does not inspect data.
- **Data owner:** defaults to the app owner on the first report. IT can assign anyone in the organization.
- **Controls:** retention (a storage lifecycle rule plus deletion of old rows from tables the app lists for retention), export to a bucket your company configures, quarantine (the app keeps running but cannot reach its data) and restore, and delete. IT controls apply right away; a builder can shorten retention within the app's declared limit and other builder requests wait for IT. Delete requires IT, the exact app name, and a retired app. Your cloud applies each control and returns a signed receipt shown in the control history.

## App data inventory

For IT and the app's technical owner. The runner in your cloud reads metadata only:

- **Database:** size, tables and estimated row counts, plus column names when column-name hints are allowed.
- **Files:** object count and size under the app's storage prefix, encryption, public-access block and lifecycle rule.
- **Logs:** log group size and retention.
- **Secrets:** how many there are and the oldest rotation age.
- **Exposure:** whether the app is private or on the public edge, and how many people can open it.

Each section shows **Observed**, **Unavailable** with a reason (for example, no permission or no observer) or **Unknown** with a reason. A section that was not observed is never shown as zero or "No". **Last observed** shows when the runner last reported, whether that is fresh or stale (stale after 12 hours, twice the six-hour interval) and how many sections were observed.

> [!SELF-HOSTED]
> On a self-hosted AWS installation no data collector runs yet, so every section shows **Unavailable** with its reason. That means unknown, not empty.

Business rows, values, file contents and secret values are never read. Each report is signed by the runner in your cloud and is accepted only for the app's active allocation; reports for a released allocation are refused.

## Requirements to discuss before rollout

Enforcing SSO for every console session, mapping identity-provider groups to Diakrin roles, direct generic OIDC onboarding and global logout are not currently provided by this setup. Discuss mandatory requirements with your Diakrin onboarding contact before relying on this flow for production use.
