Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #100 from wandera/JSCCE-9848
Browse files Browse the repository at this point in the history
JSCCE-9848 Add audit policy config
  • Loading branch information
mkmet authored Dec 15, 2022
2 parents 0bb243e + 17d6cac commit 86a47e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
20 changes: 17 additions & 3 deletions aws/cluster/cluster-spec.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
locals {
audit_policy_file_path = "/srv/kubernetes/kube-apiserver/audit-policy-config.yaml"

container_networking_params = {
amazonvpc = var.container-networking-params-amazonvpc
calico = var.container-networking-params-calico
Expand Down Expand Up @@ -64,8 +66,16 @@ locals {
} : {})
]
externalPolicies = var.external-policies
iam = var.iam
keyStore = "s3://${var.kops-state-bucket}/${var.cluster-name}/pki"
fileAssets = var.audit-policy-config == "" ? null : [
{
name = "audit-policy-config"
path = local.audit_policy_file_path
roles = ["Master"]
content = var.audit-policy-config
}
]
iam = var.iam
keyStore = "s3://${var.kops-state-bucket}/${var.cluster-name}/pki"
kubeAPIServer = merge({
insecureBindAddress = "127.0.0.1"
enableAdmissionPlugins = var.enable-admission-plugins
Expand All @@ -86,7 +96,11 @@ locals {
oidcGroupsClaim = var.oidc-groups-claim
oidcIssuerURL = var.oidc-issuer-url
oidcUsernameClaim = var.oidc-username-claim
})
}, var.audit-policy-config == "" ? {} : {
auditLogPath = "-"
auditPolicyFile = local.audit_policy_file_path
}
)
kubeControllerManager = {
allocateNodeCIDRs = true
attachDetachReconcileSyncPeriod = "1m0s"
Expand Down
5 changes: 5 additions & 0 deletions aws/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1066,3 +1066,8 @@ variable "containerd-log-level" {
type = string
default = "warn"
}

variable "audit-policy-config" {
type = string
default = ""
}

0 comments on commit 86a47e6

Please sign in to comment.