Chapter 11. Configuring AWS STS for Red Hat Quay
You can configure AWS Security Token Service (STS) with Red Hat Quay to authenticate to Amazon S3 by using temporary credentials. STS is available for standalone deployments, Red Hat Quay on OpenShift Container Platform, and Red Hat Quay on Red Hat OpenShift Service on AWS (ROSA).
AWS STS provides temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users. When Red Hat Quay uses Amazon S3 as object storage, STS protocols can authenticate access so that sensitive data remains properly authenticated and authorized.
Configuring AWS STS for OpenShift Container Platform or ROSA requires creating an AWS IAM user, creating an S3 role, and configuring your Red Hat Quay config.yaml file to include the proper resources.
11.1. Configuring Red Hat Quay to use AWS STS Copy linkLink copied to clipboard!
To configure Red Hat Quay to use AWS STS for Amazon S3 storage, you can update the DISTRIBUTED_STORAGE_CONFIG block in your config.yaml file and restart the registry.
Procedure
Update your
config.yamlfile for Red Hat Quay to include the following information:# ... DISTRIBUTED_STORAGE_CONFIG: default: - STSS3Storage - sts_role_arn: <role_arn> s3_bucket: <s3_bucket_name> storage_path: <storage_path> s3_region: <region> sts_user_access_key: <s3_user_access_key> sts_user_secret_key: <s3_user_secret_key> # ...where:
sts_role_arn- Specifies the unique Amazon Resource Name (ARN) required when configuring AWS STS.
s3_bucket- Specifies the name of your S3 bucket.
storage_path-
Specifies the storage path for data. Usually
/datastorage. s3_region-
Specifies the Amazon Web Services region. Defaults to
us-east-1. sts_user_access_key- Specifies the generated AWS S3 user access key required when configuring AWS STS.
sts_user_secret_key- Specifies the generated AWS S3 user secret key required when configuring AWS STS.
- Restart your Red Hat Quay deployment.
Verification
Tag a sample image, for example,
busybox, that you push to the repository. For example:$ podman tag docker.io/library/busybox <quay-server.example.com>/<organization_name>/busybox:testPush the sample image by running the following command:
$ podman push <quay-server.example.com>/<organization_name>/busybox:test-
Verify that the push was successful by navigating to the Organization that you pushed the image to in your Red Hat Quay registry
Tags. - Navigate to the Amazon Web Services (AWS) console and locate your S3 bucket.
- Click the name of your S3 bucket.
- On the Objects page, click datastorage/.
On the datastorage/ page, the following resources should appear:
- sha256/
uploads/
These resources indicate that the push was successful, and that AWS STS is properly configured.