Skip to content

Commit 6f25326

Browse files
authored
Adding security warnings to Flask RPCServer (#564)
* Adding security warnings to Flask RPCServer * lint * changing documentation url * f-string * codacy analysis
1 parent 16416af commit 6f25326

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎fugue/rpc/flask.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(self, conf: Any):
6060
-1.0 if timeout is None else to_timedelta(timeout).total_seconds()
6161
)
6262
self._server: Optional[FlaskRPCServer._Thread] = None
63+
self._log = logging.getLogger()
6364

6465
def make_client(self, handler: Any) -> RPCClient:
6566
"""Add ``handler`` and correspondent :class:`~.FlaskRPCClient`
@@ -77,6 +78,14 @@ def make_client(self, handler: Any) -> RPCClient:
7778

7879
def start_server(self) -> None:
7980
"""Start Flask RPC server"""
81+
msg = (
82+
"Starting RPC server on %s:%s. "
83+
"This server has no authentication and relies on network isolation. "
84+
"Ensure proper VPC/firewall configuration in production. "
85+
"See https://fugue-tutorials.readthedocs.io/tutorials/resources/"
86+
"security.html"
87+
)
88+
self._log.warning(msg, self._host, self._port)
8089
app = Flask("FlaskRPCServer")
8190
app.route("/invoke", methods=["POST"])(self._invoke)
8291
self._server = FlaskRPCServer._Thread(app, self._host, self._port)

0 commit comments

Comments
 (0)