Appendix: Scan Commands¶
Every type of scan that SSLyze can run against a server (supported cipher suites, session renegotiation, etc.) is
represented by a ScanCommand
, which, when run against a server, will return a specific result.
This page lists all the ScanCommand
and their corresponding results available in the current release of SSLyze.
For an example on how to run a ScanCommand
, see Step 2: Running Scan Commands Against a Server.
Contents
The following scan commands are available in the current version of SSLyze:
-
class
sslyze.
ScanCommand
¶ The list of all scan commands supported by SSLyze.
-
CERTIFICATE_INFO
: typing_extensions.Literal[certificate_info] = 'certificate_info'¶
-
SSL_2_0_CIPHER_SUITES
: typing_extensions.Literal[ssl_2_0_cipher_suites] = 'ssl_2_0_cipher_suites'¶
-
SSL_3_0_CIPHER_SUITES
: typing_extensions.Literal[ssl_3_0_cipher_suites] = 'ssl_3_0_cipher_suites'¶
-
TLS_1_0_CIPHER_SUITES
: typing_extensions.Literal[tls_1_0_cipher_suites] = 'tls_1_0_cipher_suites'¶
-
TLS_1_1_CIPHER_SUITES
: typing_extensions.Literal[tls_1_1_cipher_suites] = 'tls_1_1_cipher_suites'¶
-
TLS_1_2_CIPHER_SUITES
: typing_extensions.Literal[tls_1_2_cipher_suites] = 'tls_1_2_cipher_suites'¶
-
TLS_1_3_CIPHER_SUITES
: typing_extensions.Literal[tls_1_3_cipher_suites] = 'tls_1_3_cipher_suites'¶
-
TLS_COMPRESSION
: typing_extensions.Literal[tls_compression] = 'tls_compression'¶
-
TLS_1_3_EARLY_DATA
: typing_extensions.Literal[tls_1_3_early_data] = 'tls_1_3_early_data'¶
-
OPENSSL_CCS_INJECTION
: typing_extensions.Literal[openssl_ccs_injection] = 'openssl_ccs_injection'¶
-
TLS_FALLBACK_SCSV
: typing_extensions.Literal[tls_fallback_scsv] = 'tls_fallback_scsv'¶
-
HEARTBLEED
: typing_extensions.Literal[heartbleed] = 'heartbleed'¶
-
ROBOT
: typing_extensions.Literal[robot] = 'robot'¶
-
SESSION_RENEGOTIATION
: typing_extensions.Literal[session_renegotiation] = 'session_renegotiation'¶
-
SESSION_RESUMPTION
: typing_extensions.Literal[session_resumption] = 'session_resumption'¶
-
SESSION_RESUMPTION_RATE
: typing_extensions.Literal[session_resumption_rate] = 'session_resumption_rate'¶
-
HTTP_HEADERS
: typing_extensions.Literal[http_headers] = 'http_headers'¶
-
ELLIPTIC_CURVES
: typing_extensions.Literal[elliptic_curves] = 'elliptic_curves'¶
-
The next sections describe the result class that corresponds to each scan command.
Certificate Information¶
ScanCommand.CERTIFICATE_INFO: Retrieve and analyze a server’s certificate(s) to verify its validity.
Optional arguments¶
-
class
sslyze.
CertificateInfoExtraArguments
(custom_ca_file)¶ Additional configuration for running the CERTIFICATE_INFO scan command.
-
custom_ca_file
¶ The path to a custom trust store file to use for certificate validation. The file should contain PEM-formatted root certificates.
- Parameters
custom_ca_file (
Path
) –
-
Result class¶
-
class
sslyze.
CertificateInfoScanResult
(hostname_used_for_server_name_indication, certificate_deployments)¶ The result of retrieving and analyzing a server’s certificates to verify their validity.
-
hostname_used_for_server_name_indication
¶ The hostname sent by SSLyze as the Server Name Indication extension.
-
certificate_deployments
¶ A list of leaf certificates detected by SSLyze and the corresponding analysis. Most servers only deploy one leaf certificate, but some websites (such as Facebook) return different leaf certificates depending on the client, as a way to maximize compatibility with older clients/devices.
- Parameters
hostname_used_for_server_name_indication (
str
) –certificate_deployments (
List
[CertificateDeploymentAnalysisResult
]) –
-
-
class
sslyze.
CertificateDeploymentAnalysisResult
(received_certificate_chain, leaf_certificate_subject_matches_hostname, leaf_certificate_has_must_staple_extension, leaf_certificate_is_ev, leaf_certificate_signed_certificate_timestamps_count, received_chain_contains_anchor_certificate, received_chain_has_valid_order, path_validation_results, verified_chain_has_sha1_signature, verified_chain_has_legacy_symantec_anchor, ocsp_response, ocsp_response_is_trusted)¶ The result of analyzing a server’s certificate to verify its validity.
Any certificate available within the fields that follow is parsed as a
Certificate
object using the cryptography module; documentation is available at https://cryptography.io/en/latest/x509/reference.html?highlight=Certificate#cryptography.x509.Certificate-
received_certificate_chain
¶ The certificate chain sent by the server; index 0 is the leaf certificate.
-
verified_certificate_chain
¶ The verified certificate chain returned by OpenSSL for one of the trust stores packaged within SSLyze. Will be
None
if the validation failed with all of the available trust stores (Apple, Mozilla, etc.). This is essentially a shortcut topath_validation_result_list[0].verified_certificate_chain
.
-
path_validation_results
¶ The result of validating the server’s certificate chain using each trust store that is packaged with SSLyze (Mozilla, Apple, etc.). If for a given trust store, the validation was successful, the verified certificate chain built by OpenSSL can be retrieved from the
PathValidationResult
.
-
leaf_certificate_subject_matches_hostname
¶ True
if the leaf certificate’s Common Name or Subject Alternative Names match the server’s hostname.
-
leaf_certificate_is_ev
¶ True
if the leaf certificate is Extended Validation, according to Mozilla.
-
leaf_certificate_has_must_staple_extension
¶ True
if the OCSP must-staple extension is present in the leaf certificate.
-
leaf_certificate_signed_certificate_timestamps_count
¶ The number of Signed Certificate Timestamps (SCTs) for Certificate Transparency embedded in the leaf certificate.
None
if the version of OpenSSL installed on the system is too old to be able to parse the SCT extension.
-
received_chain_has_valid_order
¶ True
if the certificate chain returned by the server was sent in the right order.
-
received_chain_contains_anchor_certificate
¶ True
if the server included the anchor/root certificate in the chain it sends back to clients.None
if the verified chain could not be built.
-
verified_chain_has_sha1_signature
¶ True
if any of the leaf or intermediate certificates are signed using the SHA-1 algorithm.None
if the verified chain could not be built.
-
verified_chain_has_legacy_symantec_anchor
¶ True
if the certificate chain contains a distrusted Symantec anchor (https://blog.qualys.com/ssllabs/2017/09/26/google-and-mozilla-deprecating-existing-symantec-certificates).None
if the verified chain could not be built.
-
ocsp_response
¶ The OCSP response returned by the server.
None
if no response was sent by the server or if the scan was run through an HTTP proxy (the proxy will not forward the server’s OCSP response). If present, the OCSP response is anOCSPResponse
object parsed using the cryptography module; documentation is available at https://cryptography.io/en/latest/x509/ocsp.html?highlight=OCSPResponse#cryptography.x509.ocsp.OCSPResponse
-
ocsp_response_is_trusted
¶ True
if the OCSP response is trusted using the Mozilla trust store.None
if no OCSP response was sent by the server.
- Parameters
received_certificate_chain (
List
[Certificate
]) –leaf_certificate_subject_matches_hostname (
bool
) –leaf_certificate_has_must_staple_extension (
bool
) –leaf_certificate_is_ev (
bool
) –leaf_certificate_signed_certificate_timestamps_count (
Optional
[int
]) –received_chain_contains_anchor_certificate (
Optional
[bool
]) –received_chain_has_valid_order (
bool
) –path_validation_results (
List
[PathValidationResult
]) –verified_chain_has_sha1_signature (
Optional
[bool
]) –verified_chain_has_legacy_symantec_anchor (
Optional
[bool
]) –ocsp_response (
Optional
[OCSPResponse
]) –ocsp_response_is_trusted (
Optional
[bool
]) –
-
-
class
sslyze.
PathValidationResult
(trust_store, verified_certificate_chain, openssl_error_string)¶ The result of trying to validate a server’s certificate chain using a specific trust store.
-
trust_stores
¶ The trust store used for validation.
-
verified_certificate_chain
¶ The verified certificate chain returned by OpenSSL. Index 0 is the leaf certificate and the last element is the anchor/CA certificate from the trust store. Will be None if the validation failed or the verified chain could not be built. Each certificate is parsed using the cryptography module; documentation is available at https://cryptography.io/en/latest/x509/reference/#x-509-certificate-object.
-
openssl_error_string
¶ The result string returned by OpenSSL’s validation function; None if validation was successful.
-
was_validation_successful
¶ Whether the certificate chain is trusted when using supplied the trust_stores.
- Parameters
trust_store (
TrustStore
) –verified_certificate_chain (
Optional
[List
[Certificate
]]) –openssl_error_string (
Optional
[str
]) –
-
-
class
sslyze.
TrustStore
(path, name, version, ev_oids=None)¶ A set of root certificates to be used for certificate validation.
-
path
¶ The path on the local system to the PEM-formatted file containing the root certificates.
-
name
¶ The human-readable name of the trust store (such as “Mozilla”).
-
version
¶ The human-readable version or date of the trust store (such as “09/2016”).
- Parameters
path (
Path
) –name (
str
) –version (
str
) –ev_oids (
Optional
[List
[ObjectIdentifier
]]) –
-
path
: pathlib.Path¶
-
name
: str¶
-
version
: str¶
-
ev_oids
: Optional[List[cryptography.hazmat._oid.ObjectIdentifier]] = None¶
-
is_certificate_extended_validation
(certificate)¶ Is the supplied server certificate EV?
- Parameters
certificate (
Certificate
) –- Return type
bool
-
Cipher Suites¶
ScanCommand.SSL_2_0_CIPHER_SUITES: Test a server for SSL 2.0 support. ScanCommand.SSL_3_0_CIPHER_SUITES: Test a server for SSL 3.0 support. ScanCommand.TLS_1_0_CIPHER_SUITES: Test a server for TLS 1.0 support. ScanCommand.TLS_1_1_CIPHER_SUITES: Test a server for TLS 1.1 support. ScanCommand.TLS_1_2_CIPHER_SUITES: Test a server for TLS 1.2 support. ScanCommand.TLS_1_3_CIPHER_SUITES: Test a server for TLS 1.3 support.
Result class¶
-
class
sslyze.
CipherSuitesScanResult
(tls_version_used, accepted_cipher_suites, rejected_cipher_suites)¶ The result of testing a server for cipher suites with a specific version of SSL/TLS.
-
tls_version_used
¶ The SSL/TLS version used to connect to the server.
-
accepted_ciphers
¶ The list of cipher suites supported supported by both SSLyze and the server.
-
rejected_ciphers
¶ The list of cipher suites supported by SSLyze that were rejected by the server.
- Parameters
tls_version_used (
TlsVersionEnum
) –accepted_cipher_suites (
List
[CipherSuiteAcceptedByServer
]) –rejected_cipher_suites (
List
[CipherSuiteRejectedByServer
]) –
-
-
class
sslyze.
CipherSuiteRejectedByServer
(cipher_suite, error_message)¶ - Parameters
cipher_suite (
CipherSuite
) –error_message (
str
) –
-
class
sslyze.
CipherSuiteAcceptedByServer
(cipher_suite, ephemeral_key)¶ - ephemeral_key: The ephemeral key negotiated with the server when using (EC) DH cipher suites. None if the cipher
suite does not use ephemeral keys or if the ephemeral key could not be retrieved.
- Parameters
cipher_suite (
CipherSuite
) –ephemeral_key (
Optional
[EphemeralKeyInfo
]) –
-
class
sslyze.
EphemeralKeyInfo
(type, size, public_bytes)¶ Common fields shared by all kinds of TLS key exchanges.
- Parameters
type (
OpenSslEvpPkeyEnum
) –size (
int
) –public_bytes (
bytearray
) –
-
class
sslyze.
CipherSuite
(name, is_anonymous, key_size, openssl_name)¶ - Parameters
name (
str
) –is_anonymous (
bool
) –key_size (
int
) –openssl_name (
str
) –
Supported Elliptic Curves¶
ScanCommand.ELLIPTIC_CURVES: Test a server for supported elliptic curves.
Result class¶
-
class
sslyze.
SupportedEllipticCurvesScanResult
(supports_ecdh_key_exchange, supported_curves, rejected_curves)¶ The result of testing a server for supported elliptic curves.
-
supports_ecdh_key_exchange
¶ True if the server supports at least one cipher suite with an ECDH key exchange.
-
supported_curves
¶ A list of EllipticCurve that were accepted by the server or None if the server does not support ECDH cipher suites.
-
rejected_curves
¶ A list of EllipticCurve that were rejected by the server or None if the server does not support ECDH cipher suites.
- Parameters
supports_ecdh_key_exchange (
bool
) –supported_curves (
Optional
[List
[EllipticCurve
]]) –rejected_curves (
Optional
[List
[EllipticCurve
]]) –
-
ROBOT¶
ScanCommand.ROBOT: Test a server for the ROBOT vulnerability.
Result class¶
-
class
sslyze.
RobotScanResult
(robot_result)¶ The result of testing a server for the ROBOT vulnerability.
-
result
¶ An Enum providing the result of the ROBOT scan.
- Parameters
robot_result (
RobotScanResultEnum
) –
-
-
class
sslyze.
RobotScanResultEnum
(value)¶ An enum to provide the result of running a RobotScanCommand.
-
VULNERABLE_WEAK_ORACLE
= 1¶ The server is vulnerable but the attack would take too long
-
VULNERABLE_STRONG_ORACLE
= 2¶ The server is vulnerable and real attacks are feasible
-
NOT_VULNERABLE_NO_ORACLE
= 3¶ The server supports RSA cipher suites but does not act as an oracle
-
NOT_VULNERABLE_RSA_NOT_SUPPORTED
= 4¶ The server does not supports RSA cipher suites
-
UNKNOWN_INCONSISTENT_RESULTS
= 5¶ Could not determine whether the server is vulnerable or not
-
Session Resumption Support¶
ScanCommand.SESSION_RESUMPTION: Test a server for session resumption support using session IDs and TLS tickets.
Result class¶
-
class
sslyze.
SessionResumptionSupportScanResult
(attempted_session_id_resumptions_count, successful_session_id_resumptions_count, tls_ticket_resumption_result)¶ The result of testing a server for session resumption support using session IDs and TLS tickets.
-
is_session_id_resumption_supported
¶
-
attempted_session_id_resumptions_count
¶ The total number of session ID resumptions that were attempted.
-
successful_session_id_resumptions_count
¶ The number of session ID resumptions that were successful.
-
is_tls_ticket_resumption_supported
¶ True if the server support TLS ticket resumption.
-
tls_ticket_resumption_result
¶
- Parameters
attempted_session_id_resumptions_count (
int
) –successful_session_id_resumptions_count (
int
) –tls_ticket_resumption_result (
TslSessionTicketSupportEnum
) –
-
Session Resumption Rate¶
ScanCommand.SESSION_RESUMPTION_RATE: Measure a server’s session resumption rate when attempting 100 resumptions using session IDs.
Result class¶
-
class
sslyze.
SessionResumptionRateScanResult
(attempted_session_id_resumptions_count, successful_session_id_resumptions_count)¶ The result of measuring a server’s session resumption rate when attempting 100 resumptions using session IDs.
-
attempted_session_id_resumptions_count
¶ The total number of session ID resumptions that were attempted.
-
successful_session_id_resumptions_count
¶ The number of session ID resumptions that were successful.
- Parameters
attempted_session_id_resumptions_count (
int
) –successful_session_id_resumptions_count (
int
) –
-
CRIME¶
ScanCommand.TLS_COMPRESSION: Test a server for TLS compression support, which can be leveraged to perform a CRIME attack.
TLS 1.3 Early Data¶
ScanCommand.TLS_1_3_EARLY_DATA: Test the server(s) for TLS 1.3 early data support.
Downgrade Prevention¶
ScanCommand.TLS_FALLBACK_SCSV: Test a server for the TLS_FALLBACK_SCSV mechanism to prevent downgrade attacks.
Heartbleed¶
ScanCommand.HEARTBLEED: Test a server for the OpenSSL Heartbleed vulnerability.
HTTP Security Headers¶
ScanCommand.HTTP_HEADERS: Test a server for the presence of security-related HTTP headers.
Result class¶
-
class
sslyze.
HttpHeadersScanResult
(strict_transport_security_header, public_key_pins_header, public_key_pins_report_only_header, expect_ct_header)¶ The result of testing a server for the presence of security-related HTTP headers.
Each HTTP header described below will be
None
if the server did not return it.-
strict_transport_security_header
¶ The Strict-Transport-Security header returned by the server.
-
public_key_pins_header
¶ The Public-Key-Pins header returned by the server.
-
public_key_pins_report_only_header
¶ The Public-Key-Pins-Report-Only header returned by the server.
-
expect_ct_header
¶ The Expect-CT header returned by the server.
- Parameters
strict_transport_security_header (
Optional
[StrictTransportSecurityHeader
]) –public_key_pins_header (
Optional
[PublicKeyPinsHeader
]) –public_key_pins_report_only_header (
Optional
[PublicKeyPinsHeader
]) –expect_ct_header (
Optional
[ExpectCtHeader
]) –
-
-
class
sslyze.
StrictTransportSecurityHeader
(max_age, preload, include_subdomains)¶ A Strict-Transport-Security header parsed from a server’s HTTP response.
-
preload
¶ True
if the preload directive is set.
-
include_subdomains
¶ True
if the includesubdomains directive is set.
-
max_age
¶ The content of the max-age field.
- Parameters
max_age (
Optional
[int
]) –preload (
bool
) –include_subdomains (
bool
) –
-
-
class
sslyze.
PublicKeyPinsHeader
(max_age, sha256_pins, include_subdomains, report_uri, report_to)¶ A Public-Key-Pins header parsed from a server’s HTTP response.
-
include_subdomains
¶ True
if the includesubdomains directive is set.
-
max_age
¶ The content of the max-age field.
-
sha256_pins
¶ The list of pin-sha256 values set in the header.
-
report_uri
¶ The content of the report-uri field.
-
report_to
¶ The content of the report-to field, available via the Reporting API as described at https://w3c.github.io/reporting/#examples.
- Parameters
max_age (
Optional
[int
]) –sha256_pins (
List
[str
]) –include_subdomains (
bool
) –report_uri (
Optional
[str
]) –report_to (
Optional
[str
]) –
-
-
class
sslyze.
ExpectCtHeader
(max_age, report_uri, enforce)¶ An Expect-CT header parsed from a server’s HTTP response.
-
max-age
The content of the max-age field.
-
report-uri
The content of report-uri field.
-
enforce
¶ True if enforce directive is set.
- Parameters
max_age (
Optional
[int
]) –report_uri (
Optional
[str
]) –enforce (
bool
) –
-
OpenSSL CCS Injection¶
ScanCommand.OPENSSL_CCS_INJECTION: Test a server for the OpenSSL CCS Injection vulnerability (CVE-2014-0224).
Result class¶
-
class
sslyze.
OpenSslCcsInjectionScanResult
(is_vulnerable_to_ccs_injection)¶ The result of testing a server for the OpenSSL CCS Injection vulnerability (CVE-2014-0224).
-
is_vulnerable_to_ccs_injection
¶ True if the server is vulnerable to the OpenSSL CCS Injection vulnerability.
- Parameters
is_vulnerable_to_ccs_injection (
bool
) –
-
Insecure Renegotiation¶
ScanCommand.SESSION_RENEGOTIATION: Test a server for for insecure TLS renegotiation and client-initiated renegotiation.
Result class¶
-
class
sslyze.
SessionRenegotiationScanResult
(supports_secure_renegotiation, is_vulnerable_to_client_renegotiation_dos)¶ The result of testing a server for insecure TLS renegotiation and client-initiated renegotiation.
-
accepts_client_renegotiation
¶ True if the server honors client-initiated renegotiation attempts.
-
supports_secure_renegotiation
¶ True if the server supports secure renegotiation.
- Parameters
supports_secure_renegotiation (
bool
) –is_vulnerable_to_client_renegotiation_dos (
bool
) –
-