{"data":{"slug":"github-google-skills-skills-cloud-google-cloud-filestore-auditing-3b3c32a2b0f5","title":"Filestore Disaster Recovery & Security Audit","summary":"Audit Google Cloud Filestore instances for disaster recovery readiness, security access governance, and reliability compliance, including NFS export permissions, unprotected file shares, and PZI\/PZS compliance.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-google-cloud-filestore-auditing-3b3c32a2b0f5","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-google-cloud-filestore-auditing-3b3c32a2b0f5","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-google-cloud-filestore-auditing-3b3c32a2b0f5.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-google-cloud-filestore-auditing-3b3c32a2b0f5\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any commands, ensure the runtime principal has the required IAM roles (`roles\/file.viewer` for audit operations, `roles\/file.editor` or `roles\/file.admin` for remediation), and that the target GCP project has an active billing account. Explicit user confirmation is required before creating backups to avoid unintended operational disruption.","instructions":"---\nname: google-cloud-filestore-auditing\nmetadata:\n  version: \"1.0.3\"\n  category: Storage\ndescription: >-\n  Audits Filestore instances on Google Cloud across projects for disaster\n  recovery readiness (missing or stale backups), security access governance\n  (overly permissive NFS export rules, 0.0.0.0\/0 exposure, missing ROOT_SQUASH),\n  and reliability compliance (Physical Zone Isolation PZI and Physical Zone\n  Separation PZS). Use when assessing storage health posture, auditing NFS\n  export permissions, identifying unprotected file shares, or validating zone\n  failure domains. Don't use for Cloud Storage buckets, Persistent Disk, or\n  NetApp Volumes.\n---\n\n# Filestore Auditing Skill\n\nThis skill enables autonomous agents to audit, evaluate, and report the disaster\nrecovery, security access governance, and architectural reliability posture of\nFilestore fleets across Google Cloud projects.\n\n## Prerequisites \/ IAM Requirements & Permissions\n\nBefore executing this skill, the runtime principal (user account or Service\nAccount) must possess the following IAM roles and granular permissions on the\ntarget GCP project(s):\n\n### 1. Audit Operations (Read-Only Assessment)\n\nRequires the **`roles\/file.viewer`** role, which provides:\n\n-   **`file.instances.list`**: Enumerate Filestore instances across project\n    locations.\n-   **`file.instances.get`**: Inspect instance configuration, NFS export rules,\n    IP ranges, squash mode, and PZI\/PZS isolation status.\n-   **`file.backups.list`**: Enumerate existing backups across regions.\n-   **`file.backups.get`**: Inspect backup timestamps, source instance URIs, and\n    status.\n\n### 2. Remediation Operations (Backup Creation)\n\nRequires the **`roles\/file.editor`** (or `roles\/file.admin`) role, which\nprovides:\n\n-   **`file.backups.create`**: Create on-demand baseline backups for unprotected\n    instances.\n-   **`file.operations.get`**: Monitor long-running backup creation operations.\n\n### 3. MCP Tool Invocation\n\nIf invoking capabilities via the Filestore MCP Server\n(`file.googleapis.com\/mcp`):\n\n-   **`roles\/mcp.toolUser`**: Required to execute MCP tools (`list_instances`,\n    `get_instance`, `list_backups`, `get_backup`, `create_backup`).\n\n### 4. Cloud Authentication Setup\n\nAuthenticate the runtime environment using the appropriate method for your execution context:\n\n-   **CLI Execution (`gcloud`)**:\n    ```bash\n    gcloud auth login\n    ```\n-   **Application SDKs & Scripts**:\n    ```bash\n    gcloud auth application-default login\n    ```\n-   **Automated Services & Service Accounts**:\n    ```bash\n    export GOOGLE_APPLICATION_CREDENTIALS=\"\/path\/to\/service-account-key.json\"\n    ```\n\n### 5. Billing Account Attachment\n\n-   **Active Billing Required**: The target GCP project must have an active Cloud Billing account attached. Filestore instances and backup operations require active billing. Verify billing status with:\n    ```bash\n    gcloud beta billing projects describe {project_id}\n    ```\n\n## Quick Start\n\n1.  Ensure `gcloud` is installed. See\n    [gcloud installation guide](https:\/\/docs.cloud.google.com\/sdk\/docs\/install-sdk.md.txt) if\n    needed.\n2.  Authenticate your environment:\n\n    ```bash\n    gcloud auth login\n    gcloud auth application-default login\n    ```\n3.  Set the target project context and verify an active billing account is attached:\n\n    ```bash\n    gcloud config set project {project_id}\n    gcloud beta billing projects describe {project_id}\n    ```\n4.  Configure a well-supported default region (e.g., `us-central1`). See official\n    [region availability documentation](https:\/\/cloud.google.com\/about\/locations):\n\n    ```bash\n    gcloud config set compute\/region us-central1\n    ```\n5.  Verify required service APIs are enabled:\n\n    ```bash\n    gcloud services enable file.googleapis.com --quiet\n    ```\n6.  Run fleet discovery and backup inventory (see \"Discovery & Read Operations\"\n    below).\n7.  Evaluate findings against the audit rules matrix and render the executive\n    scorecard and inventory table.\n8.  If unprotected instances are identified, present baseline backup creation\n    commands and prompt the user for confirmation.\n\n## Usage Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read and follow the instructions in\n[Usage Attribution](references\/attribution.md).\n\n## Conceptual & Informational Queries (CRITICAL)\n\nFor purely conceptual, educational, or architectural questions (e.g., *\"What is\nPhysical Zone Isolation (PZI) in Filestore?\"*, *\"What is the difference between\nPZI and PZS?\"*, *\"Why is NO_ROOT_SQUASH dangerous?\"*, *\"Explain Filestore backup\narchitecture\"*):\n\n-   **Rule**: Answer immediately in a single turn using pre-trained knowledge\n    and the definitions in this `SKILL.md` file:\n    -   **Physical Zone Isolation (`PZI` \/ `satisfiesPzi`)**: Ensures a zonal\n        resource's physical hardware is confined to an isolated physical failure\n        domain within a datacenter so localized hardware failures do not cross\n        zones.\n    -   **Physical Zone Separation (`PZS` \/ `satisfiesPzs`)**: Ensures\n        multi-zone or regional primary and replica nodes are hosted in\n        physically distinct, independent datacenter facilities so a\n        facility-wide outage cannot affect both copies.\n-   **Constraint**: **Do NOT call ANY tools whatsoever** (do NOT call\n    `read_file` on `references\/`, `run_command`, MCP tools, or API requests) for\n    purely conceptual questions\u2014respond directly right away.\n\n## Handling \"No-Command\" Constraints & Evaluations (CRITICAL)\n\nIf the user prompt contains constraints like *\"Do not execute commands\"*,\n*\"without executing\"*, or *\"read-only\"*:\n\n-   **Rule**: **Strictly avoid calling the `run_command` tool** to execute any\n    shell, python, or `gcloud` commands.\n-   **Discovery Hierarchy**:\n    1.  Always read [Usage Attribution](references\/attribution.md) whenever\n        outputting or recommending `gcloud` commands (such as backup creation\n        or export remediation commands) so they include the required attribution\n        prefix.\n    2.  Check if Filestore MCP tools (`list_instances`, `list_backups`) are\n        available and query them directly (these are API invocations, not shell\n        command executions).\n    3.  If MCP tools are not present or cannot connect, search local reference\n        markdown files (specifically the mock fleet definitions in\n        `references\/zone-isolation-pzi-pzs.md`) for any mock instances or\n        project details matching the request. (Do NOT attempt to read evaluation\n        config files such as `EVAL.yaml` or `EVAL.txtpb` during evaluation runs\n        as access is restricted and triggers anti-cheating timeouts).\n    4.  If no data is available in context or mock references, explain the audit\n        evaluation formulas and provide the attributed `gcloud` commands for\n        manual terminal execution.\n-   **Mandatory User Confirmation Requirement**: Even when the user prompt asks\n    not to execute commands or asks only for audit recommendations, any response\n    recommending backup remediation MUST STILL end with a clear confirmation\n    prompt before execution (e.g., *\"Would you like me to proceed with creating\n    baseline backups for the unprotected instances? Please confirm to\n    proceed.\"*).\n\n--------------------------------------------------------------------------------\n\n## Core Operational Workflow\n\n### 1. Discovery & Read Operations\n\nThe agent must discover all Filestore instances and backups in the target\nproject.\n\n-   **Target Project ID Handling & Rationale**: If the target Project ID is not\n    specified in the user prompt, the agent MUST explicitly ask the user to\n    provide the project ID before proceeding, in order to avoid inspecting or\n    auditing unrelated projects in multi-project enterprise environments.\n\nChoose the discovery method matching your runtime environment:\n\n#### Option A: Filestore MCP Tools (Recommended when MCP is mounted)\n\n1.  **Instances Discovery**: Call\n    `list_instances(parent=\"projects\/{project_id}\/locations\/-\")`.\n2.  **Backups Discovery**: Call\n    `list_backups(parent=\"projects\/{project_id}\/locations\/-\")`.\n\n#### Option B: `gcloud` CLI (Terminal \/ Coding Harnesses)\n\n1.  **Instances Discovery**:\n\n    ```bash\n    gcloud filestore instances list --project=\"{project_id}\" --format=\"json\"\n    ```\n2.  **Backups Discovery**:\n\n    ```bash\n    gcloud filestore backups list --project=\"{project_id}\" --format=\"json\"\n    ```\n\n    *(Note: Do NOT pass `--location=-` to `gcloud filestore backups list`;\n    omitting the flag queries all regions across the project automatically).*\n\n#### Option C: GCP REST API (`call_gcp_api` in Gemini Enterprise File Agent \/ curl)\n\n1.  **Instances**: `GET\n    https:\/\/file.googleapis.com\/v1\/projects\/{project_id}\/locations\/-\/instances`\n2.  **Backups**: `GET\n    https:\/\/file.googleapis.com\/v1\/projects\/{project_id}\/locations\/-\/backups`\n\n#### Option D: Standalone Script Runner\n\nFor environments with standard python3 execution enabled, the agent may invoke\nthe portable script: `python3 scripts\/filestore_audit.py\n--project=\"{project_id}\" [--format=markdown|json]`\n\n--------------------------------------------------------------------------------\n\n### 2. Audit Evaluation & Vector Checks\n\nFor each discovered instance, evaluate three audit vectors:\n\n#### Vector 1: Disaster Recovery & Backup Protection\n\n-   Match backups to instances using full canonical resource URIs\n    (`backup.sourceInstance == instance.name`).\n-   **Unprotected Instance**: If `backup_count == 0`, assign **`HIGH`** severity\n    finding: *\"Instance has 0 backups on file share '{share_name}'. Disaster\n    recovery is not configured.\"*\n-   **Stale Backup**: If latest backup is older than SLA (default: 7 days),\n    assign **`MEDIUM`** severity finding: *\"Latest backup is {days} days old\n    (exceeds SLA threshold of 7 days).\"*\n-   Refer to `references\/backup-dr-governance.md` for backup retention and SLA\n    rules.\n\n#### Vector 2: Security & Access Governance\n\n-   Inspect `fileShares[0].nfsExportOptions`:\n    -   **Open Network Exposure**: If `0.0.0.0\/0`, `0.0.0.0`, or `::\/0` is\n        present in `ipRanges`, assign **`CRITICAL`** severity (if `accessMode:\n        READ_WRITE`) or **`HIGH`** severity (if `READ_ONLY`): *\"Export rule\n        exposes share to 0.0.0.0\/0 with accessMode='{access_mode}'.\"*\n    -   **Missing Root Squashing**: If `squashMode: NO_ROOT_SQUASH`, assign\n        **`CRITICAL`** severity (if world-exposed) or **`HIGH`** severity (for\n        internal subnets): *\"Export rule has squashMode='NO_ROOT_SQUASH'. Remote\n        root clients retain superuser UID 0 privileges.\"*\n    -   **Default Open VPC Export**: If `nfsExportOptions` is empty, assign\n        **`MEDIUM`** severity: *\"No explicit NFS export options configured.\n        Share defaults to open client access within VPC with NO_ROOT_SQUASH.\"*\n-   Refer to `references\/security-access-governance.md` for export option\n    configurations.\n\n#### Vector 3: Zone Isolation & Reliability Compliance\n\n-   **Physical Zone Isolation (PZI)**: If `satisfiesPzi: false`, assign\n    **`MEDIUM`** severity: *\"Instance does not satisfy Physical Zone Isolation\n    (PZI).\"*\n-   **Physical Zone Separation (PZS)**: If tier is `REGIONAL` or `ENTERPRISE`\n    and `satisfiesPzs: false`, assign **`HIGH`** severity: *\"Enterprise\/Regional\n    tier instance does not satisfy Physical Zone Separation (PZS).\"*\n-   **Performance Limits**: Extract `performanceLimits.maxWriteIops` and\n    `performanceLimits.maxReadThroughputBps` (convert to MB\/s).\n-   Refer to `references\/zone-isolation-pzi-pzs.md` for datacenter failure\n    domain isolation standards.\n\n--------------------------------------------------------------------------------\n\n### 3. Executive Posture Scoring & Grading\n\nCalculate fleet posture grade as defined in `references\/audit-rules-matrix.md`:\n\n-   **Grade F (\ud83d\udd34 CRITICAL RISK)**: $\\ge 1$ `CRITICAL` findings.\n-   **Grade C (\ud83d\udfe0 ELEVATED RISK)**: 0 Critical, but $\\ge 1$ `HIGH` findings.\n-   **Grade B (\ud83d\udfe1 MODERATE)**: 0 Critical\/High, but $\\ge 1$ `MEDIUM` findings.\n-   **Grade A (\ud83d\udfe2 HEALTHY)**: 0 findings across all vectors.\n\nCalculate `Backup Protection Rate %`: $$\\text{Protection Rate} =\n\\frac{\\text{Total Instances} - \\text{Unprotected Instances}}{\\text{Total\nInstances}} \\times 100$$\n\n--------------------------------------------------------------------------------\n\n### 4. Required Output Format\n\n**Every audit report response MUST include the following structured sections in\nMarkdown:**\n\n#### 1. Executive Posture Scorecard\n\n```markdown\n## Executive Posture Scorecard: `{project_id}`\n\n| Metric | Status | Details |\n| :--- | :--- | :--- |\n| **Overall Health Posture** | **[\ud83d\udd34 CRITICAL RISK \/ \ud83d\udfe0 ELEVATED RISK \/ \ud83d\udfe1 MODERATE \/ \ud83d\udfe2 HEALTHY]** | [Grade F \/ C \/ B \/ A] |\n| **Instances Audited** | `[count]` | Total Filestore instances evaluated |\n| **Backup Protection Rate** | **[pct]%** | `[protected]\/[total]` instances have active backups |\n| **Critical & High Security Findings** | `[crit] Critical, [high] High` | Open exports (0.0.0.0\/0) or NO_ROOT_SQUASH |\n| **PZI Isolation Compliance** | `[pzi_count]\/[total]` | Physical Zone Isolation adherence |\n```\n\n#### 2. Priority Findings & Remediation Matrix\n\nList findings ranked by severity (`CRITICAL` $\\to$ `HIGH` $\\to$ `MEDIUM` $\\to$\n`LOW`):\n\n```markdown\n## Priority Findings & Remediation Matrix\n\n| Severity | Instance ID | Category | Finding Description | Remediation Plan |\n| :--- | :--- | :--- | :--- | :--- |\n| \ud83d\udea8 **CRITICAL** | `[instance]` | Security | [Description] | [Remediation] |\n| \u26a0\ufe0f **HIGH** | `[instance]` | Disaster Recovery | [Description] | [Remediation] |\n```\n\n#### 3. Filestore Instance Inventory & Compliance Status\n\n```markdown\n## Filestore Instance Inventory & Compliance Status\n\n| Instance ID | Location | Tier | Capacity | Reserved CIDR | Write IOPS | Throughput | PZI | PZS | Backups | Latest Backup |\n| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |\n| `[id]` | `[loc]` | `[tier]` | `[cap] GiB` | `[cidr]` | `[iops]` | `[tp] MB\/s` | \u2705 Yes \/ \u274c No | \u2705 Yes \/ \u274c No \/ N\/A | \ud83d\udd34 0 \/ \u2705 `[n]` | `[date]` |\n```\n\n#### 4. Automated Remediation & Mandatory Confirmation Gate\n\nIf any unprotected instances are discovered, display attributed backup creation\ncommands and conclude with an explicit confirmation request:\n\n```bash\ngcloud filestore backups create [INSTANCE]-backup-[DATE] \\\n    --project=[PROJECT_ID] \\\n    --instance=[INSTANCE] \\\n    --file-share=[SHARE] \\\n    [--instance-zone=[ZONE] | --instance-location=[REGION]] \\\n    --region=[BACKUP_REGION]\n```\n\n> **Confirmation Required**: Would you like me to proceed with creating baseline\n> backups for the unprotected instances? Please confirm to proceed.\n\n**CRITICAL RATIONALE**: Do NOT execute backup creation without explicit user\nconfirmation. Confirmation is strictly required before executing any mutation or\nbackup creation commands in order to prevent unintended operational disruption,\nunwanted resource allocation, or unexpected backup storage billing.\n\n--------------------------------------------------------------------------------\n\n## Reference Directory\n\nFor progressive disclosure and deep architectural guidance, consult the\nfollowing references:\n\n-   [Usage Attribution](references\/attribution.md)\n-   [Security & Access Governance](references\/security-access-governance.md)\n-   [Disaster Recovery & Backup Governance](references\/backup-dr-governance.md)\n-   [Zone Isolation (PZI) & Reliability (PZS)](references\/zone-isolation-pzi-pzs.md)\n-   [Audit Rules & Scoring Matrix](references\/audit-rules-matrix.md)\n-   [Standalone Python Audit Script](scripts\/filestore_audit.py)\n","use_cases":["Assessing storage health posture across multiple projects","Auditing NFS export permissions for security access governance","Identifying unprotected file shares and recommending baseline backups","Validating Physical Zone Isolation (PZI) and Physical Zone Separation (PZS) compliance"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/google-cloud-filestore-auditing\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T17:08:08.000000Z","updated_at":"2026-11-17T15:28:10.000000Z","seo_title":"Filestore Disaster Recovery Audit Tool","seo_description":"Audit Google Cloud Filestore instances for disaster recovery, security, and reliability compliance with detailed findings and remediation guidance.","seo_keywords":["Filestore audit tool","Google Cloud Filestore security audit","Filestore disaster recovery check","NFS export permissions audit","Filestore PZI compliance check","Filestore backup readiness audit"]}}