Code Monkey home page Code Monkey logo

python-ssllabs's Introduction

python-ssllabs

A Python interface for the Qualys SSL Labs API. It can be used as a command line client for automation tasks or as a module which can be integrated in other projects. It is compatible with Python 2.x/3.x and just depends on the requests module.

Features

  • Resume running assessments.
  • Verbose output, showing progress of running endpoint assessments.
  • Retrieve assessments from cache.

Installing

git clone [email protected]:takeshixx/python-ssllabs.git
cd python-ssllabs
pip3 install .
ssllabs-cli.py --help

Using the CLI

The CLI by default only prints the scanning results as a JSON object to stdout. It is recommended to parse this output with tools like jq to extract the preferred fields. The following examples show how specific fields can be extracted.

Show only the grade:

$ ssllabs-cli.py --use-cache github.com |jq ".endpoints[] | [.grade, .ipAddress]"             
[
  "A+",
  "192.30.253.112"
]
[
  "A+",
  "192.30.253.113"
]

Check if there are any issues with the provided certificates:

$ ssllabs-cli.py --use-cache github.com |jq -r ".endpoints[] | .details | .chain | .certs[] | .subject, .issues"
CN=github.com,O=GitHub, Inc.,L=San Francisco,ST=California,C=US,2.5.4.17=#13053934313037,STREET=88 Colin P Kelly, Jr Street,2.5.4.5=#130735313537353530,1.3.6.1.4.1.311.60.2.1.2=#130844656c6177617265,1.3.6.1.4.1.311.60.2.1.3=#13025553,2.5.4.15=#0c1450726976617465204f7267616e697a6174696f6e
0
CN=DigiCert SHA2 Extended Validation Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US
0
CN=github.com,O=GitHub, Inc.,L=San Francisco,ST=California,C=US,2.5.4.17=#13053934313037,STREET=88 Colin P Kelly, Jr Street,2.5.4.5=#130735313537353530,1.3.6.1.4.1.311.60.2.1.2=#130844656c6177617265,1.3.6.1.4.1.311.60.2.1.3=#13025553,2.5.4.15=#0c1450726976617465204f7267616e697a6174696f6e
0
CN=DigiCert SHA2 Extended Validation Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US
0

Terms of Use

This is not an official SSL Labs project. Please make sure to read the official Qualys SSL Labs Terms of Use.

Also you should

  • only inspect sites and servers whose owners have given you permission to do so.
  • be clear that this tool works by sending assessment requests to remote SSL Labs servers and that this information will be shared with them.

python-ssllabs's People

Contributors

alchemyx avatar jolaf avatar takeshixx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

python-ssllabs's Issues

Put version seperately

Currently setup.py depends on ssllabs module, which wants requests. So when I install it before resolving the dependency it’s already asking for requests. A possible solution is not to put version in the module, or put it in a separate file so that setup.py can import only that file.

tag the release?

The setup.py contains version, which is great. It would be appreciated if corresponding commits are tagged.

When error is raised there is None as error message

On line 299 there is:

print('An error occured: {}'.format(_status.get('errors')))

Altought everytime I get error from API (for example - timeout or unresolvable item) i don't have errorsthere is statusMessage. That line always returns when error occurs:

An error occured: None

Pull request with explanation from API docs #4

NameError: name '__version__' is not defined

I am getting the following error while executing the program.

Traceback (most recent call last):
  File "/home/arcy/python-ssllabs/ssllabs-cli.py", line 6, in <module>
    sys.exit(ssllabs.main())
  File "/home/arcy/python-ssllabs/ssllabs/__init__.py", line 369, in main
    cli_args = parse_arguments()
  File "/home/arcy/python-ssllabs/ssllabs/__init__.py", line 23, in parse_arguments
    version=__version__))
NameError: name __version__ is not defined

I've run this -> python3 ssllabs-cli.py [mywebsiteurl]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.