Skip to content

Commit

Permalink
Merge pull request #44 from passivetotal/certsearch-name
Browse files Browse the repository at this point in the history
Use name field for SSL certificate searches
  • Loading branch information
aeetos authored Jan 25, 2022
2 parents 8e9850a + 5af48ba commit 8b95fe4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog


## v2.5.8

#### Enhancements

- `certificates` property of `analyzer.Hostname` objects now returns same list of SSL
certificates as the UI, enabled by a CertificateField search with the field set to
`name`. This activates special-case functionality in the API that performs a
substring search for a hostname across both subjectAlternativeNames and subjectCommonName fields
The previous version only looked at the `subjectAlternativeNames` field. A more narrow
search across specific fields is still available by instantiating an
`analyzer.CertificateField` object directly.
- Docs now show current version number and link to this changelog hosted on GitHub.



## v2.5.7

#### Enhancements
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ RiskIQ PassiveTotal API.

Learn more at `community.riskiq.com <https://community.riskiq.com>`_

Current Version: |release|
^^^^^^^^^^^^^^^^^^^^^^^^^^
`View the changelog <https://github.com/passivetotal/python_api/blob/master/CHANGELOG.md>`_
on the GitHub project page.

Contents:

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion passivetotal/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION="2.5.7"
VERSION="2.5.8"
2 changes: 1 addition & 1 deletion passivetotal/analyzer/hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def certificates(self):
:rtype: :class:`passivetotal.analyzer.ssl.Certificates`
"""
return CertificateField('subjectAlternativeName', self._hostname).certificates
return CertificateField('name', self._hostname).certificates

@property
def whois(self):
Expand Down
12 changes: 10 additions & 2 deletions passivetotal/analyzer/pdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

class PdnsResolutions(RecordList, ForPandas):

"""Historical passive DNS resolution records."""
"""Historical passive DNS resolution records.
Provides a list-like interface to a collection of
:class:`PdnsRecord` objects.
"""

def __init__(self, api_response = None, query=None):
super().__init__(api_response, query)
Expand Down Expand Up @@ -260,7 +264,11 @@ def resolutions(self):
Bounded by dates set in :meth:`passivetotal.analyzer.set_date_range`.
`timeout` and `sources` params are also set by the analyzer configuration.
Provides list of :class:`passivetotal.analyzer.pdns.PdnsRecord` objects.
Provides a list of
:class:`passivetotal.analyzer.pdns.PdnsRecord` objects contained in a
:class:`passivetotal.analyzer.pdns.PdnsResolutions` object.
:rtype: :class:`passivetotal.analyzer.pdns.PdnsResolutions`
"""
if getattr(self, '_resolutions', None) is not None:
return self._resolutions
Expand Down
3 changes: 2 additions & 1 deletion passivetotal/common/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"subjectLocalityName", "issuerStreetAddress",
"issuerLocalityName", "subjectGivenName",
"subjectProvince", "issuerSerialNumber",
"issuerEmailAddress","subjectAlternativeName"]
"issuerEmailAddress","subjectAlternativeName",
"name"]


ATTRIBUTE_APPROVED_FIELDS = [
Expand Down

0 comments on commit 8b95fe4

Please sign in to comment.