19.2. Configuring Google workload identity federation


RHACS integrations can authenticate against the Google Cloud by using workload identities. Select the Use workload identity option upon creation to enable workload identity authentication in a Google Cloud integration.

重要

The Google service account associated with the RHACS pod through the workload identity must have the IAM permissions required by the integration. For example, to set up a workload identity for integrating with Google Artifact Registry, connect a service account with the roles/artifactregistry.reader role. For more information about Google IAM roles see Configure roles and permissions.

19.2.1. Configuring Google Kubernetes Engine (GKE)

When running Red Hat Advanced Cluster Security for Kubernetes (RHACS) on GKE, you can configure short-lived tokens through Google workload identities.

注記

If you use Kubernetes, enter kubectl instead of oc.

Prerequisites

  • You must have access to the Google Cloud project containing the cluster and integration resources.

Procedure

  1. Follow the instructions in the Google Cloud documentation to Use workload identity federation for GKE.
  2. Annotate the RHACS service account by running the following command:

    $ oc annotate serviceaccount \
        central \
        --namespace stackrox \
        iam.gke.io/gcp-service-account=<GSA_NAME>@<GSA_PROJECT>.iam.gserviceaccount.com
    重要

    When setting up delegated scanning, use sensor instead of central.

19.2.2. Configuring OpenShift Container Platform

You can configure short-lived tokens through Google workload identities when running Red Hat Advanced Cluster Security for Kubernetes (RHACS) on OpenShift Container Platform.

Prerequisites

  • You must have a public OIDC configuration bucket with the OpenShift Container Platform service account signer key. The recommended way to obtain the OIDC configuration for the OpenShift Container Platform cluster is to use the Cloud Credential Operator in manual mode for short-term credentials instructions.
  • Access to a Google Cloud project with the roles/iam.workloadIdentityPoolAdmin role.

Procedure

  1. Follow the instructions at Manage workload identity pools to create a workload identity pool. For example:

    $ gcloud iam workload-identity-pools create rhacs-pool \
        --location="global" \
        --display-name="RHACS workload pool"
  2. Follow the instructions at Manage workload identity pool providers to create a workload identity pool provider. For example:

    $ gcloud iam workload-identity-pools providers create-oidc rhacs-provider \
        --location="global" \
        --workload-identity-pool="rhacs-pool" \
        --display-name="RHACS provider" \
        --attribute-mapping="google.subject=assertion.sub" \
        --issuer-uri="https://<oidc_configuration_url>" \
        --allowed-audiences=openshift
  3. Connect a Google service account to the workload identity pool. For example:

    $ gcloud iam service-accounts add-iam-policy-binding <GSA_NAME>@<GSA_PROJECT>.iam.gserviceaccount.com \
        --role roles/iam.workloadIdentityUser \
        --member="principal://iam.googleapis.com/projects/<GSA_PROJECT_NUMBER>/locations/global/workloadIdentityPools/rhacs-provider/subject/system:serviceaccount:stackrox:central"

    where:

    <system:serviceaccount:stackrox:central>
    Specifies the subject. For delegated scanning, you must set the subject to system:serviceaccount:stackrox:sensor.
  4. Create a service account JSON containing the Security token service (STS) configuration. For example:

    {
      "type": "external_account",
      "audience": "//iam.googleapis.com/projects/<GSA_PROJECT_ID>/locations/global/workloadIdentityPools/rhacs-pool/providers/rhacs-provider",
      "subject_token_type": "urn:ietf:params:oauth:token-type:jwt",
      "token_url": "https://sts.googleapis.com/v1/token",
      "service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/<GSA_NAME>@<GSA_PROJECT>.iam.gserviceaccount.com:generateAccessToken",
      "credential_source": {
        "file": "/var/run/secrets/openshift/serviceaccount/token",
        "format": {
          "type": "text"
        }
      }
    }
  5. Use the service account JSON as a secret to the RHACS namespace:

    apiVersion: v1
    kind: Secret
    metadata:
      name: gcp-cloud-credentials
      namespace: stackrox
    data:
      credentials: <base64_encoded_json>
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る