Skip to content

Commit

Permalink
Merge pull request #4 from splunk-soar-connectors/fix-pipeline
Browse files Browse the repository at this point in the history
AWS Inspector: Fixing SemGrep pipeline errors
  • Loading branch information
cpangam authored Apr 19, 2022
2 parents 381de1e + 52ababb commit ec13bfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions awsinspector_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,14 @@ def handle_action(self, param):
argparser.add_argument('input_test_json', help='Input Test JSON file')
argparser.add_argument('-u', '--username', help='username', required=False)
argparser.add_argument('-p', '--password', help='password', required=False)
argparser.add_argument('-v', '--verify', action='store_true', help='verify', required=False, default=False)

args = argparser.parse_args()
session_id = None

username = args.username
password = args.password
verify = args.verify

if (username is not None and password is None):

Expand All @@ -648,7 +650,7 @@ def handle_action(self, param):
login_url = BaseConnector._get_phantom_base_url() + "login"
try:
print("Accessing the Login page")
response = requests.get(login_url, verify=False)
response = requests.get(login_url, verify=verify, timeout=AWSINSPECTOR_DEFAULT_TIMEOUT)
csrftoken = response.cookies['csrftoken']

data = dict()
Expand All @@ -661,7 +663,7 @@ def handle_action(self, param):
headers['Referer'] = login_url

print("Logging into Platform to get the session id")
r2 = requests.post(login_url, verify=False, data=data, headers=headers)
r2 = requests.post(login_url, verify=verify, data=data, headers=headers, timeout=AWSINSPECTOR_DEFAULT_TIMEOUT)
session_id = r2.cookies['sessionid']
except Exception as e:
print("Unable to get session id from the platform. Error: {0}".format(str(e)))
Expand Down
1 change: 1 addition & 0 deletions awsinspector_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
}
AWSINSPECTOR_BAD_ASSET_CONFIG_MSG = 'Please provide access keys or select assume role check box in asset configuration'
AWSINSPECTOR_ROLE_CREDENTIALS_FAILURE_MSG = 'Failed to retrieve EC2 role credentials from instance'
AWSINSPECTOR_DEFAULT_TIMEOUT = 30

0 comments on commit ec13bfe

Please sign in to comment.