Skip to content

Commit ca35a6a

Browse files
committed
security: default ogx go to localhost instead of all interfaces
The generated config now sets server.host to 127.0.0.1, preventing accidental exposure of the server to the network. A new --host flag allows users to explicitly bind to a different address. Signed-off-by: Matthew Farrellee <matt@cs.wisc.edu>
1 parent 26c1463 commit ca35a6a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/ogx/cli/stack/lets_go.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ def add_letsgo_arguments(parser: argparse.ArgumentParser) -> None:
210210
default=False,
211211
help="Allow running without TLS certificates. Disables FIPS enforcement. For local development only.",
212212
)
213+
parser.add_argument(
214+
"--host",
215+
type=str,
216+
default="127.0.0.1",
217+
help="Host to bind the server to",
218+
)
213219

214220

215221
def _add_file_search_and_responses(run_config: StackConfig) -> None:
@@ -471,6 +477,8 @@ async def _run_letsgo_cmd_impl(args: argparse.Namespace, parser: argparse.Argume
471477
config_dict["server"]["insecure"] = False
472478
cprint(f" ✓ Generated self-signed TLS certificate → {cert_path}", color="green")
473479

480+
config_dict["server"]["host"] = args.host
481+
474482
config_file = distro_dir / "config.yaml"
475483
logger.info("Writing generated config to", config_file=config_file)
476484
with open(config_file, "w") as f:

0 commit comments

Comments
 (0)