To allow access to only
specific addresses in the source zone, you can include an address
object and restrict access to only those members in the source zone
with"source": {"member": ["web-servers-production"]} as shown
in the following example:
curl -X PUT \
'https://10.2.1.4/restapi/v11.0/Policies/SecurityRules?location=vsys&name=rule-example1&vsys=vsys1' \
-H 'X-PAN-KEY: *******' \
-d '{
"entry": [
{
"@location": "vsys",
"@name": "rule-example1",
"@vsys": "vsys1",
"action": "allow",
"application": {
"member": [
"email-collaboration-apps"
]
},
"category": {
"member": [
"any"
]
},
"destination": {
"member": [
"any"
]
},
"from": {
"member": [
"zone-edge1"
]
},
"source-hip": {
"member": [
"any"
]
},
"destination-hip": {
"member": [
"any"
]
},
"service": {
"member": [
"application-default"
]
},
"source": {
"member": [
"web-servers-production"
]
},
"source-user": {
"member": [
"any"
]
},
"to": {
"member": [
"any"
]
}
}
]
}'
If successful, the response
is
{"@status": "success","@code": "20","msg":"command succeeded"
}
}
If the address object does not exist,
the response is as follows:
{"code": 3,"message": "Invalid Object","details": [
{"@type": "CauseInfo","causes": [
{"code": 12,"module": "panui_mgmt","description": "Invalid Object: rule-example1 -> source 'web-servers-production' is not an allowed keyword. rule-example1 -> source web-servers-production is an invalid ipv4/v6 address. rule-example1 -> source web-servers-production invalid range start IP.
rule-example1 -> source 'web-servers-production' is not a valid reference. rule-example1 -> source is invalid."
}
]
}
]
}