Fortify issues with -python-path

I am trying to scan a python project with HP-Fortify.

EVERYTIME I run it, I get the following error: 

   [warning]: The Python frontend was unable to resolve the following import:

I am setting -python-path "C:\Python\27\" 

I have also set -python-path "C:\Python27\Tools\Scripts\"

PLEASE help

Parents
  • It is unclear what exactly cannot be resolved. Is it some python lib cannot be resolved or 3r-party import?
    Does it give you the name of function cannot be resolved? You can try skinmning through the translation logs to get more definitive error.

  • [warning]: The Python frontend was unable to resolve the following import:

    base64 at /..../src/..../abcd.py:157:5.

    logging at /..../src/abcde.py:1:1.

    base64.b64decode at /..../src/abcde.py:169:5.

    subprocess at /..../src/abcde.py:41:5.

    traceback at /..../src/abcde.py/root_logger.py:3:1.

    base64.b64encode at /..../src/abcde.py:157:5.

    [warning]: You may need to add some arguments to the -python-path argument to SCA.

     

    Above files are available in python.path.

    (dbaas_venv)bash-3.2$ python

    Python 2.7.10 (default, Oct 23 2015, 19:19:21)

    [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin

    Type "help", "copyright", "credits" or "license" for more information.

    >>> import traceback

    >>> import subprocess

    >>> import logging

    >>>

     

    /Applications/HP_Fortify/HP_Fortify_SCA_and_Apps_16.11/bin/sourceanalyzer abcd/**/*.py -debug -verbose -Dcom.fortify.sca.ProjectRoot=/tmp/prj_root -b dbaas-poc -python-path/<<my_application>>/src -python-path <<my_app_venv>>/lib/python2.7/site-packages/

     

    PS: VENV is activate and run this command in the same terminal

  • Try this to for your python path:

    -python-path .`python -c "import sys;print ':'.join(sys.path)"`

Reply Children
No Data