Skip to content

Commit 63773db

Browse files
committed
translate docs/tutorials/security/cluster-level-pss
1 parent 7f51c15 commit 63773db

File tree

1 file changed

+66
-92
lines changed

1 file changed

+66
-92
lines changed
Lines changed: 66 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,45 @@
11
---
2-
title: Apply Pod Security Standards at the Cluster Level
2+
title: クラスターレベルでのPodセキュリティの標準の適用
33
content_type: tutorial
44
weight: 10
55
---
66

77
{{% alert title="Note" %}}
8-
This tutorial applies only for new clusters.
8+
このチュートリアルは、新しいクラスターにのみ適用されます。
99
{{% /alert %}}
1010

11-
Pod Security admission (PSA) is enabled by default in v1.23 and later, as it has
12-
[graduated to beta](/blog/2021/12/09/pod-security-admission-beta/).
13-
Pod Security
14-
is an admission controller that carries out checks against the Kubernetes
15-
[Pod Security Standards](/docs/concepts/security/pod-security-standards/) when new pods are
16-
created. This tutorial shows you how to enforce the `baseline` Pod Security
17-
Standard at the cluster level which applies a standard configuration
18-
to all namespaces in a cluster.
11+
Podセキュリティアドミッション(PSA)は、[ベータへ進み](/blog/2021/12/09/pod-security-admission-beta/)、v1.23以降でデフォルトで有効になっています。
12+
Podセキュリティアドミッションは、Podが作成される際に、[Podセキュリティの標準](/ja/docs/concepts/security/pod-security-standards/)の適用の認可を制御するものです。
13+
このチュートリアルでは、クラスター内の全ての名前空間に標準設定を適用することで、クラスターレベルで`baseline` Podセキュリティの標準を強制する方法を示します。
1914

20-
To apply Pod Security Standards to specific namespaces, refer to
21-
[Apply Pod Security Standards at the namespace level](/docs/tutorials/security/ns-level-pss).
15+
Podセキュリティの標準を特定の名前空間に適用するには、[名前空間レベルでのPodセキュリティの標準の適用](/ja/docs/tutorials/security/ns-level-pss/)を参照してください。
2216

23-
If you are running a version of Kubernetes other than v{{< skew currentVersion >}},
24-
check the documentation for that version.
17+
v{{< skew currentVersion >}}以外のKubernetesバージョンを実行している場合は、そのバージョンのドキュメントを確認してください。
2518

2619
## {{% heading "prerequisites" %}}
2720

28-
Install the following on your workstation:
21+
ワークステーションに以下をインストールしてください:
2922

3023
- [KinD](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
31-
- [kubectl](/docs/tasks/tools/)
24+
- [kubectl](/ja/docs/tasks/tools/)
3225

33-
This tutorial demonstrates what you can configure for a Kubernetes cluster that you fully
34-
control. If you are learning how to configure Pod Security Admission for a managed cluster
35-
where you are not able to configure the control plane, read
36-
[Apply Pod Security Standards at the namespace level](/docs/tutorials/security/ns-level-pss).
26+
このチュートリアルでは、完全な制御下にあるKubernetesクラスターの何を設定できるかをデモンストレーションします。
3727

38-
## Choose the right Pod Security Standard to apply
28+
コントロールプレーンを設定できない管理されたクラスターのPodセキュリティアドミッションに対しての設定方法を知りたいのであれば、[名前空間レベルでのPodセキュリティの標準の適用](/ja/docs/tutorials/security/ns-level-pss/)を参照してください。
3929

40-
[Pod Security Admission](/docs/concepts/security/pod-security-admission/)
41-
lets you apply built-in [Pod Security Standards](/docs/concepts/security/pod-security-standards/)
42-
with the following modes: `enforce`, `audit`, and `warn`.
30+
## 適用する正しいPodセキュリティの標準の選択
4331

44-
To gather information that helps you to choose the Pod Security Standards
45-
that are most appropriate for your configuration, do the following:
32+
[Podのセキュリティアドミッション](/ja/docs/concepts/security/pod-security-admission/)は、以下のモードでビルトインの[Podセキュリティの標準](/ja/docs/concepts/security/pod-security-standards/)の適用を促します: `enforce``audit``warn`
4633

47-
1. Create a cluster with no Pod Security Standards applied:
34+
35+
設定に最適なPodセキュリティの標準を選択するにあたって助けになる情報を収集するために、以下を行ってください:
36+
37+
1. Podセキュリティの標準を適用していないクラスターを作成します:
4838

4939
```shell
5040
kind create cluster --name psa-wo-cluster-pss
5141
```
52-
The output is similar to:
42+
出力は次のようになります:
5343
```
5444
Creating cluster "psa-wo-cluster-pss" ...
5545
✓ Ensuring node image (kindest/node:v{{< skew currentVersion >}}.0) 🖼
@@ -66,12 +56,12 @@ that are most appropriate for your configuration, do the following:
6656
Thanks for using kind! 😊
6757
```
6858

69-
1. Set the kubectl context to the new cluster:
59+
1. kubectl contextを新しいクラスターにセットします:
7060

7161
```shell
7262
kubectl cluster-info --context kind-psa-wo-cluster-pss
7363
```
74-
The output is similar to this:
64+
出力は次のようになります:
7565

7666
```
7767
Kubernetes control plane is running at https://127.0.0.1:61350
@@ -81,12 +71,12 @@ that are most appropriate for your configuration, do the following:
8171
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
8272
```
8373

84-
1. Get a list of namespaces in the cluster:
74+
1. クラスター内の名前空間の一覧を取得します:
8575

8676
```shell
8777
kubectl get ns
8878
```
89-
The output is similar to this:
79+
出力は次のようになります:
9080
```
9181
NAME STATUS AGE
9282
default Active 9m30s
@@ -96,30 +86,29 @@ that are most appropriate for your configuration, do the following:
9686
local-path-storage Active 9m26s
9787
```
9888

99-
1. Use `--dry-run=server` to understand what happens when different Pod Security Standards
100-
are applied:
89+
1. 異なるPodセキュリティの標準が適用されたときに何が起きるかを理解するために、`-dry-run=server`を使います:
10190

102-
1. Privileged
91+
1. privileged
10392
```shell
10493
kubectl label --dry-run=server --overwrite ns --all \
10594
pod-security.kubernetes.io/enforce=privileged
10695
```
10796

108-
The output is similar to:
97+
出力は次のようになります:
10998
```
11099
namespace/default labeled
111100
namespace/kube-node-lease labeled
112101
namespace/kube-public labeled
113102
namespace/kube-system labeled
114103
namespace/local-path-storage labeled
115104
```
116-
2. Baseline
105+
2. baseline
117106
```shell
118107
kubectl label --dry-run=server --overwrite ns --all \
119108
pod-security.kubernetes.io/enforce=baseline
120109
```
121110

122-
The output is similar to:
111+
出力は次のようになります:
123112
```
124113
namespace/default labeled
125114
namespace/kube-node-lease labeled
@@ -132,13 +121,13 @@ that are most appropriate for your configuration, do the following:
132121
namespace/local-path-storage labeled
133122
```
134123

135-
3. Restricted
124+
3. restricted
136125
```shell
137126
kubectl label --dry-run=server --overwrite ns --all \
138127
pod-security.kubernetes.io/enforce=restricted
139128
```
140129

141-
The output is similar to:
130+
出力は次のようになります:
142131
```
143132
namespace/default labeled
144133
namespace/kube-node-lease labeled
@@ -154,37 +143,27 @@ that are most appropriate for your configuration, do the following:
154143
namespace/local-path-storage labeled
155144
```
156145

157-
From the previous output, you'll notice that applying the `privileged` Pod Security Standard shows no warnings
158-
for any namespaces. However, `baseline` and `restricted` standards both have
159-
warnings, specifically in the `kube-system` namespace.
146+
この出力から、`privileged` Podセキュリティの標準を適用すると、名前空間のどれにも警告が示されないことに気付くでしょう。
147+
これに対し、`baseline``restrict`の標準ではどちらも、とりわけ`kube-system`名前空間に対して警告が示されています。
160148

161-
## Set modes, versions and standards
149+
## モード、バージョン、標準のセット
162150

163-
In this section, you apply the following Pod Security Standards to the `latest` version:
151+
このセクションでは、`latest`バージョンに以下のPodセキュリティの標準を適用します:
164152

165-
* `baseline` standard in `enforce` mode.
166-
* `restricted` standard in `warn` and `audit` mode.
153+
* `enforce`モードで`baseline`標準。
154+
* `awrn`および`audit`モードで`restricted`標準。
167155

168-
The `baseline` Pod Security Standard provides a convenient
169-
middle ground that allows keeping the exemption list short and prevents known
170-
privilege escalations.
156+
`baseline` Podセキュリティの標準は、免除リストを短く保てて、かつ既知の特権昇格を防ぐような、利便性のある中庸を提供します。
171157

172-
Additionally, to prevent pods from failing in `kube-system`, you'll exempt the namespace
173-
from having Pod Security Standards applied.
158+
加えて、`kube-system`内の失敗からPodを守るために、適用されるPodセキュリティの標準の対象から名前空間を免除します。
174159

175-
When you implement Pod Security Admission in your own environment, consider the
176-
following:
160+
環境にPodセキュリティアドミッションを実装する際には、以下の点を考慮してください:
177161

178-
1. Based on the risk posture applied to a cluster, a stricter Pod Security
179-
Standard like `restricted` might be a better choice.
180-
1. Exempting the `kube-system` namespace allows pods to run as
181-
`privileged` in this namespace. For real world use, the Kubernetes project
182-
strongly recommends that you apply strict RBAC
183-
policies that limit access to `kube-system`, following the principle of least
184-
privilege.
185-
To implement the preceding standards, do the following:
186-
1. Create a configuration file that can be consumed by the Pod Security
187-
Admission Controller to implement these Pod Security Standards:
162+
1. クラスターに適用されるリスク状況に基づくと、`restricted`のようにより厳格なPodセキュリティの標準のほうが、より良い選択肢かもしれません。
163+
1. `kube-ssytem`名前空間の免除は、Podがその名前空間で`privileged`として実行するのを許容することになります。
164+
実世界で使うにあたっては、以下の最小権限の原則に従って`kube-system`へのアクセスを制限する厳格なRBACポリシーを適用することを、Kubernetesプロジェクトは強く推奨します。
165+
上記の標準を実装するには、次のようにします:
166+
1. 目的のPodセキュリティの標準を実装するために、Podセキュリティアドミッションコントローラーで利用可能な設定ファイルを作成します:
188167

189168
```
190169
mkdir -p /tmp/pss
@@ -211,13 +190,13 @@ following:
211190
```
212191
213192
{{< note >}}
214-
`pod-security.admission.config.k8s.io/v1` configuration requires v1.25+.
215-
For v1.23 and v1.24, use [v1beta1](https://v1-24.docs.kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/).
216-
For v1.22, use [v1alpha1](https://v1-22.docs.kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/).
193+
`pod-security.admission.config.k8s.io/v1`設定はv1.25+での対応です。
194+
v1.23とv1.24では[v1beta1](https://v1-24.docs.kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/)を使用してください。
195+
v1.22では[v1alpha1](https://v1-22.docs.kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/)を使用してください。
217196
{{< /note >}}
218197
219198
220-
1. Configure the API server to consume this file during cluster creation:
199+
1. クラスターの作成中にこのファイルを取り込むAPIサーバーを設定します:
221200
222201
```
223202
cat <<EOF > /tmp/pss/cluster-config.yaml
@@ -254,18 +233,15 @@ following:
254233
```
255234
256235
{{<note>}}
257-
If you use Docker Desktop with KinD on macOS, you can
258-
add `/tmp` as a Shared Directory under the menu item
259-
**Preferences > Resources > File Sharing**.
236+
macOSでDocker DesktopとKinDを利用している場合は、**Preferences > Resources > File Sharing**のメニュー項目からShared Directoryとして`/tmp`を追加できます。
260237
{{</note>}}
261238
262-
1. Create a cluster that uses Pod Security Admission to apply
263-
these Pod Security Standards:
239+
1. 目的のPodセキュリティの標準を適用するために、Podセキュリティアドミッションを使うクラスターを作成します:
264240
265241
```shell
266242
kind create cluster --name psa-with-cluster-pss --config /tmp/pss/cluster-config.yaml
267243
```
268-
The output is similar to this:
244+
出力は次のようになります:
269245
```
270246
Creating cluster "psa-with-cluster-pss" ...
271247
✓ Ensuring node image (kindest/node:v{{< skew currentVersion >}}.0) 🖼
@@ -282,33 +258,33 @@ following:
282258
Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂
283259
```
284260

285-
1. Point kubectl to the cluster:
261+
1. kubectlをクラスターに向けます:
286262
```shell
287263
kubectl cluster-info --context kind-psa-with-cluster-pss
288264
```
289-
The output is similar to this:
265+
出力は次のようになります:
290266
```
291267
Kubernetes control plane is running at https://127.0.0.1:63855
292268
CoreDNS is running at https://127.0.0.1:63855/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
293269
294270
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
295271
```
296272

297-
1. Create a Pod in the default namespace:
273+
1. デフォルトの名前空間にPodを作成します:
298274

299275
```shell
300276
kubectl apply -f https://k8s.io/examples/security/example-baseline-pod.yaml
301277
```
302278

303-
The pod is started normally, but the output includes a warning:
279+
Podは正常に開始されますが、出力には警告が含まれます:
304280
```
305281
Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "nginx" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "nginx" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "nginx" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "nginx" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
306282
pod/nginx created
307283
```
308284

309-
## Clean up
285+
## 後片付け
310286

311-
Now delete the clusters which you created above by running the following command:
287+
では、上記で作成したクラスターを、以下のコマンドを実行して削除します:
312288

313289
```shell
314290
kind delete cluster --name psa-with-cluster-pss
@@ -319,15 +295,13 @@ kind delete cluster --name psa-wo-cluster-pss
319295

320296
## {{% heading "whatsnext" %}}
321297

322-
- Run a
323-
[shell script](/examples/security/kind-with-cluster-level-baseline-pod-security.sh)
324-
to perform all the preceding steps at once:
325-
1. Create a Pod Security Standards based cluster level Configuration
326-
2. Create a file to let API server consume this configuration
327-
3. Create a cluster that creates an API server with this configuration
328-
4. Set kubectl context to this new cluster
329-
5. Create a minimal pod yaml file
330-
6. Apply this file to create a Pod in the new cluster
331-
- [Pod Security Admission](/docs/concepts/security/pod-security-admission/)
332-
- [Pod Security Standards](/docs/concepts/security/pod-security-standards/)
333-
- [Apply Pod Security Standards at the namespace level](/docs/tutorials/security/ns-level-pss/)
298+
- 前出の一連の手順を一度に全て行うために[シェルスクリプト](/examples/security/kind-with-cluster-level-baseline-pod-security.sh)を実行します:
299+
1. クラスターレベルの設定に基づきPodセキュリティの標準を作成します。
300+
2. APIサーバーでこの設定を取り込むようにファイルを作成します。
301+
3. この設定のAPIサーバーを立てるクラスターを作成します。
302+
4. この新しいクラスターにkubectl contextをセットします。
303+
5. 最小限のPod YAMLファイルを作成します。
304+
6. 新しいクラスター内でPodを作成するために、このファイルを適用します。
305+
- [Podのセキュリティアドミッション](/ja/docs/concepts/security/pod-security-admission/)
306+
- [Podセキュリティの標準](/ja/docs/concepts/security/pod-security-standards/)
307+
- [名前空間レベルでのPodセキュリティの標準の適用](/docs/tutorials/security/ns-level-pss/)

0 commit comments

Comments
 (0)