Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.

Conversation

@scriptsrc
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 60.375% when pulling 0614420 on issue_620_insecureplatform into edf5187 on develop.

@scriptsrc scriptsrc merged commit 6c677a4 into develop Apr 14, 2017
@scriptsrc scriptsrc deleted the issue_620_insecureplatform branch April 14, 2017 18:26
@scriptsrc
Copy link
Contributor Author

I've had multiple people now with that same problem @blakestoddard.

I might revert this PR.

@kpcyrd
Copy link

kpcyrd commented Apr 18, 2017

@MonkeySecurity please keep in mind to reopen #620 if you revert.

You might be able to solve this issue without extra features by adding the following dependencies to requirements.txt:

pyopenssl
ndg-httpsclient
pyasn1

python-requests tries to inject pyopenssl into urllib3 if it's available.

@scriptsrc
Copy link
Contributor Author

@kpcyrd I think I may update the quickstart guide to have the user install it manually with pip:

    cd /usr/local/src
    sudo git clone --depth 1 --branch develop https://github.com/Netflix/security_monkey.git
    sudo chown -R `whoami`:www-data /usr/local/src/security_monkey
    cd security_monkey
    virtualenv venv
    source venv/bin/activate
    pip install --upgrade setuptools
    pip install --upgrade urllib3[secure]   # to prevent InsecurePlatformWarning
    pip install google-compute-engine  # Only required on GCP
    python setup.py develop

Do you see any problems with that?

@scriptsrc
Copy link
Contributor Author

@kpcyrd - just made #683 - thoughts?

@kpcyrd
Copy link

kpcyrd commented Apr 18, 2017

@MonkeySecurity I've applied the following patch to the current develop and now docker build works again (currently broken with the same error reported by @blakestoddard):

diff --git a/setup.py b/setup.py
index 05f085d..cca9f13 100644
--- a/setup.py
+++ b/setup.py
@@ -66,7 +66,10 @@ setup(
         'cloudaux>=1.1.5',
         'joblib>=0.9.4',
         'pyjwt>=1.01',
-        'urllib3[secure]'
+        'urllib3',
+        'pyopenssl',
+        'ndg-httpsclient',
+        'pyasn1'
     ],
     extras_require = {
         'onelogin': ['python-saml>=2.2.0'],

I've tried adding

RUN pip install "urllib3[secure]" --upgrade

before but that failed as well:

Step 5/12 : RUN pip install setuptools --upgrade
 ---> Using cache
 ---> e7e990efc1ab
Step 6/12 : RUN pip install "urllib3[secure]" --upgrade
 ---> Running in a15c9820cf86
Downloading/unpacking urllib3[secure] from https://pypi.python.org/packages/67/87/67be08389f8df83c9ba4c12e618a4ad93546e234a1e9530618735cd9b73d/urllib3-1.20-py2.py3-none-any.whl#md5=43fdf206d03cf3c20981b0f860452ea3
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1091, in prepare_files
    req_to_install.check_if_exists()
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 811, in check_if_exists
    self.satisfied_by = pkg_resources.get_distribution(self.req)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 552, in get_distribution
    dist = get_provider(dist)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 426, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
IndexError: list index out of range

Storing debug log for failure in /root/.pip/pip.log
The command '/bin/sh -c pip install "urllib3[secure]" --upgrade' returned a non-zero code: 2

I didn't test if the warning actually goes away if you apply the patch from above, it just fixes the install. :)

@scriptsrc
Copy link
Contributor Author

@kpcyrd - Could you add this to the Dockerfile and test:

RUN pip install setuptools --upgrade
RUN pip install pip --upgrade
RUN pip install "urllib3[secure]" --upgrade

I want to fix this bug and then push out a point release 0.9.1.

@scriptsrc
Copy link
Contributor Author

^^ worked for me

@scriptsrc
Copy link
Contributor Author

I updated PR #683 to update the Dockerfile and the quickstart

@kpcyrd
Copy link

kpcyrd commented Apr 19, 2017

@MonkeySecurity the build works for me as well. I left a minor comment on the PR. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants