I'm trying to automate the HTTPS certificate renewals for a half dozen dev environments using the XG API, and I've figured out how to update a certificate.
I also know that I need to make sure that no rule is 'using' the certificate, in order to update it.
I've created a self signed certificate that is good for 40 years, which I use temporarily while updating the certificate I need to. My process is three steps.
1 Edit firewall rule to use template certificate.
2 Update 'real' certificate.
3 Edit rule to use 'real' certificate again.
I've got step 2 working with this xml
<Request APIVersion="1702.1">
<Login>
<Username>user</Username>
<Password>pass</Password>
</Login>
<Set operation="update">
<Certificate>
<Action>UploadCertificate</Action>
<Name>Cert_Name</Name>
<CertificateFormat>pem</CertificateFormat>
<CertificateFile>cert.pem</CertificateFile>
<PrivateKeyFile>priv.key</PrivateKeyFile>
</Certificate>
</Set>
</Request>
The trouble is, the documentation for XG 17.1/.5 API does not clearly explain what the XML hierarchy is for editing/updating a rule. There is no explanation as to which items are attributes and which items are parameters. There is no indication of case sensitivity, and no explanation of weather 'required' fields are actually required for the update/edit you need to do. In fact, I can't even figure out if my "Set" element needs to have the operation attribute or not, and if so should it be "update" or "edit", or "Edit Firewall Rule". Lets just say, the documentation for the api is near useless.
I'm hoping I can find someone that can clearly explain what elements and attributes I need to use to change a rule to use a different certificate.
Here is what I have so far.
<Request APIVersion="1702.1">
<Login>
<Username>user</Username>
<Password>pass</Password>
</Login>
<Set operation="Edit">
<SecurityPolicy>
<Name>Dev_Http_Rule</Name>
<Status>1</Status>
<IPFamily>IPv4</IPFamily>
<Position>after</Position>
<After>
<Name>Other_Dev_Http_Rule</Name>
</After>
<PolicyType>HTTPBased</PolicyType>
<HTTPBasedPolicy>
<HostedAddress>#Port2</HostedAddress>
<HTTPS>1</HTTPS>
<RedirectHTTP>1</RedirectHTTP>
<ListenPort>443</ListenPort>
<HTTPSCertificate>Development_Template_Key</HTTPSCertificate>
<Domains>
<Domain>d1.com</Domain>
<Domain>d2.com</Domain>
<Domain>d3.com</Domain>
<Domain>d4.com</Domain>
</Domains>
<AllowFrom>
<Address>Any IPv4</Address>
</AllowFrom>
<AccessPaths>0</AccessPaths>
<Exceptions>0</Exceptions>
</HTTPBasedPolicy>
<Protection>Development Security</Protection>
<IntrusionPrevention>dmzpolicy</IntrusionPrevention>
<TrafficShapingPolicy>None</TrafficShapingPolicy>
<PassHostHeader>1</PassHostHeader>
</SecurityPolicy>
</Set>
</Request>
This is the error, with no meaning to me, that I am getting.
<Response APIVersion="1702.1" IPS_CAT_VER="1">
<Login>
<status>Authentication Successful</status>
</Login>
<SecurityPolicy transactionid="">
<Status code="501">Configuration parameters validation failed.</Status>
<InvalidParams/>
</SecurityPolicy>
</Response>
This thread was automatically locked due to age.