Skip to content

Commit

Permalink
v1.2.1 Updates (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradchiappetta authored Jun 9, 2022
1 parent 58ba345 commit 04544f3
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.2.0
current_version = 1.2.1
tag = False
commit = False

Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
Changelog
=========

Version `1.2.1`_
================
**Date**: June 03, 2022

* API client:

* None

* CLI:

* Add missing HASSH values to output for IP and QUERY commands
* Remove unused PCAP command

* Dependencies:

* Update jinja to 3.1.0
* Update dict2xml to 1.7.1
* Update Click to 8.1.2
* Update more-itertools to 8.13.0
* Update cachetools to 5.2.0

Version `1.2.0`_
================
**Date**: September 03, 2021
Expand Down Expand Up @@ -265,3 +286,4 @@ Version `0.2.0`_
.. _`1.0.0`: https://github.com/GreyNoise-Intelligence/pygreynoise/compare/v0.9.1...1.0.0
.. _`1.1.0`: https://github.com/GreyNoise-Intelligence/pygreynoise/compare/v1.0.0...1.1.0
.. _`1.2.0`: https://github.com/GreyNoise-Intelligence/pygreynoise/compare/v1.1.0...1.2.0
.. _`1.2.1`: https://github.com/GreyNoise-Intelligence/pygreynoise/compare/v1.2.0...1.2.1
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Usage
help Show this message and exit.
interesting Report an IP as "interesting".
ip Query GreyNoise for all information on a given IP.
pcap Get PCAP for a given IP address.
quick Quickly check whether or not one or many IPs are "noise".
repl Start an interactive shell.
setup Configure API key.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = "GreyNoise Intelligence"

# The full version, including alpha/beta/rc tags
release = "1.2.0"
release = "1.2.1"


# -- General configuration ---------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions requirements/common.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Click==8.0.3
Click==8.1.2
ansimarkup==1.4.0
cachetools==5.0.0;python_version>='3'
cachetools==5.2.0;python_version>='3'
colorama==0.4.4
click-default-group==1.2.2
click-repl==0.2.0
dict2xml==1.7.0;python_version>='3'
dict2xml==1.7.1;python_version>='3'
ipaddress==1.0.23
jinja2==2.11.3;python_version=='3.5' # pyup: ignore
jinja2==3.0.3;python_version>='3.6'
more-itertools==8.12.0;python_version>='3'
jinja2==3.1.0;python_version>='3.6'
more-itertools==8.13.0;python_version>='3'
requests==2.27.1
six==1.16.0
structlog==20.1.0;python_version=='3.5' # pyup: ignore
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def read(fname):

setup(
name="greynoise",
version="1.2.0",
version="1.2.1",
description="Abstraction to interact with GreyNoise API.",
url="https://greynoise.io/",
author="GreyNoise Intelligence",
Expand Down
2 changes: 1 addition & 1 deletion src/greynoise/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
__maintainer__ = "GreyNoise Intelligence"
__email__ = "[email protected]"
__status__ = "BETA"
__version__ = "1.2.0"
__version__ = "1.2.1"
5 changes: 0 additions & 5 deletions src/greynoise/cli/subcommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ def riot(
return results


@not_implemented_command
def pcap():
"""Get PCAP for a given IP address."""


@gnql_command
def query(
context,
Expand Down
10 changes: 10 additions & 0 deletions src/greynoise/cli/templates/ip_context_result.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,18 @@
- <key>Port</key>: <value>{{ ja3.port }}</value>, <key>Fingerprint</key>: <value>{{ ja3.fingerprint }}</value>
{% endcall -%}
{% endif %}

{%- if ip_context.raw_data.hassh %}
[HASSH]
{%- call(hassh) macros.verbose_list(ip_context.raw_data.hassh) -%}
- <key>Port</key>: <value>{{ hassh.port }}</value>, <key>Fingerprint</key>: <value>{{ hassh.fingerprint }}</value>
{% endcall -%}
{% endif %}

{%- elif ip_context.error %}
{{ ip_context.error }}
{% else %}
{{ ip_context.ip }} has not been seen in scans in the past 90 days.
{% endif %}


8 changes: 8 additions & 0 deletions src/greynoise/cli/templates/ip_context_result_query.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
- <key>Port</key>: <value>{{ ja3.port }}</value>, <key>Fingerprint</key>: <value>{{ ja3.fingerprint }}</value>
{% endcall -%}
{% endif %}

{%- if ip_context.raw_data.hassh %}
[HASSH]
{%- call(hassh) macros.verbose_list(ip_context.raw_data.hassh) -%}
- <key>Port</key>: <value>{{ hassh.port }}</value>, <key>Fingerprint</key>: <value>{{ hassh.fingerprint }}</value>
{% endcall -%}
{% endif %}

{%- elif ip_context.error %}
{{ ip_context.error }}
{% else %}
Expand Down
17 changes: 13 additions & 4 deletions tests/cli/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
},
"raw_data": {
"hassh": [
{"hassh": "<hassh#1>", "port": 123456},
{"hassh": "<hassh#2>", "port": 123456},
{"hassh": "<hassh#3>", "port": 123456},
{"fingerprint": "<hassh#1>", "port": 123456},
{"fingerprint": "<hassh#2>", "port": 123456},
{"fingerprint": "<hassh#3>", "port": 123456},
],
"ja3": [
{"fingerprint": "<fingerprint#1>", "port": 123456},
Expand Down Expand Up @@ -116,7 +116,12 @@
[JA3]
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><fingerprint#1></value>
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><fingerprint#2></value>
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><fingerprint#3></value>""" # noqa
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><fingerprint#3></value>
[HASSH]
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><hassh#1></value>
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><hassh#2></value>
- <key>Port</key>: <value>123456</value>, <key>Fingerprint</key>: <value><hassh#3></value>""" # noqa
)
)

Expand Down Expand Up @@ -177,6 +182,8 @@ class TestIPContextFormatter(object):
"""
╔═══════════════════════════╗
║ <header> Context 2 of 3 </header> ║
╚═══════════════════════════╝
Expand All @@ -185,6 +192,8 @@ class TestIPContextFormatter(object):
commonly spoofed ip
╔═══════════════════════════╗
║ <header> Context 3 of 3 </header> ║
╚═══════════════════════════╝
Expand Down
15 changes: 0 additions & 15 deletions tests/cli/test_subcommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,21 +635,6 @@ def test_api_key_not_found(self):
assert "Error: API key not found" in result.output


class TestPCAP(object):
"""PCAP subcommand test cases."""

def test_not_implemented(self, api_client):
"""Not implemented error message returned."""
runner = CliRunner()
expected_output = "Error: 'pcap' subcommand is not implemented yet.\n"

api_client.not_implemented.side_effect = RequestFailure(501)
result = runner.invoke(subcommand.pcap)
api_client.not_implemented.assert_called_with("pcap")
assert result.exit_code == 1
assert result.output == expected_output


class TestQuery(object):
"""Query subcommand tests."""

Expand Down

0 comments on commit 04544f3

Please sign in to comment.