Skip to content

Commit 1de966b

Browse files
aadam-shopwareCopilotIsengo1989
authored
feat: extend pass vault guide for secrets (#2082)
* feat: extend pass vault guide for secrets * fix: update doc * fix: add NATS to wordlist and fix description for an element * fix: remove double whitespace * fix: remove ending double whitespace * fix: linting * Update products/paas/shopware/guides/secrets-vault-guide.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update doc * fix: update Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update header space * chore/small-grammar-fixes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Micha <m.hobert@shopware.com>
1 parent abfc837 commit 1de966b

File tree

2 files changed

+203
-0
lines changed

2 files changed

+203
-0
lines changed

.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ MyExtension
585585
MyPlugin
586586
MyTestClass
587587
MyTestInterface
588+
NATS
588589
NPM
589590
NUR
590591
NVDA

products/paas/shopware/guides/secrets-vault-guide.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,205 @@ sw-paas vault get --secret-id ssh-abc123xyz
101101
```sh
102102
sw-paas vault delete --secret-id ssh-abc123xyz
103103
```
104+
105+
## Default Secrets & Ownership
106+
107+
The Shopware PaaS Vault contains both system-managed and user-managed secrets. Understanding the difference helps you identify which secrets you can manage and which are maintained by the platform.
108+
109+
### System-Managed vs. User-Managed Secrets
110+
111+
**System-managed secrets** are automatically created and maintained by Shopware PaaS for internal operations. While these secrets are visible when you run `sw-paas vault list`, they should not be modified or deleted as they are critical for platform functionality.
112+
113+
**User-managed secrets** are created by you for your application's specific needs, such as API tokens, database credentials, or SSH keys for private repositories.
114+
115+
### Common Secrets Reference
116+
117+
| Secret Name | Description | Managed By | Editable by User | Notes |
118+
|-------------|-------------|------------|------------------|-------|
119+
| `STOREFRONT_CREDENTIALS` | Internal storefront credentials | System | No | **Do not delete** - Required for storefront functionality |
120+
| `GRAFANA_CREDENTIALS` | Grafana dashboard login credentials | System | No | **Do not delete** - Needed for `sw-paas open grafana` |
121+
| `NATS_USER_CREDENTIALS` | NATS messaging user credentials | System | No | **Do not delete** - Required for internal messaging |
122+
| `STOREFRONT_PROXY_KEY` | Storefront proxy authentication | System | No | **Do not delete** - Required for routing |
123+
| `SSH_PRIVATE_KEY` | Deploy SSH key for repository access | User | Yes | See [SSH key workflow](#example-workflow-using-ssh-keys) |
124+
| `SHOPWARE_PACKAGES_TOKEN` | Token for accessing Shopware packages | User | Yes | Watch for typo variants (e.g. missing underscore: `SHOPWAREPACKAGES_TOKEN`) |
125+
126+
::: info
127+
System-managed secrets use the same retrieval mechanism as user-managed secrets, which is why they appear in your vault list. This is intentional to provide transparency into the credentials your environment is using.
128+
:::
129+
130+
### Understanding Organization-wide Secrets
131+
132+
The `sw-paas vault list` command shows all secrets stored in your organization’s Vault. Because secrets are organization-global and reusable, the same secret values can be referenced by multiple applications using the same secret name.
133+
134+
If multiple applications in your organization use a secret with the same name, they are all referring to the same underlying Vault secret, not separate per-application copies.
135+
136+
This means you manage each secret once at the organization level and then reference it from the applications that need it.
137+
138+
## Permissions & Behavior
139+
140+
::: danger
141+
**Do not delete system-managed secrets.** Deleting secrets like `STOREFRONT_CREDENTIALS`, `GRAFANA_CREDENTIALS`, `NATS_USER_CREDENTIALS`, or `STOREFRONT_PROXY_KEY` will cause platform outages and break critical functionality.
142+
:::
143+
144+
### System-Managed Secret Restrictions
145+
146+
System-managed secrets must be treated as read-only and must not be modified or deleted. The platform does not technically prevent you from changing or removing these secrets, but doing so is unsupported and will break critical platform functionality. They are essential for:
147+
148+
- Storefront operations and routing
149+
- Monitoring and observability (Grafana)
150+
- Internal messaging and communication (NATS)
151+
- Platform infrastructure
152+
153+
If you believe a system-managed secret is incorrect or causing issues:
154+
155+
1. **Do not delete or modify the secret**
156+
2. Document the issue, including the secret name and observed behavior
157+
3. Contact Shopware PaaS support immediately
158+
4. Do not attempt to work around system secrets by creating duplicates
159+
160+
### Secret History & Rollback
161+
162+
::: warning
163+
**Important:** Shopware PaaS does not maintain version history for secrets. Once a secret is modified or deleted, the previous value cannot be recovered through the platform.
164+
:::
165+
166+
Always back up critical secret values locally before making changes:
167+
168+
```sh
169+
# Retrieve and save a secret locally before modifying
170+
sw-paas vault get --secret-id SECRET-ID > backup-SECRET-NAME.txt
171+
```
172+
173+
## Housekeeping & Legacy Secrets
174+
175+
### Identifying Legacy or Typo Secrets
176+
177+
Over time, your Vault may accumulate outdated or incorrectly named secrets. Common issues include:
178+
179+
- **Typo secrets**: e.g. `SHOPWAREPACKAGES_TOKEN` instead of `SHOPWARE_PACKAGES_TOKEN`
180+
- **Deprecated secrets**: No longer used by current application versions
181+
- **Duplicate secrets**: Same secret created multiple times with different IDs
182+
183+
### Recommended Cleanup Process
184+
185+
1. **Audit your secrets**:
186+
187+
```sh
188+
sw-paas vault list --application-id YOUR-APP-ID
189+
```
190+
191+
2. **Identify unused secrets**: Review each secret and confirm whether it's actively used by your application
192+
193+
3. **Back up before deletion**:
194+
195+
```sh
196+
sw-paas vault get --secret-id SECRET-ID > backup-SECRET-NAME.txt
197+
```
198+
199+
4. **Delete unused secrets**:
200+
201+
```sh
202+
sw-paas vault delete --secret-id SECRET-ID
203+
```
204+
205+
5. **Document the cleanup**: Keep a record of what was deleted and when for future reference
206+
207+
### Dealing with Typo Secrets
208+
209+
If you discover a secret with a typo in its name, you have two options:
210+
211+
**Option 1: Edit the existing secret (faster)**
212+
213+
1. Edit the secret to correct its name or value:
214+
215+
```sh
216+
sw-paas vault edit
217+
```
218+
219+
2. Select the secret from the list and update its value as needed
220+
221+
3. Update your application to use the corrected secret name if it changed
222+
223+
4. Test thoroughly to ensure the updated secret works
224+
225+
**Option 2: Create a new secret and delete the old one**
226+
227+
1. Back up the typo secret's value:
228+
229+
```sh
230+
sw-paas vault get --secret-id TYPO-SECRET-ID > backup-typo-SECRET-NAME.txt
231+
```
232+
233+
2. Create a correctly named secret:
234+
235+
```sh
236+
sw-paas vault create
237+
```
238+
239+
3. Update your application to use the correct secret
240+
241+
4. Test thoroughly to ensure it works
242+
243+
5. Delete the typo secret:
244+
245+
```sh
246+
sw-paas vault delete --secret-id TYPO-SECRET-ID
247+
```
248+
249+
### Regular Maintenance
250+
251+
Establish a periodic review process:
252+
253+
- **Quarterly audit**: Review all user-managed secrets for relevance
254+
- **Document ownership**: Maintain a record of which secrets are used by which applications
255+
256+
## Safety & Recovery
257+
258+
### Best Practices
259+
260+
1. **Always back up before deletion**:
261+
262+
```sh
263+
sw-paas vault get --secret-id SECRET-ID > $(date +%Y%m%d)-SECRET-NAME-backup.txt
264+
```
265+
266+
2. **Rotate sensitive credentials regularly** (e.g., every 90 days):
267+
- Update API tokens and authentication credentials on a scheduled basis
268+
- Use the `sw-paas vault edit` command to quickly update credential values
269+
- Create new secrets and deprecate old ones for non-editable secret types
270+
271+
3. **Test changes in non-production environments first**
272+
273+
4. **Document secret purposes**: Add comments or maintain an external inventory
274+
275+
5. **Use descriptive names**: Choose clear, consistent naming conventions for your secrets
276+
277+
6. **Limit access**: Only share vault access with team members who need it
278+
279+
### What to Do If You Accidentally Delete a Secret
280+
281+
Since there is no built-in recovery mechanism:
282+
283+
1. **Check local backups** you may have created before deletion
284+
285+
2. **Review your application's configuration files** (if the secret was stored there temporarily during development)
286+
287+
3. **Regenerate the secret** if it's a token or credential that can be recreated:
288+
- For API tokens: Generate a new token from the service provider
289+
- For SSH keys: Create a new key pair and update deployment keys
290+
291+
4. **Contact support** if the deleted secret was critical and you have no backup
292+
293+
### Support Escalation
294+
295+
If you encounter issues that cannot be resolved with the above troubleshooting steps:
296+
297+
1. **Gather information**:
298+
- Secret name and ID
299+
- Application ID
300+
- Error messages or unexpected behavior
301+
- Steps to reproduce the issue
302+
303+
2. **Check system status**: Verify there are no ongoing PaaS incidents
304+
305+
3. **Contact Shopware PaaS support** with the gathered information

0 commit comments

Comments
 (0)