---
title: "Update Firewall Rules (Trusted Sources) for a Database"
method: PUT
path: "/v2/databases/{database_cluster_uuid}/firewall"
tags: ["DigitalOcean-public.v2-new_Databases"]
---

# Update Firewall Rules (Trusted Sources) for a Database

`PUT /v2/databases/{database_cluster_uuid}/firewall`

To update a database cluster's firewall rules (known as "trusted sources" in the control panel), send a PUT request to `/v2/databases/$DATABASE_ID/firewall` specifying which resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 rules (or trusted sources). When possible, we recommend [placing your databases into a VPC network](https://docs.digitalocean.com/products/networking/vpc/) to limit access to them instead of using a firewall.
A successful

## Path parameters

- `database_cluster_uuid` string, uuid, required

## Request body

- object
  - `rules` FirewallRule[]
    - `uuid` string — A unique ID for the firewall rule itself.
    - `cluster_uuid` string — A unique ID for the database cluster to which the rule is applied.
    - `type` 'droplet' | 'k8s' | 'ip_addr' | 'tag' | 'app', required — The type of resource that the firewall rule allows to access the database cluster.
    - `value` string, required — The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster.
    - `created_at` string, date-time — A time value given in ISO8601 combined date and time format that represents when the firewall rule was created.

## Response `204`

The action was successful and the response body is empty.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `404` — The resource was not found.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/versions/cb3bf9b21459/schema)
