ビュー:

有効なTrend Vision Oneカスタムルールを作成した後、Container Securityにカスタムルールを有効化してインポートしてください。

手順

  1. カスタムルールがOCIリポジトリを使用して構成されている場合、OCIリポジトリの基本認証パラメータを含むKubernetesシークレットを作成してください。
    シークレット値の形式は、FALCOCTL_REGISTRY_AUTH_BASIC falcoctl環境変数と同じです。
  2. 次のような秘密の値を使用して、複数のOCIリポジトリの認証情報を設定します。
    OCI registry,basic auth username,basic auth password;OCI registry1, basic auth username1, basic auth password
  3. 次のコマンドを使用して、OCIリポジトリの認証パラメータを保存するためのKubernetesシークレットを作成します。
    kubectl create secret generic <oci-basic-auth-secret-name> --from-literal=falcoctl=<OCI registry,basic auth username,basic auth 
    password;OCI registry1, basic auth username1, basic auth password1> --namespace trendmicro-system
  4. overrides.yamlファイルを設定し、ローカル構成またはOCIレジストリを通じてカスタムルールをインポートしてください。
    • ローカル設定を通じてカスタムルールをインポートします。
      1. カスタムルールファイルを作成します。
        - rule: Detect Custom Event 1
          id: CR-00000001
          desc: A custom rule to detect a program called detectThisCmd
          condition: proc.cmdline icontains "detectThisCmd"
          output: custom2= "%proc.cmdline", custom4= "%user.name", custom5= "%proc.pid"
          priority: NOTICE
          tags:
              - container
          custom_fields:
              myField: "Sensitive file read access"
              cmdline: "%proc.cmdline"
              custom3: "a string"
              customField: "%user.name"
              custom5: "%proc.pid"
        
        - rule: Shell in container
          id: CR-00000002
          desc: Detect shell activity within a container
          condition: >
              evt.type=execve and evt.dir=< and 
              container.id!=host and (proc.name=bash or proc.name=ksh)
          output: custom2= "%proc.cmdline", custom4= "%user.name", custom5= "%proc.pid"
          priority: INFO
          tags:
              - container
              - mitre_discovery
          custom_fields:
              myField: "Sensitive file read access"
              cmdline: "%proc.cmdline"
              custom3: "a string"
              customField: "%user.name"
              custom5: "%proc.pid"
      2. https://github.com/trendmicro/visionone-container-security-helm から Helm リポジトリをクローンします。
      3. ルールファイルをディレクトリvisionone-container-security-helm/config/customrulesにコピーしてください。
      4. visionOne.customRules.enabled=truevisionOne.customRules.output.visionOne.enabled=trueを設定してカスタムルール機能を有効にします。
        visionOne
            runtimeSecurity:
                enabled: true
                customRules:
                    enabled: true
                    output: 
                        visionOne:
                            enabled: true
    • OCIレジストリを通じてカスタムルールをインポートします。
      1. ルールファイルをOCIレジストリにアップロードします。通常、次のコマンドを使用して行います: sudo falcoctl registry push <OCI-repository>:<tag> <rulesFilePath> --type rulesfile --version "<version>"
      2. visionOne.customRules.enabled=truevisionOne.customRules.output.visionOne.enabled=truevisionOne.ociRepository.enabled=trueを設定し、artifactUrlsrulesFile (s)basicAuthTokenSecretNameを指定してカスタムルール機能を有効にします。
        visionOne:
            runtimeSecurity:
                enabled: true
                customRules:
                    enabled: true
                    output:
                        visionOne:
                            enabled: true
                    ociRepository:
                        enabled: true
                        artifactUrls:
                            - docker.io/sampleRules:latest
                        rulesFiles:
                            - sampleRulesFile.yaml
                    basicAuthTokenSecretName: <oci-basic-auth-secret-name>
  5. ポリシーをコードとして使用してポリシーの設定を完了します。
    カスタムルールセットはポリシーの一部です。共有ポリシーを使用する際に逸脱がないようにするために、カスタムルール機能はユーザにクラスター管理ポリシーでコードとしてポリシーを使用することを要求します。クラスター管理ポリシーについて詳しく学んでください。