Skip to content
Open
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
16 changes: 4 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@


def never_called(bla):
aws_access_token = os.getenv("AWS_ACCESS_TOKEN")
# Keep aws access token in enviroment variable
command = ['echo', str(aws_access_token)]
subprocess.Popen(command)
# os.subprocess.Popen('echo ${}'.format(aws_access_token), shell=True)
aws_access_token = "AKIALALEMEL33243OLIB"

Check notice

Code scanning / Bandit

Possible hardcoded password: 'AKIALALEMEL33243OLIB'

Possible hardcoded password: 'AKIALALEMEL33243OLIB'
os.subprocess.Popen('echo ${}'.format(aws_access_token), shell=True)

Check warning

Code scanning / Bandit

Function call with shell=True parameter identified, possible security issue.

Function call with shell=True parameter identified, possible security issue.


def serve_image(state):
Expand All @@ -23,12 +20,7 @@ def serve_image(state):
@app.route("/")
def hello_world():
try:
timeout_value = 10
workflow_runs = requests.get(workflow_runs_url.format(repo)), timeout=timeout_value).json()['workflow_runs']
except requests.Timeout:
print("Request timed out. Please handle this situation accordingly.")
except requests.RequestException as e:
print(f"An error occurred: {e}")
workflow_runs = requests.get(workflow_runs_url.format(repo)).json()['workflow_runs']

Check warning

Code scanning / Bandit

Requests call without timeout

Requests call without timeout
workflow_states = {}
for workflow in workflows:
relevant_workflows = list(filter(lambda x: x['name'] == workflow, workflow_runs))[0]
Expand All @@ -39,7 +31,7 @@ def hello_world():


def main():
app.run(debug=False)
app.run(debug=True)

Check failure

Code scanning / Bandit

A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and allows the execution of arbitrary code.

A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and allows the execution of arbitrary code.


if __name__ == '__main__':
Expand Down