18F / domain-scan

A lightweight pipeline, locally or in Lambda, for scanning things like HTTPS, third party service use, and web accessibility.
Other
369 stars 139 forks source link

WIP: Creating a Python package #231

Open IanLee1521 opened 6 years ago

IanLee1521 commented 6 years ago

TODO:

IanLee1521 commented 6 years ago

This actually appears to be working now as is, but I'm going to use this as an excuse to roll this into a proper package structure while I'm touching it.

IanLee1521 commented 6 years ago

FYI -- There is now an (early, WIP) version of the package uploaded at: https://pypi.org/project/domain-scan/

You should be able to now: pip install --pre domain-scan to test that piece of the puzzle. That said, I will need to make version 2 for the actual scripts to work, currently they fail with:

> scan --help
Traceback (most recent call last):
  File "/Users/lee1001/.virtualenvs/python3/bin/scan", line 19, in <module>
    from scanners.headless.local_bridge import headless_scan
ModuleNotFoundError: No module named 'scanners'
konklone commented 6 years ago

@IanLee1521 This is great progress. Thank you for working on this!

Also, @jsf9k and I just maybe-simplified or maybe-complicated this work, by splitting out the requirements into different places in #224.

In a pip install-able use case, should it install the scanner and gatherer-specific reqs by default? This would have been the default previously, so keeping it that way by installing from all 3 .txt files would at least be the status quo.

I don't think we yet have a live downstream use case of the pip install workflow for domain-scan, so I guess I'd look to @jsf9k or @JasonMWhite (or others) for suggestions on what the right interface is here.

jsf9k commented 6 years ago

I think we could keep the requirements split up by adding gatherers, scanners, etc. sections to extras_require in setup.py.

This is what I've done with the testing requirements in pshtt, for example. pip install . will install the install_requires, and if you want to install those requirements and the ones for testing then you just do pip install .[test].

I also modified requirements.txt in pshtt to automatically parrot what is already in setup.py. I think it would be good if we can do the same with our various requirements files here, since then we only need to maintain the setup.py file.