addPolicy
- Print
- PDF
addPolicy
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Available in Classic
Add a firewall policy to be applied to Secure Zone.
Request
The following describes the request format for the endpoint. The request format is as follows:
Method | URI |
---|---|
POST | /{type}/{zone}/addPolicy |
Request headers
For headers common to Secure Zone APIs, see Secure Zone request headers.
Request path parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
type | String | Required | firewall type provided by Secure Zone
|
zone | String | Required | Zone in which Secure Zone is configured
|
Request body
The following describes the request body.
Field | Type | Required | Description |
---|---|---|---|
action | String | Required | Allow/deny
|
description | String | Optional | Policy description |
destinationAddressGroupList[] | Array | Required | Information for the address group you want to target as a destination
|
destinationAddressGroupList[].addressGroupName | String | Optional | Destination address group name |
destinationAddressGroupList[].addressGroupNo | Integer | Optional | Unique number assigned to the address group |
destinationAddressGroupList[].description | String | Optional | Destination address group description |
destinationAddressGroupList[].addressList[] | Array | Required | Information about addresses that belong to the address group |
destinationAddressGroupList[].addressList[].addressNo | Integer | Optional | Unique number assigned to the address |
destinationAddressGroupList[].addressList[].addressZone | String | Optional | Information for the zone the address belongs to
|
destinationAddressGroupList[].addressList[].fqdn | String | Optional | Full domain name (FQDN)
|
destinationAddressGroupList[].addressList[].ip | String | Optional | IP address
|
destinationAddressGroupList[].addressList[].maskBit | Integer | Optional | Subnet mask bit value
|
destinationAddressGroupList[].addressList[].name | String | Optional | Destination address name |
destinationAddressGroupList[].addressList[].port | String | Optional | Port number
|
destinationAddressGroupList[].addressList[].type | String | Optional | Address type information
|
destinationAddressGroupList[].addressZone | String | Optional | Information about the zone the destination address group belongs to |
destinationAddressGroupList[].objectStorage | Boolean | Optional | Whether to use Object Storage
|
destinationAddressList[] | Array | Required | Information for the individual addresses you want to target as destinations
|
destinationAddressList[].addressNo | Integer | Optional | Unique number assigned to the address |
destinationAddressList[].addressZone | String | Optional | Information for the zone the address belongs to
|
destinationAddressList[].fqdn | String | Optional | Full domain name (FQDN)
|
destinationAddressList[].ip | String | Optional | IP address
|
destinationAddressList[].maskBit | Integer | Optional | Subnet mask bit value
|
destinationAddressList[].name | String | Optional | Destination address name |
destinationAddressList[].port | String | Optional | Port number
|
destinationAddressList[].type | String | Optional | Address type information
|
destinationAddressZone | String | Optional | Information about the zone to which the address belongs
|
policyName | String | Required | Policy name |
port | String | Optional | Firewall service port number |
protocol | String | Optional | Firewall service protocol |
sourceAddressGroupList[] | Array | Required | Information for the address group you want to target as an origin
|
sourceAddressGroupList[].addressGroupNo | Integer | Optional | Unique number assigned to the address group |
sourceAddressGroupList[].addressGroupName | String | Optional | Origin address group name |
sourceAddressGroupList[].addressList[] | Array | Required | Information about addresses that belong to the address group |
sourceAddressGroupList[].addressList[].addressNo | Integer | Optional | Unique number assigned to the address |
sourceAddressGroupList[].addressList[].addressZone | String | Optional | Information for the zone the address belongs to
|
sourceAddressGroupList[].addressList[].fqdn | String | Optional | fqdn (full domain name)
|
sourceAddressGroupList[].addressList[].ip | String | Optional | IP address
|
sourceAddressGroupList[].addressList[].maskBit | Integer | Optional | Subnet mask bit value
|
sourceAddressGroupList[].addressList[].name | String | Optional | Origin address name |
sourceAddressGroupList[].addressList[].port | String | Optional | Port number
|
sourceAddressGroupList[].addressList[].type | String | Optional | Address type information
|
sourceAddressGroupList[].addressZone | String | Optional | Information about the zone the origin address group belongs to |
sourceAddressGroupList[].description | String | Optional | Origin address group description |
sourceAddressGroupList[].objectStorage | Boolean | Optional | Whether to use Object Storage
|
sourceAddressList[] | Array | Required | Information for the individual addresses you want to target as origins
|
sourceAddressList[].addressNo | Integer | Optional | Unique number assigned to the address |
sourceAddressList[].addressZone | String | Optional | Information for the zone the address belongs to
|
sourceAddressList[].fqdn | String | Optional | fqdn (full domain name)
|
sourceAddressList[].ip | String | Optional | IP address
|
sourceAddressList[].maskBit | Integer | Optional | Subnet mask bit value
|
sourceAddressList[].name | String | Optional | Origin address name |
sourceAddressList[].port | String | Optional | Port number
|
sourceAddressList[].type | String | Optional | Address type information
|
sourceAddressZone | String | Optional | Information about the zone to which the address belongs
|
Request example
The following is a sample request.
curl --location --request POST 'https://securezonefirewall.apigw.ntruss.com/api/v2/szfw/kr1/addPolicy'
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'x-ncp-mbr_no: {User number}' \
--header 'Content-Type: application/json' \
--data '{
"action": "allow",
"description": "policy3",
"destinationAddressGroupList": [
{
"addressGroupName": "dbgroup",
"addressGroupNo": 5452,
"description": "",
"addressList": [
{
"addressNo": 3646,
"addressZone": "db",
"fqdn": "db-****.cdb.ntruss.com",
"ip": "***.***.***.***",
"name": "test-db-001",
"port": "3306",
"type": "fqdn"
}
],
"addressZone": "db",
"objectStorage": false
}
],
"destinationAddressList": [],
"destinationAddressZone": "db",
"policyName": "policy3",
"port": "3306",
"protocol": "TCP",
"sourceAddressGroupList": [
{
"addressGroupNo": 5439,
"addressGroupName": "grp111",
"addressList": [
{
"addressNo": 3643,
"addressZone": "sz",
"ip": "***.***.***.***",
"name": "sv-securezone",
"type": "ipmask"
}
],
"addressZone": "sz",
"description": "string",
"objectStorage": false
}
],
"sourceAddressList": [],
"sourceAddressZone": "sz"
}'
Response
The following describes the response format.
Response body
The following describes the response body.
Field | Type | Required | Description |
---|---|---|---|
action | String | - | Request type |
returnCode | Integer | - | Response code |
returnMessage | String | - | Response message |
Response status codes
For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.
Response example
The following is a sample example.
{
"action": "addPolicy",
"returnCode": 0,
"returnMessage": "success"
}
Was this article helpful?