doctl Verified current stable Not installed? Security

Doctl / Manage Databases Firewalls

Manage Databases Firewalls

Manages firewall rules for a database, utilizing an access token for authentication.

$
Terminal
doctl d fw <command> -t <access_token>

When To Use

When setting up or modifying firewall protection for sensitive databases.

Pro Tip

Use `--dry-run` to preview the configuration changes without applying them.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl d fw <command> -t <access_token>

Anatomy of Output

Understanding the result

Firewall Rule ID: abc123 Rule ID Added/Modified

The ID of the newly created or modified rule.

Action: allow Rule Action

Describes the action performed by the rule.

Database ID: 56789 Database Associated

Indicates the database being secured.

Power User Variants

Optimized versions

doctl databases fw append --rule ip:192.168.1.1 --access-token mytoken

Appending a rule for a specific IP.

doctl databases fw ls --access-token mytoken

Lists all firewall rules associated with the database.

Troubleshooting

Common pitfalls

Error: Invalid access token

Solution: Recheck the token validity and permissions.

Error: Firewall modification failed

Solution: Look into the firewall configurations and logs.

Error: Action not permitted

Solution: Ensure actions comply with applicable security constraints.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
d
d|databases
The value supplied for d|databases.
fw
fw|firewalls
The value supplied for fw|firewalls.
<command>
command
The value supplied for command.
-t
t| access token
The value supplied for t| access token.
<access_token>
access token
The value supplied for access token.
-t
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative security tools for the same job.