This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.
8.2. ユーザーエージェントの設定
管理者は、マスター設定の userAgentMatching 設定を使用してクライアントが API にアクセスできないようにすることができます。
手順
マスター設定ファイルを、ユーザーエージェント設定を組み込むように変更します。たとえば、以下のユーザーエージェントは Kubernetes 1.2 クライアントバイナリー、OKD 1.1.3 バイナリー、および POST および PUT httpVerbs を拒否します。
policyConfig:
userAgentMatchingConfig:
defaultRejectionMessage: "Your client is too old. Go to https://example.org to update it."
deniedClients:
- regex: '\w+/v(?:(?:1\.1\.1)|(?:1\.0\.1)) \(.+/.+\) openshift/\w{7}'
- regex: '\w+/v(?:1\.1\.3) \(.+/.+\) openshift/\w{7}'
httpVerbs:
- POST
- PUT
- regex: '\w+/v1\.2\.0 \(.+/.+\) kubernetes/\w{7}'
httpVerbs:
- POST
- PUT
requiredClients: null
policyConfig:userAgentMatchingConfig:defaultRejectionMessage:"Your client is too old. Go to https://example.org to update it."deniedClients:-regex:'\w+/v(?:(?:1\.1\.1)|(?:1\.0\.1)) \(.+/.+\) openshift/\w{7}'-regex:'\w+/v(?:1\.1\.3) \(.+/.+\) openshift/\w{7}'httpVerbs:- POST
- PUT
-regex:'\w+/v1\.2\.0 \(.+/.+\) kubernetes/\w{7}'httpVerbs:- POST
- PUT
requiredClients:null
Copy to ClipboardCopied!Toggle word wrapToggle overflow
以下の例は、予想されるクライアントに一致しないクライアントを拒否します。
policyConfig:
userAgentMatchingConfig:
defaultRejectionMessage: "Your client is too old. Go to https://example.org to update it."
deniedClients: []
requiredClients:
- regex: '\w+/v1\.1\.3 \(.+/.+\) openshift/\w{7}'
- regex: '\w+/v1\.2\.0 \(.+/.+\) kubernetes/\w{7}'
httpVerbs:
- POST
- PUT
policyConfig:userAgentMatchingConfig:defaultRejectionMessage:"Your client is too old. Go to https://example.org to update it."deniedClients:[]requiredClients:-regex:'\w+/v1\.1\.3 \(.+/.+\) openshift/\w{7}'-regex:'\w+/v1\.2\.0 \(.+/.+\) kubernetes/\w{7}'httpVerbs:- POST
- PUT
Copy to ClipboardCopied!Toggle word wrapToggle overflow