Keen documentation
Open Keen ↗

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

CheckActionMet when
Owners and organisation administratorsposture.identity.adminsReported 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 keysposture.credentials.key_ageNo live user-managed service account key is older than KEEN_CLOUD_KEY_AGE_DAYS.
Service account key creation blockedposture.google_cloud.key_creationThe iam.disableServiceAccountKeyCreation constraint, or its managed form, is enforced without a condition.
Domain-restricted sharingposture.google_cloud.domain_sharingThe iam.allowedPolicyMemberDomains constraint, or its managed form, limits IAM members to listed customers or domains.
Public access preventionposture.storage.public_accessThe storage.publicAccessPrevention constraint is enforced.
Data Access audit logsposture.logging.audit_trailData Read and Data Write audit logs are on for all services.
SSH and RDP open to the internetposture.network.admin_portsNo 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 internetposture.network.databasesNo Cloud SQL instance with a public address authorises 0.0.0.0/0 or ::/0.
Security Command Center findingsposture.findingsSecurity 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

  1. 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.
  2. 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
RoleNeeded by
roles/cloudasset.viewerOwners and organisation administrators, Service account keys and both network checks
roles/iam.securityReviewerOwners and organisation administrators, and Data Access audit logs
roles/orgpolicy.policyViewerThe three organisation policy checks
roles/securitycenter.findingsViewerSecurity Command Center findings
roles/logging.viewerAdmin Activity
roles/serviceusage.serviceUsageConsumerCalling Cloud Asset Inventory from the service account's project, where the Cloud Asset API must be enabled

2. Configure Keen

SettingPurpose
KEEN_GOOGLE_CLOUD_ENABLEDTurns Google Cloud posture on.
KEEN_GOOGLE_CLOUD_ORGANIZATIONThe organisation's number, such as 123456789012.
KEEN_GOOGLE_CLOUD_PROJECTWithout an organisation, the project ID to read instead.
KEEN_GOOGLE_CLOUD_PROJECTSProject 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_KEYFILEThe 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.