For security, reliability, and compliance purposes, ensure that your Cloud Logging buckets are configured with a data retention period of 365 days or more. A Cloud Logging bucket is a container that stores log data from cloud services such as Compute Engine and App Engine. The retention period represents the number of days to retain log data for a user-defined log bucket and also for the \_Default log bucket.
A retention period of 365 days or more should allow you to collect the necessary amount of log data useful to find anomalies and potential security breaches. A sufficient log data retention period also meets regulatory requirements and enables long-term analysis of historical data.
Audit
To determine if your Cloud Logging buckets have a sufficient retention period configured for log data, perform the following operations:
Remediation / Resolution
To extend the log data retention period for your Cloud Logging buckets, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- Cloud Logging overview
- Configure log buckets
- Routing and storage overview
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud logging buckets list
- gcloud logging buckets describe
- gcloud logging buckets update