2.3. 保護されたすべてのクラスターのアップグレード


Central サービスをアップグレードした後、すべての保護されたクラスターをアップグレードする必要があります。

重要
  • 自動アップグレードを使用している場合は、以下を行います。

  • 自動アップグレードを使用していない場合は、Central クラスターを含むすべての保護されたクラスターでこのセクションの手順を実行する必要があります。

    • 最適な機能を確保するには、セキュアなクラスターと Central がインストールされているクラスターに同じ RHACS バージョンを使用してください。

Sensor、Collector、および Admission コントローラーを実行しているセキュリティーで保護された各クラスターの手動アップグレードを完了するには、このセクションの手順に従ってください。

2.3.1. 準備状態 (readiness) プローブを更新

Red Hat Advanced Cluster Security for Kubernetes 3.65.0 より前のバージョンからアップグレードする場合は、次の追加コマンドを実行して、readiness プローブパスを更新する必要があります。3.65 よりも新しいバージョンを実行している場合は、この手順をスキップしてください。

手順

  • readiness プローブパスを更新します。

    $ oc -n stackrox patch deploy/sensor -p '{"spec":{"template":{"spec":{"containers":[{"name":"sensor","readinessProbe":{"httpGet":{"path":"/ready"}}}]}}}}' 1
    1
    Kubernetes を使用する場合は、oc の代わりに kubectl と入力します。

2.3.2. OpenShift セキュリティーコンテキスト制約の更新

アップグレードする Red Hat Advanced Cluster Security for Kubernetes のバージョンに応じて、特定の OpenShift Container Platform セキュリティーコンテキスト制約 (SCC) を更新する必要があります。

警告

このセクションのコマンドは、OpenShift Container Platform で Red Hat Advanced Cluster Security for Kubernetes を使用している場合に限り実行してください。それ以外の場合は、このセクションの手順をスキップしてください。

手順

  • Red Hat Advanced Cluster Security for Kubernetes 3.64.0 は SCC の名前を変更します。Red Hat Advanced Cluster Security for Kubernetes 3.64.0 より前のバージョンからアップグレードする場合は、SCC を削除して再適用する必要があります。それ以外の場合は、次の手順をスキップしてください。

    1. 次のコマンドを実行して、Central を更新します。

      $ oc apply -f - <<EOF
      kind: SecurityContextConstraints
      apiVersion: security.openshift.io/v1
      metadata:
        name: stackrox-central
        labels:
          app.kubernetes.io/name: stackrox
        annotations:
          kubernetes.io/description: stackrox-central is the security constraint for the central server
          email: support@stackrox.com
          owner: stackrox
      allowHostDirVolumePlugin: false
      allowedCapabilities: []
      allowHostIPC: false
      allowHostNetwork: false
      allowHostPID: false
      allowHostPorts: false
      allowPrivilegeEscalation: false
      allowPrivilegedContainer: false
      defaultAddCapabilities: []
      fsGroup:
        type: MustRunAs
        ranges:
          - max: 4000
            min: 4000
      priority: 0
      readOnlyRootFilesystem: true
      requiredDropCapabilities: []
      runAsUser:
        type: MustRunAs
        uid: 4000
      seLinuxContext:
        type: MustRunAs
      seccompProfiles:
        - '*'
      users:
        - system:serviceaccount:stackrox:central
      volumes:
        - '*'
      EOF
      $ oc delete scc central
    2. 次のコマンドを実行して Scanner を更新します。

      $ oc apply -f - <<EOF
      kind: SecurityContextConstraints
      apiVersion: security.openshift.io/v1
      metadata:
        name: stackrox-scanner
        labels:
          app.kubernetes.io/name: stackrox
        annotations:
          email: support@stackrox.com
          owner: stackrox
          kubernetes.io/description: stackrox-scanner is the security constraint for the Scanner container
      priority: 0
      runAsUser:
        type: RunAsAny
      seLinuxContext:
        type: RunAsAny
      seccompProfiles:
        - '*'
      users:
        - system:serviceaccount:stackrox:scanner
      volumes:
        - '*'
      allowHostDirVolumePlugin: false
      allowedCapabilities: []
      allowHostIPC: false
      allowHostNetwork: false
      allowHostPID: false
      allowHostPorts: false
      allowPrivilegeEscalation: false
      allowPrivilegedContainer: false
      defaultAddCapabilities: []
      fsGroup:
        type: RunAsAny
      readOnlyRootFilesystem: false
      requiredDropCapabilities: []
      EOF
      $ oc delete scc scanner
    3. 各 OpenShift Secured Cluster で以下のコマンドを実行します。

      $ oc apply -f - <<EOF
      apiVersion: security.openshift.io/v1
      kind: SecurityContextConstraints
      metadata:
        name: stackrox-admission-control
        labels:
          app.kubernetes.io/name: stackrox
          auto-upgrade.stackrox.io/component: "sensor"
        annotations:
          email: support@stackrox.com
          owner: stackrox
          kubernetes.io/description: stackrox-admission-control is the security constraint for the admission controller
      users:
        - system:serviceaccount:stackrox:admission-control
      priority: 0
      runAsUser:
        type: RunAsAny
      seLinuxContext:
        type: RunAsAny
      seccompProfiles:
        - '*'
      supplementalGroups:
        type: RunAsAny
      fsGroup:
        type: RunAsAny
      groups: []
      readOnlyRootFilesystem: true
      allowHostDirVolumePlugin: false
      allowHostIPC: false
      allowHostNetwork: false
      allowHostPID: false
      allowHostPorts: false
      allowPrivilegeEscalation: false
      allowPrivilegedContainer: false
      allowedCapabilities: []
      defaultAddCapabilities: []
      requiredDropCapabilities: []
      volumes:
        - configMap
        - downwardAPI
        - emptyDir
        - secret
      ---
      apiVersion: security.openshift.io/v1
      kind: SecurityContextConstraints
      metadata:
        name: stackrox-collector
        labels:
          app.kubernetes.io/name: stackrox
          auto-upgrade.stackrox.io/component: "sensor"
        annotations:
          email: support@stackrox.com
          owner: stackrox
          kubernetes.io/description: This SCC is based on privileged, hostaccess, and hostmount-anyuid
      users:
        - system:serviceaccount:stackrox:collector
      allowHostDirVolumePlugin: true
      allowPrivilegedContainer: true
      fsGroup:
        type: RunAsAny
      groups: []
      priority: 0
      readOnlyRootFilesystem: true
      runAsUser:
        type: RunAsAny
      seLinuxContext:
        type: RunAsAny
      seccompProfiles:
        - '*'
      supplementalGroups:
        type: RunAsAny
      allowHostIPC: false
      allowHostNetwork: false
      allowHostPID: false
      allowHostPorts: false
      allowPrivilegeEscalation: true
      allowedCapabilities: []
      defaultAddCapabilities: []
      requiredDropCapabilities: []
      volumes:
        - configMap
        - downwardAPI
        - emptyDir
        - hostPath
        - secret
      ---
      apiVersion: security.openshift.io/v1
      kind: SecurityContextConstraints
      metadata:
        name: stackrox-sensor
        labels:
          app.kubernetes.io/name: stackrox
          auto-upgrade.stackrox.io/component: "sensor"
        annotations:
          email: support@stackrox.com
          owner: stackrox
          kubernetes.io/description: stackrox-sensor is the security constraint for the sensor
      users:
        - system:serviceaccount:stackrox:sensor
        - system:serviceaccount:stackrox:sensor-upgrader
      priority: 0
      runAsUser:
        type: RunAsAny
      seLinuxContext:
        type: RunAsAny
      seccompProfiles:
        - '*'
      supplementalGroups:
        type: RunAsAny
      fsGroup:
        type: RunAsAny
      groups: []
      readOnlyRootFilesystem: true
      allowHostDirVolumePlugin: false
      allowHostIPC: false
      allowHostNetwork: false
      allowHostPID: false
      allowHostPorts: false
      allowPrivilegeEscalation: true
      allowPrivilegedContainer: false
      allowedCapabilities: []
      defaultAddCapabilities: []
      requiredDropCapabilities: []
      volumes:
        - configMap
        - downwardAPI
        - emptyDir
        - secret
      EOF
      $ oc delete scc admission-control collector sensor

2.3.3. その他のイメージの更新

自動アップグレードを使用しない場合は、セキュリティーで保護された各クラスターのセンサー、コレクター、コンプライアンスイメージを更新する必要があります。

注記

Kubernetes を使用している場合は、この手順にリストされているコマンドに oc の代わりに kubectl を使用してください。

手順

  1. Sensor イメージを更新します。

    $ oc -n stackrox set image deploy/sensor sensor=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.71.3 1
    1
    Kubernetes を使用する場合は、oc の代わりに kubectl と入力します。
  2. Compliance イメージを更新します。

    $ oc -n stackrox set image ds/collector compliance=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.71.3 1
    1
    Kubernetes を使用する場合は、oc の代わりに kubectl と入力します。
  3. Collector イメージを更新します。

    $ oc -n stackrox set image ds/collector collector=registry.redhat.io/advanced-cluster-security/rhacs-collector-rhel8:3.71.3 1
    1
    Kubernetes を使用する場合は、oc の代わりに kubectl と入力します。
    注記

    コレクタースリムイメージを使用している場合は、代わりに次のコマンドを実行します。

    $ oc -n stackrox set image ds/collector collector=registry.redhat.io/advanced-cluster-security/rhacs-collector-slim-rhel8:{rhacs-version}
  4. アドミッションコントロールイメージを更新します。

    $ oc -n stackrox set image deploy/admission-control admission-control=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.71.3

2.3.4. 保護されたクラスターのアップグレードの確認

保護されたクラスターをアップグレードしたら、更新された Pod が機能していることを確認します。

手順

  • 新しい Pod がデプロイされていることを確認します。

    $ oc get deploy,ds -n stackrox -o wide 1
    1
    Kubernetes を使用する場合は、oc の代わりに kubectl と入力します。
    $ oc get pod -n stackrox --watch 1
    1
    Kubernetes を使用する場合は、oc の代わりに kubectl と入力します。
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

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

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

会社概要

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

© 2024 Red Hat, Inc.