Conversation
Add @requires_admin decorator Add clarity to backend start error status Signed-off-by: Ulincsys <ulincsys@gmail.com>
- Add ssl decorator to config endpoints - Fix syntax error in admin_required decorator - Update dashboard endpoint to use config class directly - Update dashboard styles with more consistent colors - Implement config update functionality in admin dashboard Signed-off-by: Ulincsys <28362836a@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
| if signal.getsignal(signal.SIGHUP) != signal.SIG_DFL: | ||
| cmd = "nohup " + cmd | ||
|
|
||
| Popen(cmd, shell=True) |
Check failure
Code scanning / Bandit
subprocess call with shell=True identified, security issue. Error
| from ..server import app | ||
| import sqlalchemy as s | ||
| import json | ||
| from subprocess import run, PIPE, Popen |
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
| @app.route(f"/{AUGUR_API_VERSION}/admin/shutdown") | ||
| @admin_required | ||
| def shutdown_system(): | ||
| run("augur backend stop-collection-blocking".split(), stdin=PIPE, stdout=PIPE, stderr=PIPE) |
Check notice
Code scanning / Bandit
subprocess call - check for execution of untrusted input. Note
| @admin_required | ||
| def shutdown_system(): | ||
| run("augur backend stop-collection-blocking".split(), stdin=PIPE, stdout=PIPE, stderr=PIPE) | ||
| Popen("augur backend stop", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) |
Check notice
Code scanning / Bandit
Starting a process with a partial executable path Note
| @admin_required | ||
| def shutdown_system(): | ||
| run("augur backend stop-collection-blocking".split(), stdin=PIPE, stdout=PIPE, stderr=PIPE) | ||
| Popen("augur backend stop", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) |
Check notice
Code scanning / Bandit
subprocess call with shell=True seems safe, but may be changed in the future, consider rewriting without shell Note
| @@ -0,0 +1,29 @@ | |||
| from subprocess import run, PIPE, Popen | |||
Check notice
Code scanning / Bandit
Consider possible security implications associated with the subprocess module. Note
| # Ignore SIGTERM from parent process (since we're terminating our parent) | ||
| signal.signal(signal.SIGTERM, lambda signum, frame: None) | ||
|
|
||
| run("augur backend stop-collection-blocking", shell=True, stderr=PIPE, stdout=PIPE, stdin=PIPE) |
Check notice
Code scanning / Bandit
Starting a process with a partial executable path Note
| # Ignore SIGTERM from parent process (since we're terminating our parent) | ||
| signal.signal(signal.SIGTERM, lambda signum, frame: None) | ||
|
|
||
| run("augur backend stop-collection-blocking", shell=True, stderr=PIPE, stdout=PIPE, stdin=PIPE) |
Check notice
Code scanning / Bandit
subprocess call with shell=True seems safe, but may be changed in the future, consider rewriting without shell Note
| signal.signal(signal.SIGTERM, lambda signum, frame: None) | ||
|
|
||
| run("augur backend stop-collection-blocking", shell=True, stderr=PIPE, stdout=PIPE, stdin=PIPE) | ||
| Popen("augur backend stop", shell=True, stderr=PIPE, stdout=PIPE, stdin=PIPE).wait() |
Check notice
Code scanning / Bandit
Starting a process with a partial executable path Note
| signal.signal(signal.SIGTERM, lambda signum, frame: None) | ||
|
|
||
| run("augur backend stop-collection-blocking", shell=True, stderr=PIPE, stdout=PIPE, stdin=PIPE) | ||
| Popen("augur backend stop", shell=True, stderr=PIPE, stdout=PIPE, stdin=PIPE).wait() |
Check notice
Code scanning / Bandit
subprocess call with shell=True seems safe, but may be changed in the future, consider rewriting without shell Note
| import beaker | ||
|
|
||
| from flask import request, jsonify, current_app | ||
| from flask import request, jsonify, current_app, abort |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused current_app imported from flask (unused-import)
| @@ -38,6 +40,13 @@ def unsupported_method(error): | |||
|
|
|||
| return render_message("405 - Method not supported", "The resource you are trying to access does not support the request method used"), 405 | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_message' (undefined-variable)
| if AUGUR_API_VERSION in str(request.url_rule): | ||
| return jsonify({"status": "Forbidden"}), 403 | ||
|
|
||
| return render_message("403 - Forbidden", "You do not have permission to view this page"), 403 |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_message' (undefined-variable)
| raise e | ||
|
|
||
| return render_message("500 - Internal Server Error", "An error occurred while trying to service your request. Please try again, and if the issue persists, please file a GitHub issue with the below error message:", error=stacktrace), 500 | ||
| return render_message("500 - Internal Server Error", """An error occurred while trying to service your request. |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_message' (undefined-variable)
| @@ -98,19 +120,16 @@ def load_user(user_id): | |||
| @login_manager.request_loader | |||
| def load_user_request(request): | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0621: Redefining name 'request' from outer scope (line 1) (redefined-outer-name)
| from .init import logger | ||
| from .url_converters import * | ||
|
|
||
| from functools import wraps |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused wraps imported from functools (unused-import)
| @@ -112,6 +119,10 @@ def repo_card_view(): | |||
| @app.route('/collection/status') | |||
| def status_view(): | |||
| return render_module("status", title="Status") | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_module' (undefined-variable)
|
|
||
| @app.route('/connection_status') | ||
| def server_ping_frontend(): | ||
| return render_module("ping") |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_module' (undefined-variable)
| @@ -318,6 +329,7 @@ def user_group_view(group = None): | |||
| return render_module("user-group-repos-table", title="Repos", repos=data, query_key=query, activePage=params["page"], pages=page_count, offset=pagination_offset, PS="user_group_view", reverse = rev, sorting = params.get("sort"), group=group) | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_module' (undefined-variable)
| backend_config = requestJson("config/get", False) | ||
| backend_config = AugurConfig(logger, db_session).load_config() | ||
|
|
||
| with get_session() as session: |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0621: Redefining name 'session' from outer scope (line 8) (redefined-outer-name)
Description
admin_requireddecorator to protect admin routesNotes for Reviewers
augur user addcommand with the--adminflagSigned commits