lacework-global-774
Enable Logging and Cloud Monitoring (Automated)
Description
Send logs and metrics to a remote aggregator to mitigate the risk of local tampering in the event of a breach.
Remediation
Using Google Cloud Console:
To enable Logging:
- Go to Kubernetes Engine by visiting: https://console.cloud.google.com/kubernetes/list.
- Select the cluster with Logging disabled.
- Under the
details
pane, within theFeatures
section, click the pencil icon namedEdit logging
. - Check the box next to
Enable Logging
. - In the drop-down
Components
box, select the components to log. - Click
Save Changes
, and wait for the cluster to update.
To enable Cloud Monitoring:
- Go to Kubernetes Engine by visiting: https://console.cloud.google.com/kubernetes/list.
- Select the cluster Logging disabled.
- Under the
details
pane, within theFeatures
section, click the pencil icon namedEdit Cloud Monitoring
. - Check the box next to
Enable Cloud Monitoring
. - In the drop-down
Components
box, select the components to log. - Click
Save Changes
, and wait for the cluster to update.
Using Command Line:
To enable Logging for an existing cluster, run the following command:
gcloud container clusters update <cluster_name> --zone <compute_zone> --logging=<components_to_be_logged>
See https://cloud.google.com/sdk/gcloud/reference/container/clusters/update#--logging for a list of available components for logging.
To enable Cloud Monitoring for an existing cluster, run the following command:
gcloud container clusters update <cluster_name> --zone <compute_zone> --monitoring=<components_to_be_logged>
See https://cloud.google.com/sdk/gcloud/reference/container/clusters/update#--monitoring for a list of available components for Cloud Monitoring.
References
https://cloud.google.com/stackdriver/docs/solutions/gke/observing
https://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs
https://cloud.google.com/stackdriver/docs/solutions/gke/installing
https://cloud.google.com/sdk/gcloud/reference/container/clusters/update#--logging
https://cloud.google.com/sdk/gcloud/reference/container/clusters/update#--monitoring