mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Make advanced audit policy on GCP configurable
This commit is contained in:
@@ -480,6 +480,12 @@ EOF
|
||||
# Write the config for the audit policy.
|
||||
function create-master-audit-policy {
|
||||
local -r path="${1}"
|
||||
local -r policy="${2:-}"
|
||||
|
||||
if [[ -n "${policy}" ]]; then
|
||||
echo "${policy}" > "${path}"
|
||||
return
|
||||
fi
|
||||
|
||||
# Known api groups
|
||||
local -r known_apis='
|
||||
@@ -1317,7 +1323,7 @@ function start-kube-apiserver {
|
||||
local -r audit_policy_file="/etc/audit_policy.config"
|
||||
params+=" --audit-policy-file=${audit_policy_file}"
|
||||
# Create the audit policy file, and mount it into the apiserver pod.
|
||||
create-master-audit-policy "${audit_policy_file}"
|
||||
create-master-audit-policy "${audit_policy_file}" "${ADVANCED_AUDIT_POLICY:-}"
|
||||
audit_policy_config_mount="{\"name\": \"auditpolicyconfigmount\",\"mountPath\": \"${audit_policy_file}\", \"readOnly\": true},"
|
||||
audit_policy_config_volume="{\"name\": \"auditpolicyconfigmount\",\"hostPath\": {\"path\": \"${audit_policy_file}\", \"type\": \"FileOrCreate\"}},"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user