Administering Keen
Google Cloud
Chapter 16 of 40
Google Cloud
Google Cloud posture reads one organisation, or one project where there is no organisation, with read-only access, and records its Admin Activity audit log entries for IAM, service account and organisation policy changes. Results appear on the Google Cloud vendor's Cloud posture tab (see Cloud vendor posture).
Keen reads it as a service account through a certificate-validating HTTPS-only Google transport, and every request names the configured organisation or project. People sign in with Google accounts, whose 2-Step Verification the Google Workspace provider checks.
Checks
| Check | Action | Met when |
|---|---|---|
| Owners and organisation administrators | posture.identity.admins | Reported for information: the users, groups, domains and service accounts holding Owner, or Organization Administrator on an organisation, anywhere under it. Conditional bindings are left out. |
| Service account keys | posture.credentials.key_age | No live user-managed service account key is older than KEEN_CLOUD_KEY_AGE_DAYS. |
| Service account key creation blocked | posture.google_cloud.key_creation | The iam.disableServiceAccountKeyCreation constraint, or its managed form, is enforced without a condition. |
| Domain-restricted sharing | posture.google_cloud.domain_sharing | The iam.allowedPolicyMemberDomains constraint, or its managed form, limits IAM members to listed customers or domains. |
| Public access prevention | posture.storage.public_access | The storage.publicAccessPrevention constraint is enforced. |
| Data Access audit logs | posture.logging.audit_trail | Data Read and Data Write audit logs are on for all services. |
| SSH and RDP open to the internet | posture.network.admin_ports | No VPC network lets TCP port 22 or 3389 in from 0.0.0.0/0 or ::/0. Ingress rules apply in priority order, a deny beats an allow of equal priority, and a deny limited to tagged instances leaves the others open. |
| Databases open to the internet | posture.network.databases | No Cloud SQL instance with a public address authorises 0.0.0.0/0 or ::/0. |
| Security Command Center findings | posture.findings | Security Command Center holds no active, unmuted finding of critical or high severity. |
The vendor page lists the holders of Owner and Organization Administrator with their roles.
Activity
Keen records Admin Activity audit log entries for SetIamPolicy, service account and service account key creation and deletion, and organisation policy changes, under the method's name, from the organisation or project and any projects in KEEN_GOOGLE_CLOUD_PROJECTS. Each read stops 15 minutes before the present.
1. Create the service account and grant its roles
- In a project you use for administration, create a service account, for example
keen-posture, and create a JSON key for it under Keys → Add key. - Grant it these roles on the organisation (or on the project, without an organisation), under IAM & Admin → IAM → Grant access:
roles/cloudasset.viewer
roles/iam.securityReviewer
roles/orgpolicy.policyViewer
roles/securitycenter.findingsViewer
roles/logging.viewer
roles/serviceusage.serviceUsageConsumer
| Role | Needed by |
|---|---|
roles/cloudasset.viewer | Owners and organisation administrators, Service account keys and both network checks |
roles/iam.securityReviewer | Owners and organisation administrators, and Data Access audit logs |
roles/orgpolicy.policyViewer | The three organisation policy checks |
roles/securitycenter.findingsViewer | Security Command Center findings |
roles/logging.viewer | Admin Activity |
roles/serviceusage.serviceUsageConsumer | Calling Cloud Asset Inventory from the service account's project, where the Cloud Asset API must be enabled |
2. Configure Keen
| Setting | Purpose |
|---|---|
KEEN_GOOGLE_CLOUD_ENABLED | Turns Google Cloud posture on. |
KEEN_GOOGLE_CLOUD_ORGANIZATION | The organisation's number, such as 123456789012. |
KEEN_GOOGLE_CLOUD_PROJECT | Without an organisation, the project ID to read instead. |
KEEN_GOOGLE_CLOUD_PROJECTS | Project IDs, separated by commas, whose own Admin Activity entries are read as well; up to 50. |
GOOGLE_CLOUD_SA_JSON_B64, GOOGLE_CLOUD_SA_JSON or GOOGLE_CLOUD_SA_KEYFILE | The service account key from step 1, as base64, as JSON, or as a file path inside the container. Its token endpoint must be HTTPS. |
3. Verify
Recreate the API, worker and beat containers and choose Admin → Ingest runners → Run Google Cloud, then open the Google Cloud vendor's Cloud posture tab. A check that reads Not established names its reason: not allowed means a role is missing; not set up, or the credentials were not accepted covers a missing setting or key, a disabled API and an organisation number that does not match.