Jump to content

ERA api creating policy, problem with serialized data


Recommended Posts

halo, my environment : ubuntu, era 6.5. i'm trying to create a policy data based on "built in policy". i can not find the required data ("Binary data of the serialized policy.") for "policyData" attribute. here is my json. i erase the policyData.data content, because it is very long.

{
	"Era.Common.NetworkMessage.ConsoleApi.Policies.RpcCreatePolicyRequest": {
		"staticObjectData": {
			"name": "Antivirus - Maximum security ole",
			"description": "Taking advantage of advanced heuristic, LiveGrid, IdleState Scanner, Automatic device scan after connection, SSL filtering. Detection of potentially unsafe, unwanted and suspicious applications is not affected. Exclusions are overwritten."
		},
		"policyData": {
			"data": "long data......----------",
			"product": "eset.local.products.endpoint"
		}
	}
}

so far i manage to find the qualified product names they are in the tbl_policies table, but i cant find the "Binary data of the serialized policy." i tried to use the extremely long "policy_data" field from the same data. the JSON reponse was okay, but in the web console the settings panel not working, displaying error message "ERROR WHILE INITIALIZING CONFIGURATION EDITOR". i have no idea what else to try. any insight are welcome.

 

thanks in advance. 

Link to comment
Share on other sites

  • ESET Staff

I would recommend to try call RpcGetPolicyRequest where respective response of type RpcGetPolicyResponse will contain data you need to duplicate policy. You will need UUID of policy you are duplicating, where pre-installed policies will have the same UUID for all installation -> should be visible in the database you already mentioned.

ERA uses unique identifiers in 36 character string format as described in documentation. Example of such policy UUID is 00000000-0000-0000-7019-00000000001a (beware of lowercase hexadecimal characters!)

 

Regarding your failing attempt: problem is that database contains binary serialization of structure policyData, i.e. data from both policyData.data and policyData.product fields. This is what broke subsequent processing of policy.

Link to comment
Share on other sites

thanks MartinK, i was using  RpcGetPolicyRequest, but abandoned that one because i keep get authorization error. anyway i check it once again and notice i supply wrong uuid , it was used without dashes. not it works, both RpcGetPolicyRequest and RpcCreatePolicyRequest. thank you very much. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...