Skip to content

Commit 231e3dd

Browse files
committed
Make sure this is only run locally for now
1 parent 5af65c3 commit 231e3dd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

gcp/website/triage_handlers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@
66
from flask import Blueprint, request, jsonify, render_template
77
from google.cloud import storage
88

9+
import utils
10+
911
blueprint = Blueprint('triage_handlers', __name__)
1012

13+
@blueprint.before_request
14+
def restrict_to_local():
15+
"""Restrict triage handlers to local environment."""
16+
if utils.is_cloud_run():
17+
return jsonify({'error': 'This tool is only available locally.'}), 403
18+
19+
1120
_CVE_ID_REGEX = re.compile(r'^CVE-\d{4}-\d+$', re.IGNORECASE)
1221
_STORAGE_CLIENT = None
1322

0 commit comments

Comments
 (0)