gabstopper / smc-python

Forcepoint Security Management Center python library:(Moved to official Forcepoint repo)
https://github.com/Forcepoint/fp-NGFW-SMC-python
Apache License 2.0
29 stars 13 forks source link

Multiple sessions towards a domain SMC #72

Open fgazelot opened 5 years ago

fgazelot commented 5 years ago

Hi David,

We work actually on a script to clean some elements on a multi-domain SMC.

Today, this script works well when we do a loop on all domain to clean elements. The script does a session login then clean elements and logout. This is for each domain.

However, do you think it's possible to use "multi-thread" to clean elements on all domain at the same time? This implies to have multiple sessions at a time.

The problem is how to have different sessions inside each thread?

I use this version of smc-python:

In [3]:  smc.__version__                                                                                
Out[3]: '0.7.0-b16'

Do you have any suggestion for this issue?

Kind regards, Fabien

gabstopper commented 5 years ago

Hi Fabien, There is a "switch_domain" function of the session which allows you to have multiple sessions to different domains after logging in to the Shared domain that might be an option.

Have you tried to write a threaded function with your session login?