PluginBench
Skill
Pass
Audit score 90

workload-manager-basics

google/skills

Manage Google Cloud Workload Manager evaluations, rules, and validation results via client libraries and REST API.

What is workload-manager-basics?

Use this skill to automate Workload Manager evaluations against Google Cloud best practices, SAP, SQL Server, or custom organizational rules. It provides access to public client libraries and REST APIs for inspecting rules, creating evaluations, running scans, reviewing violations, and exporting results to BigQuery.

  • List and inspect built-in and custom Workload Manager rules
  • Create and update evaluations scoped to projects, folders, or organizations
  • Run evaluations and retrieve validation results and scanned resources
  • Review compliance violations and remediation guidance
  • Export evaluation findings to BigQuery for analysis
  • Automate Workload Manager workflows via Python and Go client libraries

How to install workload-manager-basics

npx skills add https://github.com/google/skills --skill workload-manager-basics
Prerequisites
  • Enable the Workload Manager API: gcloud services enable workloadmanager.googleapis.com
  • Authenticate with Application Default Credentials: gcloud auth application-default login
  • Grant appropriate IAM roles (roles/workloadmanager.viewer for read-only; roles/workloadmanager.evaluationAdmin or roles/workloadmanager.admin for evaluation management)
  • Install the Python or Go client library (e.g., pip install google-cloud-workloadmanager)
Claude Code
Cursor
Windsurf
Cline

How to use workload-manager-basics

  1. 1.Enable the Workload Manager API and authenticate with gcloud auth application-default login
  2. 2.Install the google-cloud-workloadmanager client library for your language (Python or Go)
  3. 3.List available rules using client.list_rules() to understand built-in and custom rule options
  4. 4.Create an evaluation by specifying a resource scope (project, folder, or organization) and selecting rules
  5. 5.Run the evaluation using client.run_evaluation() and wait for completion
  6. 6.Inspect evaluation results and scanned resources to identify violations and remediation steps
  7. 7.Optionally export findings to BigQuery for further analysis and reporting

Use cases

Good for
  • Validate enterprise workloads against Google Cloud best practices at scale
  • Audit SAP or SQL Server deployments for compliance and configuration issues
  • Create custom organizational rules using Rego and run evaluations across multiple projects
  • Integrate Workload Manager findings into CI/CD pipelines or compliance dashboards
  • Export and analyze evaluation results in BigQuery for trend analysis and reporting
Who it's for
  • Cloud architects and compliance engineers
  • DevOps and SRE teams managing multi-project Google Cloud environments
  • Security and governance teams automating workload validation
  • Organizations with custom compliance or best-practice rules

workload-manager-basics FAQ

Is there a gcloud CLI command for Workload Manager?

No. There is no public gcloud workload-manager command group. Use gcloud only for authentication, IAM role assignment, and API enablement. Interact with Workload Manager using the official google-cloud-workloadmanager client library or the public REST API.

What workload types does Workload Manager support?

Workload Manager supports evaluations for Google Cloud general best practices, SAP, SQL Server, and custom organizational rules defined in Rego.

Can I use Workload Manager for general Compute Engine or VPC management?

No. Workload Manager is designed for validating enterprise workloads against best practices and compliance rules. Use it for evaluation and compliance checks, not for general infrastructure management.

How do I handle authentication failures in sandboxed environments?

If gcloud authentication or API calls fail due to Context Aware Access blocks or missing API enablement, fall back to presenting example code and static findings. Clearly explain the limitation and provide correct client library code structure or REST API payload examples.

Can I export Workload Manager results to BigQuery?

Yes. Workload Manager supports optional BigQuery export of evaluation findings for analysis, trend tracking, and compliance reporting.

Full instructions (SKILL.md)

Source of truth, from google/skills.


name: workload-manager-basics metadata: version: "1.0.0" category: CloudObservabilityAndMonitoring description: >- Use this skill to manage Google Cloud Workload Manager evaluations, rules, scanned resources, and validation results by using public client libraries and the REST API. Use when you need to inspect workload best-practice rules, create and run evaluations for Google Cloud general best practices, SAP, SQL Server, or custom organizational rules, review violations, export results to BigQuery, or automate Workload Manager through client libraries because no service-specific public CLI or MCP server is available. Don't use for general Google Compute Engine instance management, VPC configuration, or standard IAM auditing.

Workload Manager Basics

Workload Manager validates enterprise workloads against Google Cloud best practices and recommendations. The public client libraries are centered on evaluations: define a resource scope, choose built-in or custom rules, run an evaluation, then inspect results and scanned resources.

Use This Flow

flowchart LR
    Rules["List rules"] --> Eval["Create or update evaluation"]
    Resources["Project, folder, or org scope"] --> Eval
    Eval --> Run["Run evaluation"]
    Run --> Results["Inspect evaluation results"]
    Results --> Remediate["Remediate findings"]
    Results --> Export["Optional BigQuery export"]

Core API Constraints

To ensure compatibility, security, and successful integration:

  • Public Surface Only: You MUST strictly interact with Workload Manager using the official public google-cloud-workloadmanager client library or the public REST API (workloadmanager.googleapis.com/v1).
  • No Internal or Undocumented APIs: Do NOT attempt to use internal RPC protocols, private service backends, or undocumented discovery mechanisms. They are not supported for public integrations and will fail.
  • No Service-Specific CLI: There is no public gcloud workload-manager CLI command group. Use gcloud only for authentication, IAM role assignment, and fetching raw REST tokens.
  • Sandbox Execution Robustness (Auth/Mock Fallbacks): When gcloud authentication or Workload Manager API calls fail in sandboxed or restricted environments (e.g., due to Context Aware Access token blocks, missing API enablement, or mock resources returning 404/403), immediately fall back to presenting example code and static findings from your references instead of entering retry loops. Present the correct client library code structure or REST API payload example, clearly explain the auth or resource limitation, and list typical rules or mock findings statically to satisfy the request.

Prerequisites

  1. Enable the Workload Manager API:

    gcloud services enable workloadmanager.googleapis.com --quiet
    
  2. Authenticate locally using Application Default Credentials (ADC) before using client libraries:

    gcloud auth application-default login
    
  3. Ensure the Workload Manager service agent has the required roles granted in your project (mandatory for API/client library usage, see IAM & Security).

  4. Grant the least-privileged role needed for the task. Start with roles/workloadmanager.viewer for read-only access to evaluation resources and use roles/workloadmanager.evaluationAdmin or roles/workloadmanager.admin only when creating, updating, running, or deleting evaluations.

Quick Client Library Example

Use the Python client library for the first working automation path:

python3 -m pip install --upgrade google-cloud-workloadmanager
from google.cloud import workloadmanager_v1

project_id = "PROJECT_ID"
location = "LOCATION"
parent = f"projects/{project_id}/locations/{location}"

client = workloadmanager_v1.WorkloadManagerClient()

rules = client.list_rules(
    request=workloadmanager_v1.ListRulesRequest(
        parent=parent,
        evaluation_type=workloadmanager_v1.Evaluation.EvaluationType.OTHER,
    )
)

for rule in rules.rules:
    print(rule.name, rule.display_name, rule.severity)

Reference Directory

  • Core Concepts: Evaluations, rules, results, scanned resources, supported workload types, and API shape.

  • General Best Practices: Google Cloud general best-practice posture checks, OTHER evaluation guidance, custom Rego rules, and scale/automation patterns.

  • Client Libraries: Python and Go client library examples for listing rules, creating evaluations, running evaluations, and reading findings.

  • REST Usage: Direct REST examples for the public Workload Manager API and operations polling.

  • Public CLI Status: No documented service-specific gcloud workload-manager command group; use gcloud only for auth, IAM, API enablement, and REST tokens.

  • Public MCP Status: No documented public Workload Manager MCP server; use client libraries or REST API instead.

  • Setup Prerequisites: Terraform examples only for adjacent prerequisites such as API enablement, IAM, BigQuery export datasets, and KMS keys. This is not Workload Manager resource management.

  • IAM & Security: Workload Manager roles, least-privilege guidance, service agents, data handling, and CMEK notes.

If product behavior or API fields are not covered here, check the current Workload Manager product documentation and client library reference before implementing.

Authoritative References

Additional Context