Skip to content

Commit 430d523

Browse files
authored
Merge pull request #5168 from platformsh/5167-pwd-rotation
Add info about disabling password rotation
2 parents 5e6463d + 59c100e commit 430d523

File tree

3 files changed

+39
-33
lines changed

3 files changed

+39
-33
lines changed

sites/platform/src/add-services/mysql/_index.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ You can configure your MySQL service in the [services configuration](/add-servic
354354
| `schemas` | An array of `string`s | 10.0+ | All databases to be created. Defaults to a single `main` database. |
355355
| `endpoints` | An endpoints dictionary | 10.0+ | Endpoints with their permissions. See [multiple databases](#multiple-databases). |
356356
| `properties` | A properties dictionary | MariaDB: 10.1+; Oracle MySQL: 8.0+ | Additional properties for the database. Equivalent to using a `my.cnf` file. See [property options](#configure-the-database). |
357-
| `rotate_passwords` | A boolean | 10.3+ | Allows disabling passwords rotation. Defaults to `true`. |
357+
| `rotate_passwords` | A boolean | 10.3+ | Defaults to `true`. When set to `false`, [password rotation](#password-rotation) is disabled. |
358358

359359
Example configuration:
360360

@@ -765,27 +765,30 @@ define custom endpoints in your [service configuration](#1-configure-the-service
765765
For each custom endpoint you create,
766766
you get an automatically generated password,
767767
similarly to when you create [multiple databases](#multiple-databases).
768-
Note that you can't customize these automatically generated passwords.
769-
770-
{{% note theme="warning" %}}
771-
By default, the generated password will rotate on a regular
772-
basis. Your applications MUST use the passwords from the
773-
relationships, as the password _is_ going to change. Set
774-
`rotate_passwords` to `false` if you wish to change this default
775-
behavior.
776-
{{% /note %}}
768+
You cannot customize these generated passwords.
777769

778-
After your custom endpoints are exposed as relationships in your [app configuration](/create-apps/_index.md),
770+
After your custom endpoints are exposed as relationships in your [app configuration](../../create-apps/_index.md),
779771
you can retrieve the password for each endpoint
780-
through the `{{% vendor/prefix %}}_RELATIONSHIPS` [environment variable](/development/variables/use-variables.md#use-provided-variables)
781-
within your [application containers](/development/variables/use-variables.md#access-variables-in-your-app).
782-
The password value changes automatically over time, to avoid downtime its value has to be read dynamically by your app.
783-
Globally speaking, having passwords hard-coded into your codebase can cause security issues and should be avoided.
772+
through the `{{% vendor/prefix %}}_RELATIONSHIPS` [environment variable](../../development/variables/use-variables.md#use-provided-variables)
773+
within your [application containers](/development/variables/use-variables.md#access-variables-in-your-app).
774+
775+
Using this method to retrieve password credentials is considered a best practice: passwords change automatically (or [_rotate_](#password-rotation)) over time, and using incorrect passwords results in application downtime. **Avoid using hard-coded passwords in your application (and code base), which can cause security issues.**
784776

785777
When you switch from the default configuration with an empty password to custom endpoints,
786778
make sure your service name remains unchanged.
787-
Failure to do so results in the creation of a new service,
788-
which removes any existing data from your database.
779+
**Changing the service name creates a new service,
780+
which removes any existing data from your database.**
781+
782+
## Password rotation {#password-rotation}
783+
By default, password rotation is enabled (`rotate_passwords=true`), enabling {{% vendor/name %}} to automatically change (or _rotate_) MariaDB passwords each time it updates the MariaDB image. Password rotation also occurs as defined by any password lifetime settings in MariaDB.
784+
785+
Specific scenarios might warrant disabling password rotation (` rotate_passwords=false`): for example, choosing to accommodate users who access a database via an SSH tunnel and provide a password in their request because they cannot retrieve the database credentials stored in the [service or `$PLATFORM_RELATIONSHIPS` MariaDB environment variables](#mariadb-reference).
786+
787+
Passwords do **not** rotate automatically when you reset this value to `true`.
788+
789+
{{% note title="Important" theme="warning" %}}
790+
Disabling password rotation can jeopardize compliance with security certifications - make sure you weigh this risk alongside the convenience of SSH-tunneling access.
791+
{{% /note %}}
789792

790793
## Storage Engine
791794

sites/upsun/src/add-services/mysql/_index.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ You can configure your MySQL service in the [services configuration](../_index.m
526526
| `schemas` | An array of `string`s | 10.0+ | All databases to be created. Defaults to a single `main` database. |
527527
| `endpoints` | An endpoints dictionary | 10.0+ | Endpoints with their permissions. See [multiple databases](#multiple-databases). |
528528
| `properties` | A properties dictionary | MariaDB: 10.1+; Oracle MySQL: 8.0+ | Additional properties for the database. Equivalent to using a `my.cnf` file. See [property options](#configure-the-database). |
529-
| `rotate_passwords` | A boolean | 10.3+ | Allows disabling passwords rotation. Defaults to `true`. |
529+
| `rotate_passwords` | A boolean | 10.3+ | Defaults to `true`. When set to `false`, [password rotation](#password-rotation) is disabled. |
530530

531531
Example configuration:
532532

@@ -755,27 +755,30 @@ define custom endpoints in your [service configuration](#1-configure-the-service
755755
For each custom endpoint you create,
756756
you get an automatically generated password,
757757
similarly to when you create [multiple databases](#multiple-databases).
758-
Note that you can't customize these automatically generated passwords.
759-
760-
{{% note theme="warning" %}}
761-
By default, the generated password will rotate on a regular
762-
basis. Your applications MUST use the passwords from the
763-
relationships, as the password _is_ going to change. Set
764-
`rotate_passwords` to `false` if you wish to change this default
765-
behavior.
766-
{{% /note %}}
758+
You cannot customize these generated passwords.
767759

768760
After your custom endpoints are exposed as relationships in your [app configuration](../../create-apps/_index.md),
769761
you can retrieve the password for each endpoint
770762
through the `{{% vendor/prefix %}}_RELATIONSHIPS` [environment variable](../../development/variables/use-variables.md#use-provided-variables)
771-
within your [application containers](/development/variables/use-variables.md#access-variables-in-your-app).
772-
The password value changes automatically over time, to avoid downtime its value has to be read dynamically by your app.
773-
Globally speaking, having passwords hard-coded into your codebase can cause security issues and should be avoided.
763+
within your [application containers](/development/variables/use-variables.md#access-variables-in-your-app).
764+
765+
Using this method to retrieve password credentials is considered a best practice: passwords change automatically (or [_rotate_](#password-rotation)) over time, and using incorrect passwords results in application downtime. **Avoid using hard-coded passwords in your application (and code base), which can cause security issues.**
774766

775767
When you switch from the default configuration with an empty password to custom endpoints,
776768
make sure your service name remains unchanged.
777-
Failure to do so results in the creation of a new service,
778-
which removes any existing data from your database.
769+
**Changing the service name creates a new service,
770+
which removes any existing data from your database.**
771+
772+
## Password rotation {#password-rotation}
773+
By default, password rotation is enabled (`rotate_passwords=true`), enabling {{% vendor/name %}} to automatically change (or _rotate_) MariaDB passwords each time it updates the MariaDB image. Password rotation also occurs as defined by any password lifetime settings in MariaDB.
774+
775+
Specific scenarios might warrant disabling password rotation (` rotate_passwords=false`): for example, choosing to accommodate users who access a database via an SSH tunnel and provide a password in their request because they cannot retrieve the database credentials stored in the [service or `$PLATFORM_RELATIONSHIPS` MariaDB environment variables](#mariadb-reference).
776+
777+
Passwords do **not** rotate automatically when you reset this value to `true`.
778+
779+
{{% note title="Important" theme="warning" %}}
780+
Disabling password rotation can jeopardize compliance with security certifications - make sure you weigh this risk alongside the convenience of SSH-tunneling access.
781+
{{% /note %}}
779782

780783
## Storage Engine
781784

sites/upsun/src/development/variables/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ All the non-alphanumerical or `_` characters (`[^0-9A-Z_]`) are transformed into
205205

206206
**Example:**
207207

208-
For a relationship named ``database`` to a service named `postgresl`,
208+
For a relationship named ``database`` to a service named `postgresql`,
209209
the following environment variables are automatically generated in your `myapp` container:
210210

211211
```bash

0 commit comments

Comments
 (0)