29-Jun-2022 08:02
Hello,
I trying to import and update of policy via icontrol but instead update of current policy new policie with suffix _number is created.
Steps what I have done:
Files has been uploaded (policy definition + swagger file) to the endpoint /mgmt/tm/asm/file-transfer/uploads/
Policy is created with:
/mgmt/tm/asm/tasks/import-policy/", '{"filename": "sp_test_api.json", "name":"sp_test_api_baseline"}'
When I changed something in swagger file and try to update policy with same steps then new policy sp_test_api_baseline_1 is created.
Tested with simple policy
{
"policy" : {
"applicationLanguage" : "utf-8",
"caseInsensitive" : true,
"description" : "",
"enablePassiveMode" : false,
"enforcementMode" : "transparent",
"protocolIndependent" : false,
"fullPath" : "/Common/sp_test_api_baseline",
"name" : "sp_test_api_baseline",
"softwareVersion" : "16.1.2",
"open-api-files": [
{
"filename": "file://swagger.json"
}
],
"template" : {
"name" : "POLICY_TEMPLATE_API_SECURITY"
},
"type" : "security"
}
}
Any idea why new policy is always created?
Solved! Go to Solution.
30-Jun-2022 07:15 - edited 30-Jun-2022 07:18
Try this (untested):
{
"fileName": "sp_test_api.json",
"policy":{
"fullPath": "/Common/sp_test_api_baseline",
}
}
I personally do not upload the policy, but use file references:
{
"fileReference":{
"link": http://webserver/policy.json
},
"policy":{
"fullPath": "/Common/sp_test_api_baseline",
}
}
30-Jun-2022 07:15 - edited 30-Jun-2022 07:18
Try this (untested):
{
"fileName": "sp_test_api.json",
"policy":{
"fullPath": "/Common/sp_test_api_baseline",
}
}
I personally do not upload the policy, but use file references:
{
"fileReference":{
"link": http://webserver/policy.json
},
"policy":{
"fullPath": "/Common/sp_test_api_baseline",
}
}