Giter VIP home page Giter VIP logo

ssllabs-scan's Introduction

SSL Labs Scan

githubactions codecov CodeQL SecretsScan License

This tool calls the SSL Labs API to do SSL testings on the given hosts, and generates csv and html reports.

  • The tool uses API v4 if you provide your registered email with Qualys SSLLabs via the --email argument.
  • The tool uses API v3 if you do not specify the --email argument. Note that v3 will be being deprecated in 2024 by Qualys.

All notable changes to this project will be documented in CHANGELOG.


Built with


Input and outputs

Sample input: sample/SampleServerList.txt

  1. summary.html (sample output: sample/summary.html)
  2. summary.csv (sample output: sample/summary.csv)
  3. hostname.json (sample output: sample/google.com.json)

Sample html output: alt text

You can change the report template and styles in these files:


Important Notes

ℹ️ Please note that from Qualys SSLLabs API v4, you must use a one-time registration with Qualys SSLLabs. For details see Introduction of API v4 for Qualys SSLLabs and deprecation of API v3.

The API v3 API will be available until the end of 2023 (Dec 31st 2023), and starting from 1st January 2024, we will be deprecating the API v3 support for SSL Labs. Request all customers to move to API v4.

ℹ️ Please note that the SSL Labs Assessment API has access rate limits. You can find more details in the sections "Error Response Status Codes" and "Access Rate and Rate Limiting" in the official SSL Labs API Documentation. Some common status codes are:

  • 400 - invocation error (e.g., invalid parameters)
  • 429 - client request rate too high or too many new assessments too fast
  • 500 - internal error
  • 503 - the service is not available (e.g., down for maintenance)
  • 529 - the service is overloaded

Build and run

Linux

# Create and activate a new virtual env (optional)
virtualenv env
. env/bin/activate

# Install
pip install -e .

# Run with v3 (v3, which does not required a registered email, will be being deprecated in 2024)
ssllabs-scan sample/SampleServerList.txt

# Run with v4
ssllabs-scan sample/SampleServerList.txt --email <your registered email with Qualys SSLLabs>

Windows

# Create and activate a new virtual env (optional)
virtualenv env
env\Scripts\activate

# Install
pip install -e .

# Run with v3 (v3, which does not required a registered email, will be being deprecated in 2024)
ssllabs-scan sample\SampleServerList.txt

# Run with v4
ssllabs-scan sample\SampleServerList.txt --email <your registered email with Qualys SSLLabs>

Docker

# Build docker image
docker build . --tag=ssllabsscan

Running Docker from commandline:

# create directory for input and output
mkdir out
# put serverlist in directory
cp SampleServerlist.txt out
# Run docker image with created directory mounted as /tmp
# use -t option to prevent output buffering
docker run --mount type=bind,source=./out,target=/tmp ssllabsscan  -o /tmp/output.html -s /tmp/output.csv /tmp/SampleServerList.txt
# all html, csv, json output is in the out directory

Example console output

$ ssllabs-scan sample/SampleServerList.txt
Start analyzing duckduckgo.com...
Status: DNS, StatusMsg(Resolving domain names): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Start analyzing google.com...
Status: DNS, StatusMsg(Resolving domain names): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Status: IN_PROGRESS, StatusMsg(None): waiting 30 secs until next check...
Creating summary.html ...

Run Tox tests and build the wheels

pip install -r requirements-build.txt
tox -r

ssllabs-scan's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar

ssllabs-scan's Issues

Retry only for error codes 429 and 529

Proposed changes

Existing approach retries calling the SSL Labs API for a given host when the returned status_code is not 200.

Propose to change the retry only for error codes

  • 429 - client request rate too high or too many new assessments too fast
  • 529 - the service is overloaded

See also SSL Labs API expected error codes in the API docs v3.

Type of change

Breaking change - change of existing behaviour of retrying to call for the same host

Outcome

Avoid unnecessary retires on other expected or unexpected errors.

Expected errors refer to SSL Labs API expected error codes in the API docs v3.

  • 400 - invocation error (e.g., invalid parameters)
  • 500 - internal error
  • 503 - the service is not available (e.g., down for maintenance)

Stuck on response code 441

Hi dev,

While scanning a list, i came across the below error, it seems the script can't get passed it to the next website test

Start analyzing testwebsite.com ...
Status: DNS, wait for 30 seconds...
Status: IN_PROGRESS, wait for 30 seconds...
Start analyzing xx.xxx.xxx.xxx:443 ...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...
Response code: 441 - Error on requesting API. Waiting 30 sec until next retry...

Any help would be appreciated.

failed to create process.

Hi,

I'm trying to run the ssllabs-scan command after the installation, but I keep getting the error "failed to create process". by the way, I'm also trying to run it on WSL and it is working perfectly fine.

Host: Windows 10
Python ver: 3.8.10
Pip ver: pip 21.3.1

Feature request - report column for IP address

Would it be possible to have a column added to the report for IP address? This would help greatly for domains that return multiple hosts, so that the results could be differentiated between them. Google.com is an example, as is nctc.edu.

Thank you

do you need to run it from the ssllabs-scan directory?

This is great and so far useful.
I'm running it from the subdirectory(of the ssllabs-scan directory) that the input file is in and it is odd that working for some in the input file list and getting these errors for others in the list
i didn't want to run it in the main directory as trying to scan over 3000 sites

File "$BASEDIR/ssllabs-scan/bin/ssllabs-scan", line 11, in
load_entry_point('ssllabsscan', 'console_scripts', 'ssllabs-scan')()
File "$BASEDIR/ssllabs-scan/ssllabsscan/main.py", line 82, in main
return process(server_list_file=sys.argv[1])
File "$BASEDIR/ssllabs-scan/ssllabsscan/main.py", line 68, in process
traceback.print_stack()

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.