Firewall Resource

TODO

Rule Resource

Rules are used to open up internal ports to be accessible through the firewall from the outside (public).

List Rules

Returns a list of rule resources currently configured in your applications firewall.

GET /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall/rules

Response

[
   {
       "id": "22-tcp",
       "protocol": "tcp",
       "internal_port": 22,
       "public_port": 10019,
       "public_hostname": "d9tready.com",
       "links":
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall/rules/22-tcp",
           "rel": "self"
       }
   },
   ...
]

Attributes

  • protocol - Protocol (tcp, udp, http)
  • internal_port - Port of the service.
  • public_port - Accessible port from the outside. Gets assigned on application start. public_hostname - Hostname of application.
  • _links - Link relations.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
404 NOT FOUND Resource not found

Retrieve Rule

Retrieve a single rule resource.

GET /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall/rules/22-tcp

Response

{
    "protocol": "tcp",
    "internal_port": 22,
    "public_port": 10019,
    "public_hostname": "d9tready.com"
}

Attributes

  • protocol - Protocol (tcp or udp)
  • internal_port - Port of the service.
  • public_port - Accessible port from the outside. Gets assigned on application start. public_hostname - Hostname of application.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
404 NOT FOUND Resource not found

Create Rule

Add a rule to the application firewall.

POST /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall/rules

Payload

{
   "protocol": "<PROTOCOL>",
   "internal_port": "<PORT>"
}
  • protocol - Protocol to be used. tcp, udp, http.
  • internal_port - Port of internal service.

Response

On successful creation the URL to the new rule resource is set in the Location-Header.

HTTP/1.0 201 CREATED
Location: https://d9tready.com/rest/applications/<CONTAINER_ID>/firewall/rules/<RULE>

HTTP Status Codes

Status Code Description
201 CREATED Successful creation of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure

Delete Rule

Permanently delete a rule resource.

DELETE /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall/rules/22-tcp

HTTP Status Codes

Status Code Description
204 NO CONTENT Successful deletion of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure