rongzhang
6 years ago
9 changed files with 217 additions and 0 deletions
Split View
Diff Options
-
3inventory/sample/group_vars/k8s-cluster.yml
-
23roles/kubernetes/master/defaults/main.yml
-
10roles/kubernetes/master/tasks/kubeadm-setup.yml
-
15roles/kubernetes/master/tasks/static-pod-setup.yml
-
125roles/kubernetes/master/templates/apiserver-audit-policy.yaml.j2
-
16roles/kubernetes/master/templates/kubeadm-config.v1alpha2.yaml.j2
-
23roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2
-
1tests/files/gce_centos-weave-kubeadm.yml
-
1tests/files/gce_centos7-flannel-addons.yml
@ -0,0 +1,125 @@ |
|||
apiVersion: audit.k8s.io/v1beta1 |
|||
kind: Policy |
|||
rules: |
|||
# The following requests were manually identified as high-volume and low-risk, |
|||
# so drop them. |
|||
- level: None |
|||
users: ["system:kube-proxy"] |
|||
verbs: ["watch"] |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["endpoints", "services", "services/status"] |
|||
- level: None |
|||
# Ingress controller reads `configmaps/ingress-uid` through the unsecured port. |
|||
# TODO(#46983): Change this to the ingress controller service account. |
|||
users: ["system:unsecured"] |
|||
namespaces: ["kube-system"] |
|||
verbs: ["get"] |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["configmaps"] |
|||
- level: None |
|||
users: ["kubelet"] # legacy kubelet identity |
|||
verbs: ["get"] |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["nodes", "nodes/status"] |
|||
- level: None |
|||
userGroups: ["system:nodes"] |
|||
verbs: ["get"] |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["nodes", "nodes/status"] |
|||
- level: None |
|||
users: |
|||
- system:kube-controller-manager |
|||
- system:kube-scheduler |
|||
- system:serviceaccount:kube-system:endpoint-controller |
|||
verbs: ["get", "update"] |
|||
namespaces: ["kube-system"] |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["endpoints"] |
|||
- level: None |
|||
users: ["system:apiserver"] |
|||
verbs: ["get"] |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["namespaces", "namespaces/status", "namespaces/finalize"] |
|||
# Don't log HPA fetching metrics. |
|||
- level: None |
|||
users: |
|||
- system:kube-controller-manager |
|||
verbs: ["get", "list"] |
|||
resources: |
|||
- group: "metrics.k8s.io" |
|||
# Don't log these read-only URLs. |
|||
- level: None |
|||
nonResourceURLs: |
|||
- /healthz* |
|||
- /version |
|||
- /swagger* |
|||
# Don't log events requests. |
|||
- level: None |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["events"] |
|||
# Secrets, ConfigMaps, and TokenReviews can contain sensitive & binary data, |
|||
# so only log at the Metadata level. |
|||
- level: Metadata |
|||
resources: |
|||
- group: "" # core |
|||
resources: ["secrets", "configmaps"] |
|||
- group: authentication.k8s.io |
|||
resources: ["tokenreviews"] |
|||
omitStages: |
|||
- "RequestReceived" |
|||
# Get responses can be large; skip them. |
|||
- level: Request |
|||
verbs: ["get", "list", "watch"] |
|||
resources: |
|||
- group: "" # core |
|||
- group: "admissionregistration.k8s.io" |
|||
- group: "apiextensions.k8s.io" |
|||
- group: "apiregistration.k8s.io" |
|||
- group: "apps" |
|||
- group: "authentication.k8s.io" |
|||
- group: "authorization.k8s.io" |
|||
- group: "autoscaling" |
|||
- group: "batch" |
|||
- group: "certificates.k8s.io" |
|||
- group: "extensions" |
|||
- group: "metrics.k8s.io" |
|||
- group: "networking.k8s.io" |
|||
- group: "policy" |
|||
- group: "rbac.authorization.k8s.io" |
|||
- group: "settings.k8s.io" |
|||
- group: "storage.k8s.io" |
|||
omitStages: |
|||
- "RequestReceived" |
|||
# Default level for known APIs |
|||
- level: RequestResponse |
|||
resources: |
|||
- group: "" # core |
|||
- group: "admissionregistration.k8s.io" |
|||
- group: "apiextensions.k8s.io" |
|||
- group: "apiregistration.k8s.io" |
|||
- group: "apps" |
|||
- group: "authentication.k8s.io" |
|||
- group: "authorization.k8s.io" |
|||
- group: "autoscaling" |
|||
- group: "batch" |
|||
- group: "certificates.k8s.io" |
|||
- group: "extensions" |
|||
- group: "metrics.k8s.io" |
|||
- group: "networking.k8s.io" |
|||
- group: "policy" |
|||
- group: "rbac.authorization.k8s.io" |
|||
- group: "settings.k8s.io" |
|||
- group: "storage.k8s.io" |
|||
omitStages: |
|||
- "RequestReceived" |
|||
# Default level for all other requests. |
|||
- level: Metadata |
|||
omitStages: |
|||
- "RequestReceived" |
Write
Preview
Loading…
Cancel
Save