Imperva Cyber Community

 View Only
  • 1.  SDK Installation basic question

    Posted 10 days ago
      |   view attached
    Hi

    I installed the SDK from Github and installed it. Manually and via PIP.

    But when I try to create a simple script in Python I get

     ModuleNotFoundError: No module named 'imperva_sdk'

    During installation I get this message (snippet, full log attached):

    D:\Python-Projekte\imperva-sdk-0.2.1>python setup.py install

    running build_py

    file imperva_sdk.py (for module imperva_sdk) not found

    file imperva_sdk.py (for module imperva_sdk) not found

    creating build\bdist.win-amd64\egg

    I tried it under Windows and Ubuntu... I searched for a file "imperva_sdk" on my machine - no luck

    What am I doing wrong? Any help welcome!

    Thanks
    Martin

     


    #On-PremisesWAF(formerlySecuresphere)

    ------------------------------
    Martin Schmitz
    CEO
    Martin Schmitz IT Security Consulting
    Korschenbroich
    ------------------------------

    Attachment(s)

    txt
    Imperva SDK.txt   11 KB 1 version


  • 2.  RE: SDK Installation basic question

    Posted 5 days ago
    Hi,

    While I'm not sure on the errors with the SDK, I use a simpler approach and has worked really well for all of the integrations I have developed. Please see a few links below. I use the generic ss.makeCall() function when including the following library where you can make any call you want.  Also, below please find a link to the composer which allows you to interactively test each call first before putting into your code. Please let me know if you would like to set up a session to talk through development, happy to assist. 

    Repo:
    https://github.com/imperva/mx-toolbox

    Library:
    https://github.com/imperva/mx-toolbox/blob/master/ss.py

    Example usage:
    https://github.com/imperva/mx-toolbox/blob/master/export-learned-hosts/export-web-profile-learned-hosts.py

    Testing individual APIs interactively:
    https://github.com/imperva/imperva-web-api-composer

    ------------------------------
    Brian Anderson
    Director, Technology, Office of the CTO
    Redwood Shores CA
    ------------------------------