1
1
---
2
- title : Apply Pod Security Standards at the Namespace Level
3
- content_type : tutorial
2
+ title : 名前空間レベルでのPodセキュリティの標準の適用
3
+ content_type : チュートリアル
4
4
weight : 20
5
5
---
6
6
7
7
{{% alert title="Note" %}}
8
- This tutorial applies only for new clusters.
8
+ このチュートリアルは、新しいクラスターにのみ適用されます。
9
9
{{% /alert %}}
10
10
11
- Pod Security admission (PSA) is enabled by default in v1.23 and later, as it
12
- [ graduated to beta] ( /blog/2021/12/09/pod-security-admission-beta/ ) . Pod Security Admission
13
- is an admission controller that applies
14
- [ Pod Security Standards] ( /docs/concepts/security/pod-security-standards/ )
15
- when pods are created. In this tutorial, you will enforce the ` baseline ` Pod Security Standard,
16
- one namespace at a time.
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
+ このチュートリアルでは、一度に1つの名前空間で` baseline ` Podセキュリティ標準を強制します。
17
14
18
- You can also apply Pod Security Standards to multiple namespaces at once at the cluster
19
- level. For instructions, refer to
20
- [ Apply Pod Security Standards at the cluster level] ( /docs/tutorials/security/cluster-level-pss/ ) .
15
+ Podセキュリティ標準を複数の名前空間に一度にクラスターレベルで適用することもできます。やり方については[ クラスターレベルでのPodセキュリティの標準の適用] ( /docs/tutorials/security/cluster-level-pss/ ) を参照してください。
21
16
22
17
## {{% heading "prerequisites" %}}
23
18
24
- Install the following on your workstation :
19
+ ワークステーションに以下をインストールしてください :
25
20
26
21
- [ KinD] ( https://kind.sigs.k8s.io/docs/user/quick-start/#installation )
27
- - [ kubectl] ( /docs/tasks/tools/ )
22
+ - [ kubectl] ( /ja/ docs/tasks/tools/ )
28
23
29
- ## Create cluster
24
+ ## クラスターの作成
30
25
31
- 1 . Create a ` KinD ` cluster as follows:
26
+ 1 . 以下のように ` KinD ` クラスターを作成します。
32
27
33
28
``` shell
34
29
kind create cluster --name psa-ns-level
35
30
```
36
31
37
- The output is similar to this :
32
+ 出力は次のようになります :
38
33
39
34
```
40
35
Creating cluster "psa-ns-level" ...
@@ -52,12 +47,12 @@ Install the following on your workstation:
52
47
Not sure what to do next? 😅 Check out https://kind.sigs.k8s.io/docs/user/quick-start/
53
48
```
54
49
55
- 1 . Set the kubectl context to the new cluster :
50
+ 1 . kubectl contextを新しいクラスターにセットします :
56
51
57
52
``` shell
58
53
kubectl cluster-info --context kind-psa-ns-level
59
54
```
60
- The output is similar to this :
55
+ 出力は次のようになります :
61
56
62
57
```
63
58
Kubernetes control plane is running at https://127.0.0.1:50996
@@ -66,37 +61,33 @@ Install the following on your workstation:
66
61
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
67
62
```
68
63
69
- ## Create a namespace
64
+ ## 名前空間の作成
70
65
71
- Create a new namespace called ` example ` :
66
+ ` example ` と呼ぶ新しい名前空間を作成します :
72
67
73
68
``` shell
74
69
kubectl create ns example
75
70
```
76
71
77
- The output is similar to this :
72
+ 出力は次のようになります :
78
73
79
74
```
80
75
namespace/example created
81
76
```
82
77
83
- ## Enable Pod Security Standards checking for that namespace
78
+ ## 名前空間へのPodセキュリティ標準チェックの有効化
84
79
85
- 1 . Enable Pod Security Standards on this namespace using labels supported by
86
- built-in Pod Security Admission. In this step you will configure a check to
87
- warn on Pods that don't meet the latest version of the _ baseline_ pod
88
- security standard.
80
+ 1 . ビルトインのPod Security Admissionでサポートされているラベルを使って、この名前空間のPodセキュリティ標準を有効にします。
81
+ このステップでは、_ baseline_ Podセキュリティ標準の最新バージョンに合わないPodについて警告するチェックを設定します。
89
82
90
83
``` shell
91
84
kubectl label --overwrite ns example \
92
85
pod-security.kubernetes.io/warn=baseline \
93
86
pod-security.kubernetes.io/warn-version=latest
94
87
```
95
88
96
- 2 . You can configure multiple pod security standard checks on any namespace, using labels.
97
- The following command will ` enforce ` the ` baseline ` Pod Security Standard, but
98
- ` warn ` and ` audit ` for ` restricted ` Pod Security Standards as per the latest
99
- version (default value)
89
+ 2 . ラベルを使って、任意の名前空間に対して複数のPodセキュリティ標準チェックを設定できます。
90
+ 以下のコマンドは、` baseline ` Podセキュリティ標準を` enforce ` (強制)としますが、` restricted ` Podセキュリティ標準には最新バージョンに準じて` warn ` (警告)および` audit ` (監査)とします(デフォルト値)。
100
91
101
92
``` shell
102
93
kubectl label --overwrite ns example \
@@ -108,55 +99,51 @@ namespace/example created
108
99
pod-security.kubernetes.io/audit-version=latest
109
100
```
110
101
111
- ## Verify the Pod Security Standard enforcement
102
+ ## Podセキュリティ標準の強制の実証
112
103
113
- 1 . Create a baseline Pod in the ` example ` namespace :
104
+ 1 . ` example ` 名前空間内に ` baseline ` Podを作成します :
114
105
115
106
``` shell
116
107
kubectl apply -n example -f https://k8s.io/examples/security/example-baseline-pod.yaml
117
108
```
118
- The Pod does start OK; the output includes a warning. For example :
109
+ Podは正常に起動しますが、出力には警告が含まれています。例えば :
119
110
120
111
```
121
112
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")
122
113
pod/nginx created
123
114
```
124
115
125
- 1 . Create a baseline Pod in the ` default ` namespace :
116
+ 1 . ` default ` 名前空間内に ` baseline ` Podを作成します :
126
117
127
118
``` shell
128
119
kubectl apply -n default -f https://k8s.io/examples/security/example-baseline-pod.yaml
129
120
```
130
- Output is similar to this :
121
+ 出力は次のようになります :
131
122
132
123
```
133
124
pod/nginx created
134
125
```
135
126
136
- The Pod Security Standards enforcement and warning settings were applied only
137
- to the ` example ` namespace. You could create the same Pod in the ` default `
138
- namespace with no warnings.
127
+ ` example ` 名前空間にだけ、Podセキュリティ標準のenforceと警告の設定が適用されました。
128
+ ` default ` 名前空間内では、警告なしに同じPodを作成できました。
139
129
140
- ## Clean up
130
+ ## 後片付け
141
131
142
- Now delete the cluster which you created above by running the following command :
132
+ では、上記で作成したクラスターを、以下のコマンドを実行して削除します :
143
133
144
134
``` shell
145
135
kind delete cluster --name psa-ns-level
146
136
```
147
137
148
138
## {{% heading "whatsnext" %}}
149
139
150
- - Run a
151
- [ shell script] ( /examples/security/kind-with-namespace-level-baseline-pod-security.sh )
152
- to perform all the preceding steps all at once.
140
+ - 前出の一連の手順を一度に全て行うために[ シェルスクリプト] ( /examples/security/kind-with-namespace-level-baseline-pod-security.sh ) を実行します。
153
141
154
- 1 . Create KinD cluster
155
- 2 . Create new namespace
156
- 3 . Apply ` baseline ` Pod Security Standard in ` enforce ` mode while applying
157
- ` restricted ` Pod Security Standard also in ` warn ` and ` audit ` mode.
158
- 4 . Create a new pod with the following pod security standards applied
142
+ 1 . KinDクラスターを作成します。
143
+ 2 . 新しい名前空間を作成します。
144
+ 3 . ` enforce ` モードでは` baseline ` Podセキュリティ標準を適用し、` warn ` および` audit ` モードでは` restricted ` Podセキュリティ標準を適用します。
145
+ 4 . これらのPodセキュリティ標準を適用した新しいPodを作成します。
159
146
160
- - [ Pod Security Admission ] ( /docs/concepts/security/pod-security-admission/ )
161
- - [ Pod Security Standards ] ( /docs/concepts/security/pod-security-standards/ )
162
- - [ Apply Pod Security Standards at the cluster level ] ( /docs/tutorials/security/cluster-level-pss/ )
147
+ - [ Podのセキュリティアドミッション ] ( /ja /docs/concepts/security/pod-security-admission/)
148
+ - [ Podセキュリティの標準 ] ( /ja /docs/concepts/security/pod-security-standards/)
149
+ - [ クラスターレベルでのPodセキュリティの標準の適用 ] ( /ja /docs/tutorials/security/cluster-level-pss/)
0 commit comments