Audits Filestore instances on Google Cloud across projects for disaster recovery readiness (missing or stale backups), security access governance (overly permissive NFS export rules, 0.0.0.0/0 exposure, missing ROOT_SQUASH), and reliability compliance (Physical Zone Isolation PZI and Physical Zone Separation PZS). Use when assessing storage health posture, auditing NFS export permissions, identifying unprotected file shares, or validating zone failure domains. Don't use for Cloud Storage buckets, Persistent Disk, or NetApp Volumes.
Written by Google and published in google/skills under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.
This skill enables autonomous agents to audit, evaluate, and report the disaster recovery, security access governance, and architectural reliability posture of Filestore fleets across Google Cloud projects.
Before executing this skill, the runtime principal (user account or Service Account) must possess the following IAM roles and granular permissions on the target GCP project(s):
Requires the roles/file.viewer role, which provides:
file.instances.list: Enumerate Filestore instances across project
locations.file.instances.get: Inspect instance configuration, NFS export rules,
IP ranges, squash mode, and PZI/PZS isolation status.file.backups.list: Enumerate existing backups across regions.file.backups.get: Inspect backup timestamps, source instance URIs, and
status.Requires the roles/file.editor (or roles/file.admin) role, which
provides:
file.backups.create: Create on-demand baseline backups for unprotected
instances.file.operations.get: Monitor long-running backup creation operations.If invoking capabilities via the Filestore MCP Server
(file.googleapis.com/mcp):
roles/mcp.toolUser: Required to execute MCP tools (list_instances,
get_instance, list_backups, get_backup, create_backup).Authenticate the runtime environment using the appropriate method for your execution context:
gcloud):
gcloud auth login
gcloud auth application-default login
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
gcloud beta billing projects describe {project_id}
Ensure gcloud is installed. See
gcloud installation guide if
needed.
Authenticate your environment:
gcloud auth login
gcloud auth application-default login
Set the target project context and verify an active billing account is attached:
gcloud config set project {project_id}
gcloud beta billing projects describe {project_id}
Configure a well-supported default region (e.g., us-central1). See official
region availability documentation:
gcloud config set compute/region us-central1
Verify required service APIs are enabled:
gcloud services enable file.googleapis.com --quiet
Run fleet discovery and backup inventory (see "Discovery & Read Operations" below).
Evaluate findings against the audit rules matrix and render the executive scorecard and inventory table.
If unprotected instances are identified, present baseline backup creation commands and prompt the user for confirmation.
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
For purely conceptual, educational, or architectural questions (e.g., "What is Physical Zone Isolation (PZI) in Filestore?", "What is the difference between PZI and PZS?", "Why is NO_ROOT_SQUASH dangerous?", "Explain Filestore backup architecture"):
SKILL.md file:
PZI / satisfiesPzi): Ensures a zonal
resource's physical hardware is confined to an isolated physical failure
domain within a datacenter so localized hardware failures do not cross
zones.PZS / satisfiesPzs): Ensures
multi-zone or regional primary and replica nodes are hosted in
physically distinct, independent datacenter facilities so a
facility-wide outage cannot affect both copies.read_file on references/, run_command, MCP tools, or API requests) for
purely conceptual questions—respond directly right away.If the user prompt contains constraints like "Do not execute commands", "without executing", or "read-only":
run_command tool to execute any
shell, python, or gcloud commands.gcloud commands (such as backup creation
or export remediation commands) so they include the required attribution
prefix.list_instances, list_backups) are
available and query them directly (these are API invocations, not shell
command executions).references/zone-isolation-pzi-pzs.md) for any mock instances or
project details matching the request. (Do NOT attempt to read evaluation
config files such as EVAL.yaml or EVAL.txtpb during evaluation runs
as access is restricted and triggers anti-cheating timeouts).gcloud commands for
manual terminal execution.The agent must discover all Filestore instances and backups in the target project.
Choose the discovery method matching your runtime environment:
list_instances(parent="projects/{project_id}/locations/-").list_backups(parent="projects/{project_id}/locations/-").gcloud CLI (Terminal / Coding Harnesses)Instances Discovery:
gcloud filestore instances list --project="{project_id}" --format="json"
Backups Discovery:
gcloud filestore backups list --project="{project_id}" --format="json"
(Note: Do NOT pass --location=- to gcloud filestore backups list;
omitting the flag queries all regions across the project automatically).
call_gcp_api in Gemini Enterprise File Agent / curl)GET https://file.googleapis.com/v1/projects/{project_id}/locations/-/instancesGET https://file.googleapis.com/v1/projects/{project_id}/locations/-/backupsFor environments with standard python3 execution enabled, the agent may invoke
the portable script: python3 scripts/filestore_audit.py --project="{project_id}" [--format=markdown|json]
For each discovered instance, evaluate three audit vectors:
backup.sourceInstance == instance.name).backup_count == 0, assign HIGH severity
finding: "Instance has 0 backups on file share '{share_name}'. Disaster
recovery is not configured."MEDIUM severity finding: "Latest backup is {days} days old
(exceeds SLA threshold of 7 days)."references/backup-dr-governance.md for backup retention and SLA
rules.fileShares[0].nfsExportOptions:
0.0.0.0/0, 0.0.0.0, or ::/0 is
present in ipRanges, assign CRITICAL severity (if accessMode: READ_WRITE) or HIGH severity (if READ_ONLY): "Export rule
exposes share to 0.0.0.0/0 with accessMode='{access_mode}'."squashMode: NO_ROOT_SQUASH, assign
CRITICAL severity (if world-exposed) or HIGH severity (for
internal subnets): "Export rule has squashMode='NO_ROOT_SQUASH'. Remote
root clients retain superuser UID 0 privileges."nfsExportOptions is empty, assign
MEDIUM severity: "No explicit NFS export options configured.
Share defaults to open client access within VPC with NO_ROOT_SQUASH."references/security-access-governance.md for export option
configurations.satisfiesPzi: false, assign
MEDIUM severity: "Instance does not satisfy Physical Zone Isolation
(PZI)."REGIONAL or ENTERPRISE
and satisfiesPzs: false, assign HIGH severity: "Enterprise/Regional
tier instance does not satisfy Physical Zone Separation (PZS)."performanceLimits.maxWriteIops and
performanceLimits.maxReadThroughputBps (convert to MB/s).references/zone-isolation-pzi-pzs.md for datacenter failure
domain isolation standards.Calculate fleet posture grade as defined in references/audit-rules-matrix.md:
CRITICAL findings.HIGH findings.MEDIUM findings.Calculate Backup Protection Rate %: $$\text{Protection Rate} =
\frac{\text{Total Instances} - \text{Unprotected Instances}}{\text{Total
Instances}} \times 100$$
Every audit report response MUST include the following structured sections in Markdown:
## Executive Posture Scorecard: `{project_id}`
| Metric | Status | Details |
| :--- | :--- | :--- |
| **Overall Health Posture** | **[🔴 CRITICAL RISK / 🟠 ELEVATED RISK / 🟡 MODERATE / 🟢 HEALTHY]** | [Grade F / C / B / A] |
| **Instances Audited** | `[count]` | Total Filestore instances evaluated |
| **Backup Protection Rate** | **[pct]%** | `[protected]/[total]` instances have active backups |
| **Critical & High Security Findings** | `[crit] Critical, [high] High` | Open exports (0.0.0.0/0) or NO_ROOT_SQUASH |
| **PZI Isolation Compliance** | `[pzi_count]/[total]` | Physical Zone Isolation adherence |
List findings ranked by severity (CRITICAL $\to$ HIGH $\to$ MEDIUM $\to$
LOW):
## Priority Findings & Remediation Matrix
| Severity | Instance ID | Category | Finding Description | Remediation Plan |
| :--- | :--- | :--- | :--- | :--- |
| 🚨 **CRITICAL** | `[instance]` | Security | [Description] | [Remediation] |
| ⚠️ **HIGH** | `[instance]` | Disaster Recovery | [Description] | [Remediation] |
## Filestore Instance Inventory & Compliance Status
| Instance ID | Location | Tier | Capacity | Reserved CIDR | Write IOPS | Throughput | PZI | PZS | Backups | Latest Backup |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| `[id]` | `[loc]` | `[tier]` | `[cap] GiB` | `[cidr]` | `[iops]` | `[tp] MB/s` | ✅ Yes / ❌ No | ✅ Yes / ❌ No / N/A | 🔴 0 / ✅ `[n]` | `[date]` |
If any unprotected instances are discovered, display attributed backup creation commands and conclude with an explicit confirmation request:
gcloud filestore backups create [INSTANCE]-backup-[DATE] \
--project=[PROJECT_ID] \
--instance=[INSTANCE] \
--file-share=[SHARE] \
[--instance-zone=[ZONE] | --instance-location=[REGION]] \
--region=[BACKUP_REGION]
Confirmation Required: Would you like me to proceed with creating baseline backups for the unprotected instances? Please confirm to proceed.
CRITICAL RATIONALE: Do NOT execute backup creation without explicit user confirmation. Confirmation is strictly required before executing any mutation or backup creation commands in order to prevent unintended operational disruption, unwanted resource allocation, or unexpected backup storage billing.
For progressive disclosure and deep architectural guidance, consult the following references:
Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /google-cloud-filestore-auditing in Claude Code or $google-cloud-filestore-auditing in Codex.
The description says when to use it:
Use when assessing storage health posture, auditing NFS export permissions, identifying unprotected file shares, or validating zone failure domains.
Copy the google-cloud-filestore-auditing folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .claude/skills
cp -r /tmp/google-skills/skills/cloud/google-cloud-filestore-auditing .claude/skills/
Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if google-cloud-filestore-auditing does not appear.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .agents/skills
cp -r /tmp/google-skills/skills/cloud/google-cloud-filestore-auditing .agents/skills/
Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for google-cloud-filestore-auditing and choose Install….
Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.
google-cloud-filestore-auditing ships 7 files, 69.9 KB in total. Select a file to load it from GitHub.