Skip to content

Commit 77220b9

Browse files
committed
remove duplicate content and add links
1 parent 8606608 commit 77220b9

3 files changed

Lines changed: 26 additions & 68 deletions

File tree

‎packages/docs-site/src/content/docs/docs/plugins/1password.mdx‎

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,9 @@ export default defineDmnoService({
4343
:::tip[Plugin instance IDs]
4444
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/).
4545

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.
4747
:::
4848

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.
51-
52-
```typescript title='apps/some-service/.dmno/config.mts'
53-
import { OnePasswordDmnoPlugin } from '@dmno/1password-plugin';
54-
55-
// 💉 inject the already initialized plugin instead of re-initializing it
56-
const onePassSecrets = OnePasswordDmnoPlugin.injectInstance('1pass');
57-
```
58-
5949

6050
------------
6151

@@ -78,13 +68,7 @@ If you already use 1password and your secrets live in a vault that holds other i
7868

7969
</Steps>
8070

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.
8872

8973
:::tip[Vault organization best practices]
9074
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
242226
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`.
243227
:::
244228

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
252229

253230
:::tip[Active config iteration]
254231
While you are actively working on the config itself, `dmno resolve -w --skip-cache` will combine watch mode with skipping cache logic.
255232

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.
257234
:::

‎packages/docs-site/src/content/docs/docs/plugins/bitwarden.mdx‎

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ You must give each plugin instance a unique id so we can refer to it in other se
4646
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.
4747
:::
4848

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.
51-
52-
```typescript title='apps/some-service/.dmno/config.mts'
53-
import { BitwardenSecretsManagerDmnoPlugin } from '@dmno/bitwarden-plugin';
54-
55-
// 💉 inject the already initialized plugin instead of re-initializing it
56-
const bitwardenPlugin = BitwardenSecretsManagerDmnoPlugin.injectInstance('bitwarden');
57-
```
58-
5949

6050
------------
6151

@@ -64,34 +54,12 @@ const bitwardenPlugin = BitwardenSecretsManagerDmnoPlugin.injectInstance('bitwar
6454
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.
6555

6656
:::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.
7058
:::
7159

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:
7560

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.
9362

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.
9563

9664
------
9765

‎packages/docs-site/src/content/docs/docs/plugins/infisical.mdx‎

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Install the package in the service(s) that will use secrets from Infisical.
2020
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.
2121

2222
```diff lang="ts" title='.dmno/config.mts'
23-
import { InfisicalSecretsManagerDmnoPlugin, InfisicalSecretsManagerTypes } from '@dmno/infisical-plugin';
23+
import { InfisicalDmnoPlugin, InfisicalTypes } from '@dmno/infisical-plugin';
2424

2525
// explicitly wire the plugin instance to the config path
26-
const infisicalPlugin = new InfisicalSecretsManagerDmnoPlugin('infisical/dev', {
26+
const infisicalPlugin = new InfisicalDmnoPlugin('infisical/dev', {
2727
environment: 'development',
2828
clientId: configPath('..', 'INFISICAL_CLIENT_ID'),
2929
clientSecret: configPath('..', 'INFISICAL_CLIENT_SECRET'),
3030
projectId: configPath('..', 'INFISICAL_PROJECT_ID'),
3131
});
3232

3333
// or you can inject by default
34-
const infisicalPlugin2 = new InfisicalSecretsManagerDmnoPlugin('infisical/prod', {
34+
const infisicalPlugin2 = new InfisicalDmnoPlugin('infisical/prod', {
3535
environment: 'production',
3636
});
3737

@@ -58,7 +58,7 @@ See our [General plugin guidelines](/docs/plugins/overview/#general-plugin-guide
5858

5959
### Project & secrets
6060

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.
6262

6363
### Machine identity & client keys
6464

@@ -75,22 +75,35 @@ Also note that the **Client Secret** is highly sensitive and should be treated a
7575
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.
7676

7777
```typescript title='.dmno/config.mts'
78-
import { InfisicalSecretsManagerDmnoPlugin, InfisicalSecretsManagerTypes } from '@dmno/infisical-plugin';
78+
import { InfisicalDmnoPlugin, InfisicalTypes } from '@dmno/infisical-plugin';
7979

80-
const infisicalPlugin = new InfisicalSecretsManagerDmnoPlugin('infisical/dev', {
80+
const infisicalPlugin = new InfisicalDmnoPlugin('infisical/dev', {
8181
environment: 'development',
8282
});
8383

8484
export default defineDmnoService({
8585
schema: {
8686
SOME_SECRET: {
8787
// this will fetch the secret with the name 'SOME_SECRET' from the project specified in the plugin instance
88-
value: InfisicalPlugin.secret(),
88+
value: infisicalPlugin.secret(),
8989
},
9090
SOME_NEW_SECRET: {
9191
// this will fetch the secret with the name 'SOME_OTHER_SECRET' and make it available as SOME_NEW_SECRET in your DMNO_CONFIG
92-
value: InfisicalPlugin.secret('SOME_OTHER_SECRET'),
92+
value: infisicalPlugin.secret('SOME_OTHER_SECRET'),
9393
},
9494
},
9595
});
9696
```
97+
98+
### Self-hosted Infisical
99+
100+
If you are using a self-hosted version of Infisical, the `InfisicalDmnoPlugin` takes an optional `siteUrl` parameter. For example:
101+
102+
```typescript title='.dmno/config.mts'
103+
import { InfisicalDmnoPlugin, InfisicalTypes } from '@dmno/infisical-plugin';
104+
105+
const infisicalPlugin = new InfisicalDmnoPlugin('infisical/dev', {
106+
environment: 'development',
107+
siteUrl: 'https://infisical.mycompany.com',
108+
});
109+
```

0 commit comments

Comments
 (0)