Skip to main content

bunny.net CDN operations

v0.1.10

Governed bunny.net Pull Zone lifecycle, cache, hostname, access-control, statistics, request-log, origin-error, and billing-usage operations. Auth via BUNNY_API_KEY on the runner host.

12 allowed by default 16 need approval by default 2 denied by default
Pack ID
bunnycdn
Vendor
emisar
OS
linux
Actions
30
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
curl jq bash

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install bunnycdn --hash sha256:d0a0345b0fc58baf79586b01e3903a622e40e34b394d7c855bf2097353e3d1b9

Setup

Calls the bunny.net Core, CDN Logging v2, and Origin Errors APIs over HTTPS. BUNNY_API_KEY is sent in the AccessKey header over curl stdin and is never placed in argv or action output. Allowlist the variable in the runner's execution.inherit_env configuration.

Environment

Set these on the runner host, then add each name to execution.inherit_env so the value reaches the action.

  • BUNNY_API_KEY required

    bunny.net account API key. Use a scratch or least-privilege account and gate mutation actions with policy.

Notes

  • The account API key is at dash.bunny.net/account/settings → API.
  • Request logs are retained by bunny.net for three days; bunny.logs returns one bounded page and bunny.log_usage_summary aggregates one bounded page.
  • Pull Zone credentials, certificate material, log-forwarding tokens, request authorization headers, and URL query strings are removed before output leaves the runner.
  • The pack covers Bunny CDN Pull Zones. Bunny Storage, DNS, Stream, Shield/WAF, custom-certificate private keys, token-key reset, and arbitrary edge-rule documents are separate trust surfaces.

Verify it works

Runs bunny.list_pull_zones, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify bunnycdn

Install and configure a pack walks through the whole sequence on a host.

Actions 30 total

View on GitHub
  • bunny.add_allowed_referrer script high High — service-affecting

    Add allowed referrer

    Add a hostname to a Pull Zone's allowlist; once an allowlist is active, unmatched referrers can be denied and legitimate embeds may stop working.

    View source on GitHub
  • bunny.add_blocked_ip script high High — service-affecting

    Add blocked IP address

    Block one IPv4 or IPv6 address on a Pull Zone; requests from that address begin failing immediately.

    View source on GitHub
  • bunny.add_blocked_referrer script high High — service-affecting

    Add blocked referrer

    Block one referrer hostname on a Pull Zone; matching embedded requests begin failing immediately.

    View source on GitHub
  • bunny.add_hostname script high High — service-affecting

    Add Pull Zone hostname

    Add a custom hostname to a Pull Zone; traffic for a correctly pointed DNS name can begin reaching this zone before TLS is forced.

    View source on GitHub
  • bunny.billing_usage script low Low — read-only or trivially reversible

    Get CDN billing usage

    Get a safe account charge and bandwidth projection plus current per-Pull-Zone usage, without payment-method or billing-identity fields.

    View source on GitHub
  • bunny.create_pull_zone script high High — service-affecting

    Create Pull Zone

    Create a billed Bunny CDN Pull Zone pointing at one HTTPS origin; traffic served through it begins consuming account bandwidth and balance.

    View source on GitHub
  • bunny.delete_pull_zone script critical Critical — data loss or irreversible

    Delete Pull Zone

    Delete a Pull Zone permanently; every Bunny hostname and custom hostname on that zone stops serving immediately and the operation cannot be undone.

    View source on GitHub
  • bunny.get_pull_zone script low Low — read-only or trivially reversible

    Get Pull Zone

    Show one Pull Zone's configuration and current monthly usage without credential or certificate fields.

    View source on GitHub
  • bunny.list_pull_zones script low Low — read-only or trivially reversible

    List Pull Zones

    List one bounded page of Pull Zones accessible to the account API key.

    View source on GitHub
  • bunny.list_regions script low Low — read-only or trivially reversible

    List Bunny regions

    List bunny.net regions and codes used by Pull Zone delivery and Origin Shield settings.

    View source on GitHub
  • bunny.log_usage_summary script low Low — read-only or trivially reversible

    Summarize CDN log usage

    Summarize one bounded Logging API v2 page by sanitized path, cache status, status code, request count, and bytes sent. No client IP, user-agent, referrer, authorization header, or URL query string is returned.

    View source on GitHub
  • bunny.logs script medium Medium — changes state, easily reversible

    Fetch CDN request logs

    Fetch one bounded, filterable page from CDN Logging API v2. The result can contain client IP, user-agent, and referrer metadata, so policy should limit who may retrieve it; authorization fields and URL query strings are removed.

    View source on GitHub
  • bunny.optimizer_statistics script low Low — read-only or trivially reversible

    Get Optimizer statistics

    Get optimized request, traffic-saved, compression, and processing-time statistics for one Pull Zone.

    View source on GitHub
  • bunny.origin_errors script medium Medium — changes state, easily reversible

    Get origin error logs

    Get one day's failed-origin records for a Pull Zone. The result can contain origin request paths and failure detail, so policy should limit who may retrieve it; query strings and arbitrary embedded log fields are removed.

    View source on GitHub
  • bunny.origin_shield_statistics script low Low — read-only or trivially reversible

    Get Origin Shield queue statistics

    Get concurrent and queued Origin Shield request charts for one Pull Zone.

    View source on GitHub
  • bunny.purge_all_cache script critical Critical — data loss or irreversible

    Purge entire Pull Zone cache

    Purge the entire Pull Zone cache; every object becomes cold at once and a busy zone can overwhelm or sharply increase traffic to its origin.

    View source on GitHub
  • bunny.purge_tag script high High — service-affecting

    Purge cache tag

    Purge every cached object carrying one tag in a Pull Zone; all matched objects become misses and can create a concentrated origin-load spike.

    View source on GitHub
  • bunny.purge_url script high High — service-affecting

    Purge cached URL

    Purge one URL from Bunny's edge cache; the next request for each removed variant reaches the origin and can increase origin load.

    View source on GitHub
  • bunny.remove_allowed_referrer script high High — service-affecting

    Remove allowed referrer

    Remove a hostname from a Pull Zone's allowlist; clients referred by it can be denied immediately.

    View source on GitHub
  • bunny.remove_blocked_ip script high High — service-affecting

    Remove blocked IP address

    Remove one IPv4 or IPv6 address from a Pull Zone blocklist; requests from that address can resume consuming CDN bandwidth.

    View source on GitHub
  • bunny.remove_blocked_referrer script high High — service-affecting

    Remove blocked referrer

    Remove one referrer hostname from a Pull Zone blocklist; matching external embeds can resume consuming CDN bandwidth.

    View source on GitHub
  • bunny.remove_hostname script high High — service-affecting

    Remove Pull Zone hostname

    Remove a custom hostname from a Pull Zone; requests to that hostname stop being served by the zone immediately.

    View source on GitHub
  • bunny.safehop_statistics script low Low — read-only or trivially reversible

    Get SafeHop statistics

    Get retried and saved request statistics for Bunny SafeHop on one Pull Zone.

    View source on GitHub
  • bunny.set_cache_behavior script high High — service-affecting

    Change one Pull Zone cache behavior

    Enable or disable one declared cache behavior; the choice can change cache keys, freshness, origin load, or the traffic served while an origin is unhealthy.

    View source on GitHub
  • bunny.set_cache_ttl script high High — service-affecting

    Change Pull Zone cache TTLs

    Change edge or browser cache TTL overrides; shorter values increase origin traffic while longer values can keep stale content in circulation.

    View source on GitHub
  • bunny.set_force_ssl script high High — service-affecting

    Change hostname Force SSL

    Enable or disable HTTP-to-HTTPS enforcement for one Pull Zone hostname; disabling permits unencrypted client requests where Bunny accepts them.

    View source on GitHub
  • bunny.set_logging script medium Medium — changes state, easily reversible

    Change Pull Zone logging

    Enable or disable request logging with enforced IP anonymization; enabling stores request metadata for Bunny's retention window and disabling removes incident visibility.

    View source on GitHub
  • bunny.set_origin script high High — service-affecting

    Change Pull Zone origin

    Change where a Pull Zone fetches content; a wrong URL, host header, or TLS choice can redirect traffic, expose requests, or take the zone offline.

    View source on GitHub
  • bunny.set_origin_shield script high High — service-affecting

    Change Pull Zone Origin Shield

    Enable, disable, or relocate Origin Shield; this changes the origin request path, latency, and billable shield traffic for the Pull Zone.

    View source on GitHub
  • bunny.statistics script low Low — read-only or trivially reversible

    Get CDN statistics

    Get bandwidth, requests, cache hit rate, origin traffic, response-time, error, and geographic statistics for the account or one Pull Zone.

    View source on GitHub