-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support api key rotation for censys and passivetotal
- Loading branch information
github-actions
committed
Nov 14, 2024
1 parent
09f7ec3
commit 0d8681d
Showing
4 changed files
with
25 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,12 @@ | |
|
||
|
||
class TestCensys(ModuleTestBase): | ||
config_overrides = {"modules": {"censys": {"api_id": "api_id", "api_secret": "api_secret"}}} | ||
config_overrides = {"modules": {"censys": {"api_key": "api_id:api_secret"}}} | ||
|
||
async def setup_before_prep(self, module_test): | ||
module_test.httpx_mock.add_response( | ||
url="https://search.censys.io/api/v1/account", | ||
match_headers={"Authorization": "Basic YXBpX2lkOmFwaV9zZWNyZXQ="}, | ||
json={ | ||
"email": "[email protected]", | ||
"login": "nope", | ||
|
@@ -17,6 +18,7 @@ async def setup_before_prep(self, module_test): | |
) | ||
module_test.httpx_mock.add_response( | ||
url="https://search.censys.io/api/v2/certificates/search", | ||
match_headers={"Authorization": "Basic YXBpX2lkOmFwaV9zZWNyZXQ="}, | ||
match_content=b'{"q": "names: blacklanternsecurity.com", "per_page": 100}', | ||
json={ | ||
"code": 200, | ||
|
@@ -45,6 +47,7 @@ async def setup_before_prep(self, module_test): | |
) | ||
module_test.httpx_mock.add_response( | ||
url="https://search.censys.io/api/v2/certificates/search", | ||
match_headers={"Authorization": "Basic YXBpX2lkOmFwaV9zZWNyZXQ="}, | ||
match_content=b'{"q": "names: blacklanternsecurity.com", "per_page": 100, "cursor": "NextToken"}', | ||
json={ | ||
"code": 200, | ||
|
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 |
---|---|---|
|
@@ -2,15 +2,17 @@ | |
|
||
|
||
class TestPassiveTotal(ModuleTestBase): | ||
config_overrides = {"modules": {"passivetotal": {"username": "[email protected]", "api_key": "asdf"}}} | ||
config_overrides = {"modules": {"passivetotal": {"api_key": "[email protected]:asdf"}}} | ||
|
||
async def setup_before_prep(self, module_test): | ||
module_test.httpx_mock.add_response( | ||
url="https://api.passivetotal.org/v2/account/quota", | ||
match_headers={"Authorization": "Basic am9uQGJscy5mYWtlZG9tYWluOmFzZGY="}, | ||
json={"user": {"counts": {"search_api": 10}, "limits": {"search_api": 20}}}, | ||
) | ||
module_test.httpx_mock.add_response( | ||
url="https://api.passivetotal.org/v2/enrichment/subdomains?query=blacklanternsecurity.com", | ||
match_headers={"Authorization": "Basic am9uQGJscy5mYWtlZG9tYWluOmFzZGY="}, | ||
json={"subdomains": ["asdf"]}, | ||
) | ||
|
||
|