Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
fc38b6d0
Commit
fc38b6d0
authored
6 years ago
by
Erwan Miran
Browse files
Options
Downloads
Patches
Plain Diff
Ability to define custom audit polcy rules
parent
855f2a55
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/kubernetes/master/defaults/main.yml
+6
-0
6 additions, 0 deletions
roles/kubernetes/master/defaults/main.yml
roles/kubernetes/master/templates/apiserver-audit-policy.yaml.j2
+4
-0
4 additions, 0 deletions
...ubernetes/master/templates/apiserver-audit-policy.yaml.j2
with
10 additions
and
0 deletions
roles/kubernetes/master/defaults/main.yml
+
6
−
0
View file @
fc38b6d0
...
...
@@ -36,6 +36,12 @@ audit_log_maxbackups: 1
audit_log_maxsize
:
100
# policy file
audit_policy_file
:
"
{{
kube_config_dir
}}/audit-policy/apiserver-audit-policy.yaml"
# custom audit policy rules (to replace the default ones)
# audit_policy_custom_rules: >
# - level: None
# users: []
# verbs: []
# resources: []
# audit log hostpath
audit_log_name
:
audit-logs
...
...
This diff is collapsed.
Click to expand it.
roles/kubernetes/master/templates/apiserver-audit-policy.yaml.j2
+
4
−
0
View file @
fc38b6d0
apiVersion: audit.k8s.io/v1beta1
kind: Policy
rules:
{% if audit_policy_custom_rules is defined and audit_policy_custom_rules != "" -%}
{{ audit_policy_custom_rules | indent(2, true) }}
{% else %}
# The following requests were manually identified as high-volume and low-risk,
# so drop them.
- level: None
...
...
@@ -123,3 +126,4 @@ rules:
- level: Metadata
omitStages:
- "RequestReceived"
{% endif %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment