19장. Integrating RHACS using short-lived tokens


With Red Hat Advanced Cluster Security for Kubernetes (RHACS) you can authenticate against selected cloud provider APIs using short-lived tokens. RHACS supports the following cloud provider integrations:

  • Amazon Web Services (AWS) using the Secure Token Service (STS)
  • Google Cloud using workload identity federation
  • Microsoft Azure using Microsoft Entra ID with managed identities

RHACS supports short-lived token integrations only when you install RHACS on the following platforms:

  • Elastic Kubernetes Service (EKS) on AWS
  • Google Kubernetes Engine (GKE) on GCP
  • Microsoft Azure Kubernetes Service (AKS)
  • OpenShift Container Platform

To activate short-lived authentication, you must establish trust between your Kubernetes or OpenShift Container Platform cluster and your cloud provider. For EKS, GKE and AKS clusters, use the cloud provider metadata service. For OpenShift Container Platform clusters, you need a publicly available OpenID Connect (OIDC) provider bucket containing the OpenShift Container Platform service account signer key.

참고

You must establish trust with your cloud provider for every Central cluster that uses the short-lived token integration. However, if you use delegated scanning in combination with short-lived token image integrations, you must also establish trust for the Sensor cluster.

19.1. Configuring AWS Secure Token Service

RHACS integrations can authenticate against Amazon Web Services using the Secure Token Service. You must configure AssumeRole with RHACS before enabling the Use container IAM role option in integrations.

중요

Verify that the AWS role associated with the RHACS pod must have the IAM permissions required by the integration. For example, to set up a container role for integrating with the Elastic Container Registry, enable full read access to the registry. For more information about AWS IAM roles, see IAM roles.

19.1.1. Configuring Elastic Kubernetes Service (EKS)

When running Red Hat Advanced Cluster Security for Kubernetes (RHACS) on EKS, you can configure short-lived tokens through the Amazon Secure Token Service.

참고

If you use Kubernetes, enter kubectl instead of oc.

Procedure

  1. Run the following command to enable the IAM OpenID Connect (OIDC) provider for your EKS cluster:

    $ eksctl utils associate-iam-oidc-provider --cluster <cluster_name> --approve
  2. Create an IAM role for your EKS cluster.
  3. Edit the permission policy of the role and grant the permissions required by the integration. For example:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "ecr:BatchCheckLayerAvailability",
                    "ecr:BatchGetImage",
                    "ecr:DescribeImages",
                    "ecr:DescribeRepositories",
                    "ecr:GetAuthorizationToken",
                    "ecr:GetDownloadUrlForLayer",
                    "ecr:ListImages"
                ],
                "Resource": "arn:aws:iam::<ecr_registry>:role/<role_name>"
            }
        ]
    }
  4. Update the trust relationship for the role that you want to assume:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "AWS": [
              "arn:aws:iam::<ecr-registry>:role/<role_name>"
            ]
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }

    where:

    <ecr-registry>
    Specifies the <role_name>, which should match with the new role that you have created in the earlier steps.
  5. Enter the following command to associate the newly created role with a service account:

    $ oc -n stackrox annotate sa central eks.amazonaws.com/role-arn=arn:aws:iam::67890:role/<role_name>
  6. Enter the following command to restart the Central pod and apply the changes:

    $ oc -n stackrox delete pod -l "app in (central,sensor)"

19.1.2. Configuring OpenShift Container Platform

When running Red Hat Advanced Cluster Security for Kubernetes (RHACS) on OpenShift Container Platform, you can configure short-lived tokens through the Amazon Secure Token Service.

Prerequisites

  • You must have a public OpenID Connect (OIDC) configuration bucket with the OpenShift Container Platform service account signer key. To get the OIDC configuration for the OpenShift Container Platform cluster, Red Hat recommends using the instructions at Cloud Credential Operator in manual mode for short-term credentials.
  • You must have access to AWS IAM and the permissions to create and change roles.

Procedure

  1. Follow the instructions at Creating OpenID Connect (OIDC) identity providers to create web identity of the OpenShift Container Platform cluster. Use openshift as the value for Audience.
  2. Create an IAM role for the web identity of the OpenShift Container Platform cluster.
  3. Edit the permission policy of the role and grant the permissions required by the integration. For example:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "ecr:BatchCheckLayerAvailability",
                    "ecr:BatchGetImage",
                    "ecr:DescribeImages",
                    "ecr:DescribeRepositories",
                    "ecr:GetAuthorizationToken",
                    "ecr:GetDownloadUrlForLayer",
                    "ecr:ListImages"
                ],
                "Resource": "arn:aws:iam::<ecr_registry>:role/<role_name>"
            }
        ]
    }
  4. Update the trust relationship for the role that you want to assume:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Federated": "<oidc_provider_arn>"
                },
                "Action": "sts:AssumeRoleWithWebIdentity",
                "Condition": {
                    "StringEquals": {
                        "<oidc_provider_name>:aud": "openshift"
                    }
                }
            }
        ]
    }
  5. Set the following RHACS environment variables on the Central or Sensor deployment:

    AWS_ROLE_ARN=<role_arn>
    AWS_WEB_IDENTITY_TOKEN_FILE=/var/run/secrets/openshift/serviceaccount/token
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동