Forcepoint / fp-NGFW-SMC-python

Forcepoint NGFW Management Center Python API
https://support.forcepoint.com/s/article/How-to-Start-Using-SMC-API
Apache License 2.0
26 stars 9 forks source link

Limit Request Rate for SMC API to Prevent DoS Alerts #63

Open sebbbastien opened 1 month ago

sebbbastien commented 1 month ago

We are using some Python scripts to monitor the status of certain resources on the SMC. We have identified that one of the scripts is generating "SMC API DoS" alerts on the SMC.

Is there a parameter to ask the SMC library to limit the number of requests per second in exchanges with the SMC?

Best regards,

lilianValeroFp commented 1 month ago

Hi, it appears difficult to answer to this question without knowing the guilty script. From my perspective, an SMC API DoS means that your script is performing too much requests in a too short time frame. We have some mgt_server parameters (to add in SGConfiguration.txt from SG_HOME/data directory) which allows to prevent the SMC API DoS detection: -SMC_API_DOS_TIME_WINDOW: SMC Api DOS time window in ms protection. During this time windows, the SMC will observe for a same remote address (session id does not support login request) the number of API http queries if it exceeds a too much number: we will log the info [by default, it is 500ms]