Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api path changes #1424

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stix_shifter_modules/secretserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ will return

IBM Security Verify Privilege Vault data to STIX mapping is defined in `to_stix_map.json`

Note: For on Prem IBM Privilege Vault Secret Server Instace "host":"<hostname/SecretServer>"
example: "host":"X.XX.XX.XXX/SecretServer"

This example IBM Security Verify Privilege Vault data:

python3 main.py transmit secretserver '{"host":"<hostname>"}' '{"auth":{"username":"<username>","password":"<password>"}}' results "eyJxdWVyeSI6ICJTRUxFQ1QgKiBGUk9NIFNlY3JldEV2ZW50RGV0YWlsIFdIRVJFIEV2ZW50U3ViamVjdCBMSUtFICclJSUnIFNUQVJUIHQnMjAxOS0wMS0yOFQxMjoyNDowMS4wMDlaJyBTVE9QIHQnMjAyMS0wNy0xNFQxMjo1NDowMS4wMDlaJyIsICJ0YXJnZXQiIDogImh0dHA6Ly85LjQ2Ljg2LjEyMC9TZWNyZXRTZXJ2ZXIvb2F1dGgyL3Rva2VuIn0=" 1 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class APIClient():

def __init__(self, connection, configuration):
self.url = "https://" + connection["host"]
self.auth_token_url = "/SecretServer/oauth2/token"
self.secret_detail = "/SecretServer/api/v1/secrets"
self.auth_token_url = "/oauth2/token"
self.secret_detail = "/api/v1/secrets"
self.connect_timeout = os.getenv('STIXSHIFTER_CONNECT_TIMEOUT', CONNECT_TIMEOUT_DEFAULT)
self.connect_timeout = int(self.connect_timeout)
self.server_cert_content = False
Expand All @@ -35,7 +35,8 @@ def __init__(self, connection, configuration):
configuration["auth"]["username"], configuration["auth"]["password"])
self.server_ip = connection["host"]

self.secret_server_userdetail_url = "SecretServer/api/v1/users/"
self.secret_server_userdetail_url = "/api/v1/users/"
self.report_endpoint = "api/v1/reports/execute"

async def get_token(self):
response = await RestApiClientAsync.call_api(self, self.auth_token_url, 'GET', headers=self.headers,
Expand Down Expand Up @@ -151,9 +152,8 @@ async def get_events(self):
'Authorization': self.accessToken,
'Content-Type': 'application/json'
}
endpoint = "SecretServer/api/v1/reports/execute"

response = await RestApiClientAsync.call_api(self, endpoint, 'POST', headers=headers, data=payload, urldata=None,
response = await RestApiClientAsync.call_api(self, self.report_endpoint, 'POST', headers=headers, data=payload, urldata=None,
timeout=None)
return_obj = {}
if response.code != 200:
Expand Down