Skip to content
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

INTERNALS/MAIN.GO: line 107: is writing the path in the proxy URL like this a privacy breech? #65

Closed
5 tasks
stravid87 opened this issue Dec 20, 2023 · 7 comments · Fixed by globe-and-citizen/layer8-interceptor#27 or globe-and-citizen/layer8-middleware#22
Assignees

Comments

@stravid87
Copy link
Contributor

stravid87 commented Dec 20, 2023

Description

Line 107 of the interceptor: is writing the path in the proxy URL like this a privacy breech?
r, err := http.NewRequest("POST", c.proxyURL+parsedURL.Path, bytes.NewBuffer(data))
This parsedURL.Path should really only be accessible to the S.P.
This information is carried to line 160 of server/tunnel.go

Requirements:

Tasks

Acceptance Criteria

When a frontend user creates a get, post, or other request type, this information should be fully hidden from the proxy and transmitted as part of the encrypted body only. The Service Provider should be able to access this information within the node.js backend by invoking the properties:

app.post[get]("/", (req, res) => {
  console.log(req.query); // an object containing a property for each query string parameter in the route
  console.log(req.path); // Contains the path part of the request URL.
});

Reference:
https://expressjs.com/en/api.html#req.path
https://expressjs.com/en/api.html#req.path

@stravid87
Copy link
Contributor Author

Currently this is now:

	backendURL := fmt.Sprintf(os.Getenv("VITE_BACKEND")+"%s", r.URL)
	// backendURL := fmt.Sprintf("https://%s%s", r.Header.Get("X-Forwarded-Host"), r.URL)

in server/handlers/tunnel.go

The path needs to be encrypted.

@stravid87 stravid87 transferred this issue from globe-and-citizen/layer8_dep May 21, 2024
@stravid87
Copy link
Contributor Author

Note, Marc has requested to have access to params.
To solve this issue can be a challenge but should very much be possible.
The URL path and query params should be scrapped from the URL by the interceptor as well as the query params.
These should then be encrypted and transited through the proxy for decryption and attachment in the middleware such that the service provider receives them like normal and the proxy is ignorant to them.

@stravid87
Copy link
Contributor Author

Nice work. Done & done.

@stravid87 stravid87 reopened this Jul 3, 2024
@stravid87
Copy link
Contributor Author

stravid87 commented Jul 8, 2024

July 8 - 15

  • Add encrypted URL into the body during the Static function (effectively done)
  • Continue with experimentation on decrypting the body in the Middleware to get the URL back

@stravid87
Copy link
Contributor Author

July 16 - 22

  • Open a formal PR on the Interceptor and Middleware for Daniel (+/- myself to review)

@stravid87
Copy link
Contributor Author

July 29

@stravid87
Copy link
Contributor Author

stravid87 commented Aug 5, 2024

Aug 5, 2024

Can we make the "/media" call on Line 644 in 'interceptro.go' dynamic?
Line 55 of server.go should be configurable to any string and still work if configured correctly in the frontend.

@stravid87 stravid87 closed this as completed by moving to Merged in Layer8 Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment