IBM QRadar SOAR

IBM QRadar

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Debugging with Visual Studio Code

    Posted Fri May 24, 2019 03:11 AM
    Hi,

    I have some issues to use breakpoints on a custom component with Visual Studio code. Do you know if it's working ?

    This is what I've done :
    1. Create a new virtual environment (Python 2.7)
    2. pip install resilient-circuits
    3. pip install -e ./fn_utilities (to have it in editable mode)
    4. Add a new debug configuration
    {
    "name": "Run resilien-circuits",
    "type": "python",
    "request": "attach",
    "pythonPath": "${workspaceFolder}/.venv/Scripts/python.exe",
    "program": "${workspaceFolder}/lib/sites-packages/resilient_circuits/app.py",
    "console": "integratedTerminal"
    },

    When I set a beakpoint and start the debugging, the breakpoint is not hit. Do you have an idea ?

    Thank you.


    ------------------------------
    Clément Fouque
    ------------------------------


  • 2.  RE: Debugging with Visual Studio Code

    Posted Fri May 24, 2019 05:38 AM
    Hi Clément

    I currently have a working setup for debugging with VSCode and Circuits. My setup looks very similar to yours with some exceptions : 

    I use pyenv rather then venv 
    I don't specify a python path for my run configuration 
    I use python setup.py develop to load in fn_utilities in editable mode 

    This is my run config 

    {
    "name": "Python: Run Resilient Circuits",
    "type": "python",
    "request": "launch",
    "program": "/Users/rg-ibm/.pyenv/versions/3.6.0/lib/python3.6/site-packages/resilient_circuits/app.py",
    "console": "internalConsole"
    }

    This setup currently lets me set breakpoints when running in Debug Window. Happy to work with you to try figure this out so you can debug. Is it possible that your pythonPath is hitting a different python location than where you have your integration installed? 


    ------------------------------
    Ryan Gordon
    Security Software Engineer
    IBM
    ------------------------------



  • 3.  RE: Debugging with Visual Studio Code

    Posted Mon May 27, 2019 03:06 AM
    Hi Ryan,

    Thanks a lot for your reply. I was able to make it work with the following :
    {
    "name": "Python: Run resilien-circuits",
    "type": "python",
    "request": "launch",
    "pythonPath": "${workspaceFolder}/.venv/Scripts/python.exe",
    "program": "${workspaceFolder}\\Lib\\site-packages\\resilient_circuits\\app.py",
    "console": "internalConsole"
    },

    Have a good day.

    ------------------------------
    Clément Fouque
    ------------------------------