Add Rules to a Firewall
- Name
post
- Type
- /v1/firewalls/:uuid/rules
- Description
Send a
POST
request to create the firewall rules with the following attributes:inbound_rules
andoutbound_rules
.
Request
Required Attributes
- Name
address
- Type
- string
- Description
Addresses of IPv4 and/or IPv4 CIDRs for which are allowed traffic from the firewalls.
Optional Attributes
- Name
port
- Type
- integer
- Description
Protocol port in which the traffic will be allowed, use the values: from 0 - 65535.
- Name
protocol
- Type
- string
- Description
Protocol type: TCP, UDP, ICMP or empty for "all".
Example
cURL
curl -X POST "https://api.simplystack.com/v1/firewalls/c85b4c53-4b37-4163-b8fa-a6d88b78eda8/rules" \
-H "Content-Type: application/json" \
-H "Authorization: Token d359ad9cc9422b5ff07aede0cd2707da4ff82be0" \
-d '{"inbound_rules": "[{"address": "0.0.0.0/0", "port": 22, "protocol": "tcp"}]" "outbound_rules": [{"address": "0.0.0.0/0"}]}'
Response
Attributes
- Name
port
- Type
- integer
- Description
Protocol port in which the traffic will be allowed, use the values: from 0 - 65535.
- Name
address
- Type
- string
- Description
Addresses of IPv4 and/or IPv4 CIDRs for which are allowed traffic to/from the firewalls.
- Name
protocol
- Type
- string
- Description
Protocol type: TCP, UDP or ICMP.
Example
json
{
"inbound_rules": [
{
"address": "0.0.0.0/0",
"port": 22,
"protocol": "tcp"
}
],
"otbound_rules": [
{
"address": "0.0.0.0/0"
}
]
}