Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions serverless/containers/how-to/secure-a-container.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Instead of using environment variables (which are stored in clear text) for your
### Configure secrets from the Scaleway console

1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays.
2. Click the relevant container namespace.
2. Click the relevant Containers namespace.
3. Click the name of the container for which you want to define secrets.
4. Click the **Deployment** tab.
5. Scroll to the **Secrets** section of the page and click **Add secret**. Enter the key and value for your secret. Repeat for additional secrets.
Expand Down Expand Up @@ -94,11 +94,25 @@ curl -H "X-Auth-Token: <YOUR_CONTAINER_TOKEN>" <YOUR_CONTAINER_ENDPOINT>

Refer to the [How to create an authentication token](/serverless/containers/how-to/create-auth-token-from-console/) documentation for more information.

### Restrict access using Terraform
## Redirect HTTP to HTTPS

If you do not want to expose your container over HTTP, you can enable the HTTP to HTTPS redirection to ensure that all traffic follows a secure path.

### Configure redirection using the Scaleway console

1. Click **Containers** in the **Serverless** section of the side menu of the Scaleway console. The Containers page displays.
2. Click the relevant Containers namespace.
3. Click the name of the container for which you want to enable the redirection.
4. Click the **Security** tab.
5. Toggle the **HTTPS connections only** switch to **On**.

Incoming HTTP traffic is now redirected to HTTPS.

### Configure redirection using the Serverless framework

Set `privacy = "private"` in your Terraform [resource description](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/container).
To redirect HTTP traffic to HTTPS using the Serverless Framework, add the `httpOption: redirected` option to your container's description.

You can generate access credentials to inject in other applications, such as containers and functions, directly from Terraform using the [container_token resource](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/container_token).
Refer to our [dedicated repository](https://github.com/scaleway/serverless-scaleway-functions/?tab=readme-ov-file#container-specific-configuration) for more information on container configuration using the Serverless Framework.

## Set up alerts in Observability Cockpit (upcoming feature)

Expand Down