-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dba0ff
commit aaac541
Showing
6 changed files
with
35 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
"""Retrieve host risks and subsequent host info for each host risk.""" | ||
from censys.asm import Events, HostsAssets | ||
from censys.asm import HostsAssets, Logbook | ||
|
||
e = Events() | ||
h = HostsAssets() | ||
logbook = Logbook() | ||
hosts = HostsAssets() | ||
|
||
cursor = e.get_cursor(filters=["HOST_RISK"]) | ||
events = e.get_events(cursor) | ||
cursor = logbook.get_cursor(filogbookters=["HOST_RISK"]) | ||
events = logbook.get_events(cursor) | ||
|
||
for event in events: | ||
# only show logbook events with the 'add' tag | ||
if event["operation"] == "ADD": | ||
print(event) | ||
|
||
# enrich the data of this host_risk with more data from the host itself | ||
host = h.get_asset_by_id(event["entity"]["ipAddress"]) | ||
host = hosts.get_asset_by_id(event["entity"]["ipAddress"]) | ||
print(host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters