# Implement Vault Timeout Policy

**URL:** https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403
**Category:** Feature Requests
**Created:** [January 18, 2022, 8:07am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403 "2022-01-18T08:07:51Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bokkabonga](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bokkabonga](https://vaultwarden.discourse.group/u/bokkabonga)
#### Post date: [January 18, 2022, 8:07am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/1 "2022-01-18T08:07:51Z")

</div>

Hey everyone,

would it be possible to implement the Vault-Timeout Policy? Or would we face the same potential problem as with this Feature Request [here](https://vaultwarden.discourse.group/t/disable-personal-vault-export-policy/1374)?

---

<div class="post-metadata">

### Author: ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)
#### Post date: [January 18, 2022, 8:52am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/2 "2022-01-18T08:52:06Z")

</div>

That is as far as i know within the same policy.

---

<div class="post-metadata">

### Author: ![bokkabonga](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bokkabonga](https://vaultwarden.discourse.group/u/bokkabonga)
#### Post date: [January 18, 2022, 9:04am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/3 "2022-01-18T09:04:36Z")

</div>

Where can i read up on this? I would love to dive a bit deeper into this

---

<div class="post-metadata">

### Author: ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)
#### Post date: [January 18, 2022, 9:32am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/4 "2022-01-18T09:32:34Z")

</div>

I would start here: [web/bitwarden\_license at master · bitwarden/web · GitHub](https://github.com/bitwarden/web/tree/master/bitwarden_license)

Though, there could be someway around this. We can’t use the web-vault version with those policies to be able to easily editable by managers, admins or owners. It maybe is possible to still implement it within the backend-server and allow some way of editing it via the /admin interface maybe, but, i’m not sure if that is possible, not looked into it that deep my self.

---

<div class="post-metadata">

### Author: ![ob1](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@ob1](https://vaultwarden.discourse.group/u/ob1)
#### Post date: [January 18, 2022, 4:12pm UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/5 "2022-01-18T16:12:10Z")

</div>

It is possible to enable it via SQL but single organisation policy needs to be enabled as well.  
This is the command I used in MySQL:

```auto
INSERT INTO org_policies (uuid, org_uuid, atype, enabled, data) VALUES ('random-uuid-here', 'org-uuid-here', '9', '1', '{"minutes":120}');

```

---

<div class="post-metadata">

### Author: ![Urdar](https://avatars.discourse-cdn.com/v4/letter/u/34f0e0/32.png) [@Urdar](https://vaultwarden.discourse.group/u/Urdar)
#### Post date: [November 13, 2023, 9:30am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/6 "2023-11-13T09:30:28Z")

</div>

Hi, I also needed to configure an organization policy, could you please tell me what the atype parameter in your SQL query example is responsible for?

---

<div class="post-metadata">

### Author: ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)
#### Post date: [November 13, 2023, 9:46am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/7 "2023-11-13T09:46:48Z")

</div>

The `atype` corresponds to the `OrgPolicyType`:

> <https://github.com/dani-garcia/vaultwarden/blob/f863ffb89a0f2a0a682c67110af32c731b5b9fcb/src/db/models/org_policy.rs#L36>

See also upstream

> <https://github.com/bitwarden/server/blob/627f4ffa39027be103dc74d575fd76477c22ec4f/src/Core/Enums/PolicyType.cs>

---

<div class="post-metadata">

### Author: ![Urdar](https://avatars.discourse-cdn.com/v4/letter/u/34f0e0/32.png) [@Urdar](https://vaultwarden.discourse.group/u/Urdar)
#### Post date: [November 13, 2023, 9:59am UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/8 "2023-11-13T09:59:50Z")

</div>

Thanks for the help, then the next question is if this functionality does not work, but a colleague above indicated that his query worked, is there no information if it will work for sure?

And is it possible to configure a storage timeout action with the exit parameter?

---

<div class="post-metadata">

### Author: ![jan1](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jan1](https://vaultwarden.discourse.group/u/jan1)
#### Post date: [March 28, 2024, 6:59pm UTC](https://vaultwarden.discourse.group/t/implement-vault-timeout-policy/1403/9 "2024-03-28T18:59:24Z")

</div>

Hi,  
what should I put in the “data” field of the `MaximumVaultTimeout = 9` if I do not want a time based lockout but for example these options:

```auto
INSERT INTO org_policies (uuid, org_uuid, atype, enabled, data) VALUES ('random-uuid-here', 'org-uuid-here', '9', '1', '{"?????":?????}');

```

![Screenshot 2024-03-28 195027](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/2X/a/a3d0b019dd0a959a2b1959f8cde7beb517fab049.png)

- On system idle
- On system sleep
- On system lock
- On restart
