Skip to content

Comments

Security secure sandbox urls#1909

Open
matthewlouisbrockman wants to merge 47 commits intomainfrom
security-secure-sandbox-urls-eng-3487
Open

Security secure sandbox urls#1909
matthewlouisbrockman wants to merge 47 commits intomainfrom
security-secure-sandbox-urls-eng-3487

Conversation

@matthewlouisbrockman
Copy link
Contributor

@matthewlouisbrockman matthewlouisbrockman commented Feb 13, 2026

Check resuming sandbox has prior credentials over http when allow_public_traffic:false and envd when private are set.

Passes the relevant token via gRPC headers to the API which validates before allowing resuming.

@linear
Copy link

linear bot commented Feb 13, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21f37f5335

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@matthewlouisbrockman matthewlouisbrockman added the improvement Improvement for current functionality label Feb 13, 2026
@ValentaTomas ValentaTomas changed the title Security secure sandbox urls eng 3487 Security secure sandbox urls Feb 13, 2026
@jakubno jakubno self-assigned this Feb 16, 2026
Comment on lines 97 to 111
isNonEnvdTraffic := true
if vals := incomingMetadata.Get(proxygrpc.MetadataSandboxRequestPort); len(vals) > 0 {
requestPort, parseErr := strconv.ParseUint(vals[0], 10, 64)
if parseErr != nil {
logger.L().Warn(
ctx,
"invalid sandbox request port metadata for resume",
zap.Error(parseErr),
zap.String("request_port", vals[0]),
logger.WithSandboxID(sandboxID),
)
} else {
isNonEnvdTraffic = requestPort != uint64(consts.DefaultEnvdServerPort)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be handled in some helper function?

}

// Validate traffic access token for sandboxes with private ingress.
if network != nil && network.Ingress != nil && network.Ingress.AllowPublicAccess != nil && !*network.Ingress.AllowPublicAccess && isNonEnvdTraffic {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you do basically the same for envdTraffic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - was considering it out of scope (we weren't doing auth) but makes sense to include it! will get that in

@matthewlouisbrockman
Copy link
Contributor Author

moving to draft while looking at the auth

@matthewlouisbrockman
Copy link
Contributor Author

added the envd check to this as well

Copy link
Member

@jakubno jakubno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few nits

return network != nil && network.Ingress != nil && network.Ingress.AllowPublicAccess != nil && !*network.Ingress.AllowPublicAccess
}

func tokensMatch(providedToken string, expectedToken string) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain why we can't just compare the strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was using subtle.ConstantTimeCompare to avoid doing direct string comparisong - #1909 (comment) was complaining about it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*am using. if there's not enough variance that it's not a real concern can go back to the original string comparison

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement for current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants