Sorry if this is a very basic question, I am trying to set up antimalware email customization on trend v12 DSM SAAS and was trying the API calls example for python given below.
It requires a "Payload" in "application/json" as per the link. I tried creating a folder "application" inside my python source folder and added "settings.json" with the below value
{
"anti_malware_setting_event_email_enabled": {"value": "true"}
}
However this doesn't seem to work. Kindly guide me on how to proceed with this. The settings that i want to set are antiMalwareSettingEventEmailRecipients and antiMalwareSettingEventEmailBodyTemplate with the below fields Template variables:
[COMPUTER] - The computer on which the malware was detected
[ORIGIN] - The origin of the scan
[TIME] - The time at which the malware event was detected
[MALWARE] - The name of the malware detected
[FILE] - The infected file
[SCANTYPE] - The type of scan performed
[RESULT] - The result of the scan
[REASON] - The reason for the scan
[VIRUSTYPE] - The major virus type
It looks like the issue here is some confusion between what's needed when making a direct HTTP call to /api/systemsettings, and what's needed when using the SDK to modify system settings.
The "application/json" is the content type to set on a direct HTTP call, and then the body (or payload) would be the json snippet you posted.
Since you're using the python SDK instead, you don't need to worry about that. Instead of the "payload" tab on the API reference page, you can look at the "python" tab, which shows the structural outline of the call, although it is not fully complete.
For details of what the python code would look like, refer to these guides:
https://automation.deepsecurity.trendmicro.com/article/dsaas/send-request?platform=dsaas#use-a-client-library -> shows how to set up the SDK to make calls
https://automation.deepsecurity.trendmicro.com/article/dsaas/configure-deep-security-manager-system-settings?platform=dsaas -> shows examples of working with the system settings api
I suggest you focus on getting a working python script which lists the settings you are interested in. This will also tell you what format those settings's values are in. When that is working, you can switch to trying to modify settings. If you have any issues along the way, feel free to post a new question.
P.S. I work in R&D for Deep Security at Trend Micro