Skip to content

Provide more guidance on invalid allowed_outbound_hosts #3152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

itowlson
Copy link
Collaborator

@itowlson itowlson commented Jun 5, 2025

Fixes fermyon/feedback#61

I added a "learn more" to the output:

# allowed_outbound_hosts = ["localhost"]

$ spin up
Error: Failed to load application

Caused by:
   0: Failed to load manifest from "spin.toml"
   1: Failed to load Spin app from "spin.toml"
   2: Failed to load component `outbound-bad-wildcard`
   3: `allowed_outbound_hosts` is malformed
   4: "localhost" does not contain a scheme (e.g., 'http://' or '*://')
Learn more: https://spinframework.dev/v3/http-outbound#granting-http-permissions-to-components

and special-cased some things that people might guess for wildcard syntax:

# allowed_outbound_hosts = ["*"]

$ spin up
Error: Failed to load application

Caused by:
   0: Failed to load manifest from "spin.toml"
   1: Failed to load Spin app from "spin.toml"
   2: Failed to load component `outbound-bad-wildcard`
   3: `allowed_outbound_hosts` is malformed
   4: "*" is not an allowed outbound host format.
Hosts must be in the form <scheme>://<host>[:<port>], with '*' wildcards allowed for each.
If you intended to allow all outbound networking, you can use '*://*:*' - this will obviate all network sandboxing.
Learn more: https://spinframework.dev/v3/http-outbound#granting-http-permissions-to-components

@itowlson itowlson force-pushed the allowed-hosts-explain-why-not branch from f18f2cc to 70c2020 Compare June 5, 2025 22:25
@itowlson itowlson merged commit fd62274 into spinframework:main Jun 6, 2025
17 checks passed
@rylev
Copy link
Collaborator

rylev commented Jun 6, 2025

@itowlson drive-by thought - should we alias * to *://*:*?

@lann
Copy link
Collaborator

lann commented Jun 6, 2025

@itowlson drive-by thought - should we alias * to *://*:*?

That was suggested in the issue. My reply:

There are two different "allow anythings": https://*:* (allow http to anything) and *://*:* allow any protocol to anything (via wasi:sockets).

Also, we're trying to nudge people to take advantage of Spin's better-than-status-quo sandboxing; getting someone to stop and think about whether they really need * is part of that.
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to allow any outbound host?
4 participants