You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 77220b9
Browse filesBrowse the repository at this point in the historyBrowse files
You must give each plugin instance a unique id so we can refer to it in other services and the [`dmno` CLI](/docs/reference/cli/plugin/).
45
45
46
-
In this case we used `1pass`, but you can imagine splitting vaults and access, and having multiple plugin instances - for example `1pass/prod` for highly sensitive production secrets and `1pass/dev` for everything else.
46
+
See [Segmenting secrets](/docs/guides/segmenting-secrets/) for more details.
47
47
:::
48
48
49
-
### Injecting the plugin in monorepo services
50
-
In a monorepo, you are likely managing secrets for multiple services. If you will be using the same service account(s) to access those secrets, you can initialize a plugin instance once in your root service as seen above, and then _inject_ it in child services. Note we must use that same id we set during initialization.
@@ -78,13 +68,7 @@ If you already use 1password and your secrets live in a vault that holds other i
78
68
79
69
</Steps>
80
70
81
-
This service account token will now serve as your "secret-zero" - which grants access to the rest of your sensitive config stored in 1Password. It must be set locally (unless relying on cli-based auth) and in deployed environments. It is sensitive so we must pass in the value as an _override_ rather than storing it within the config. Locally this usually means storing it in your [`.env.local` file](/docs/guides/env-files/) and on a deployed environment you'll usually set it within some kind of UI, wherever you would normally pass in environment variables.
82
-
83
-
```diff title=".dmno/.env.local"
84
-
+OP_TOKEN=ops_abc123...
85
-
```
86
-
87
-
Note that the config path of `OP_TOKEN` is arbitrary and you can see how it was wired up from your config schema to the plugin input in the example above. If you are using multiple vaults and service accounts, you may have something more like `OP_TOKEN_PROD` and `OP_TOKEN_DEV`.
71
+
This service account token will now serve as your _secret-zero_ - which grants access to the rest of your sensitive config stored in 1Password. It must be set locally (unless relying on cli-based auth) and in any deployed environments. It is sensitive so we must pass in the value as an _override_ rather than storing it within the config. See [Setting overrides](/docs/guides/env-files/#setting-overrides-via-env-files) for more details.
88
72
89
73
:::tip[Vault organization best practices]
90
74
Consider how you want to organize your vaults and service accounts, keeping in mind [best practices](https://support.1password.com/business-security-practices/#access-management-and-the-principle-of-least-privilege). At a minimum, DMNO recommends having a vault for highly sensitive production secrets and another for everything else.
@@ -242,16 +226,9 @@ Field IDs are not easy to get from the 1Password UI. Luckily when the supplied f
242
226
The secret reference for invidivual fields within an item can be found by clicking on the down arrow icon **on the field** and selecting `Copy Secret Reference`.
243
227
:::
244
228
245
-
## Caching
246
-
In order to avoid rate limits and keep dev server restarts extremely fast, we heavily cache data fetched from external sources. After updating secrets in 1password, if the item has been cached, you'll need to clear the cache to see it take effect.
247
-
248
-
- Use the [`dmno clear-cache` command](/docs/reference/cli/clear-cache/) to clear the cache once
249
-
- The [`dmno resolve`](/docs/reference/cli/resolve/) and [`dmno run`](/docs/reference/cli/run/) commands have cache related flags:
250
-
-`--skip-cache` - skips caching logic altogether
251
-
-`--clear-cache` - clears the cache once before continuing as normal
252
229
253
230
:::tip[Active config iteration]
254
231
While you are actively working on the config itself, `dmno resolve -w --skip-cache` will combine watch mode with skipping cache logic.
255
232
256
-
Once you are satisfied, _clear_ the cache once more and you are good to go.
233
+
See [caching](/docs/plugins/overview/#caching) for more details.
Copy file name to clipboardExpand all lines: packages/docs-site/src/content/docs/docs/plugins/bitwarden.mdx
+2-34Lines changed: 2 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,16 +46,6 @@ You must give each plugin instance a unique id so we can refer to it in other se
46
46
In this case we used `bitwarden`, but you can imagine splitting vaults and access, and having multiple plugin instances - for example `bitwarden/prod` for highly sensitive production secrets and `bitwarden/dev` for everything else.
47
47
:::
48
48
49
-
### Injecting the plugin in monorepo services
50
-
In a monorepo, you are likely managing secrets for multiple services. If you will be using the same service account(s) to access those secrets, you can initialize a plugin instance once in your root service as seen above, and then inject it in child services. Note we must use that same id we set during initialization.
If you are already using Bitwarden Secrets Manager, you likely already have existing [projects](https://bitwarden.com/help/projects/) that contain [secrets](https://bitwarden.com/help/secrets/). If so, now would be a good time to review how they are all organized. If not, you should create at least one project, as each secret can have a parent project it belongs to, and access can be granted to projects rather than managing each secret individually.
65
55
66
56
:::tip[Use projects to segment access]
67
-
You should use multiple projects to segment your secrets following the [Principle of Least Privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege). This means at minimum, you should have one project for ultra-sensitive production secrets, and another for everything else. How much more you want to break things up is up to you and will depend on your security requirements.
68
-
69
-
It is technically possible to create secrets without using projects and/or to assign permissions at the individual secret level, but we do not recommend it.
57
+
You should use multiple projects to segment your secrets following the [Principle of Least Privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege). See more in our [Secret segmentation](/docs/guides/secret-segmentation/) guide.
70
58
:::
71
59
72
-
## Setup Machine Account & Access Tokens
73
-
74
-
Machine accounts can be granted access to projects, and each machine account can have multiple access tokens with optional expiration. How you want to manage this is up to you, but a sensible approach could be:
75
60
76
-
- Production machine account has access to all projects
77
-
- single access token is used at a time
78
-
- Staging/CI machine account has access to all projects except ultra-sensitive prod secrets
79
-
- each environment/CI/external tool could have a unique access token
80
-
- Dev machine account has access to secrets needed for local dev
81
-
- each developer could have a unique access token
82
-
83
-
Expiring tokens are more secure, but require the overhead of rolling those tokens, which must be done manually. Not wanting to cause an outage, you may want to roll them manually without the pressure of a potentially forgotten expiry date. To roll without downtime, create a new token, redeploy, and then decommission the previous token.
84
-
85
-
###
86
-
87
-
88
-
Machine account access tokens now serve as your _secret-zero_ - which grants access to the rest of your sensitive config stored in Bitwarden. It must be set locally and in deployed environments, but it is sensitive so we must pass in the value as an _override_ rather than storing it within the config. Locally, this usually means storing it in your [`.env.local` file](/docs/guides/env-files/) and on a deployed environment you'll usually set it within some kind of UI, wherever you would normally pass in environment variables.
89
-
90
-
```diff title=".dmno/.env.local"
91
-
+BWS_TOKEN=0.abc123...
92
-
```
61
+
Machine account access tokens now serve as your _secret-zero_ - which grants access to the rest of your sensitive config stored in Bitwarden. It must be set locally and in deployed environments, but it is sensitive so we must pass in the value as an _override_ rather than storing it within the config. Locally, this usually means storing it in your [`.env.local` file](/docs/guides/env-files/) and on a deployed environment you'll usually set it wherever you would normally pass in environment variables. DMNO will handle the rest. See [Setting overrides](/docs/guides/env-files/#setting-overrides-via-env-files) for more details.
93
62
94
-
Note that the config path of `BWS_TOKEN` is arbitrary and you can see how it was wired up from your config schema to the plugin input in the example above.
Copy file name to clipboardExpand all lines: packages/docs-site/src/content/docs/docs/plugins/infisical.mdx
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,18 +20,18 @@ Install the package in the service(s) that will use secrets from Infisical.
20
20
After installation, you'll need to initialize the plugin in your `config.mts` and add a few config items that are necessary to authenticate with Infisical and fetch secrets. It's ok if you have not created the machine identity or client keys - we'll do that in the next section.
21
21
22
22
```diff lang="ts" title='.dmno/config.mts'
23
-
import { InfisicalSecretsManagerDmnoPlugin, InfisicalSecretsManagerTypes } from '@dmno/infisical-plugin';
23
+
import { InfisicalDmnoPlugin, InfisicalTypes } from '@dmno/infisical-plugin';
24
24
25
25
// explicitly wire the plugin instance to the config path
26
-
const infisicalPlugin = new InfisicalSecretsManagerDmnoPlugin('infisical/dev', {
26
+
const infisicalPlugin = new InfisicalDmnoPlugin('infisical/dev', {
const infisicalPlugin2 = new InfisicalSecretsManagerDmnoPlugin('infisical/prod', {
34
+
const infisicalPlugin2 = new InfisicalDmnoPlugin('infisical/prod', {
35
35
environment: 'production',
36
36
});
37
37
@@ -58,7 +58,7 @@ See our [General plugin guidelines](/docs/plugins/overview/#general-plugin-guide
58
58
59
59
### Project & secrets
60
60
61
-
If you are already using Infisical, you probably already have existing projects and secrets. If not, you should create at least one [project](https://infisical.com/docs/documentation/platform/project). Infisical uses the concept of [environments](https://infisical.com/docs/documentation/platform/project#project-environments) to group secrets. Make sure to make your secrets available in the same environment configuration as each plugin instance.
61
+
If you are an existing Infisical user, you probably already have projects and secrets. If not, you should create at least one [project](https://infisical.com/docs/documentation/platform/project). Infisical uses the concept of [environments](https://infisical.com/docs/documentation/platform/project#project-environments) to group secrets. Make sure to make your secrets available in the same environment configuration as each plugin instance.
62
62
63
63
### Machine identity & client keys
64
64
@@ -75,22 +75,35 @@ Also note that the **Client Secret** is highly sensitive and should be treated a
75
75
The Infisical plugin provides one method for fetching secrets, based on the name of the secret. The name itself will be inferred from the config item name. You can optionally pass a name if you wish to override the default.
0 commit comments