-
Notifications
You must be signed in to change notification settings - Fork 336
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
Add perms to assets in GCS #10773
Comments
did some more research. from slack: options for security are:
The thing that I don't get is why notion went with the 3rd option. It requires an extra service + an extra round trip for each asset! Essentially it's like cloud CDN, but they control the CDN so they don't need to mange 3rd party cookies. Asking GPT why, it suggested short TTLs so folks can't hotlink the asset. we could do that too. DDoS prevention, but again I don't see that as valid because notion still 302s to the presigned URL so someone could still hit that URL until it expires. Other reasons notion may take this approach:
I don't see a killer reason for the added complexity (i.e. an image proxy server).
|
Just one note on the file stores: whatever we implement, we should do it for both AWS and GCP. I've been reading on signed cookies over GCP Cloud CDN, and I actually think it's the best approach for us, that would allow us to better structure our bucket as well. Our use case fits exactly on their recommended use cases for cookies. For example, say we decide images are available only for organization members only. We should then upload images to a folder in that org, instead of on the folder of the user, and we could just generate the cookie (and refresh it when necessary) for users that are part of that org. That would simplify a lot the access management and reduce/eliminate the need of signing hundreds or thousands of urls multiple times. It's just one cookie to sign per user each X time vs multiple urls to sign per user each X time. We would also use prefixes to control the access. In this case, urls would still be our urls (action-files.parabol.co/whatever), which is also nice, but would only work if the user cookie is valid. And we could have short living cookies if we wish. I really think this is the correct approach for us, we just need to structure our bucket a little bit (most of the work is already done!). We could make images available only if you are part of the org, part of the team, part of the meeting even! and in the future we could do it by activity/pages or whatever we wish. We also need to test if we can implement this starting with public buckets, I'm quite sure the answer is yes and the transition would be quite easy. Could you hold this work off until I'm back? I really really would like to explore this design with you, once I'm back in March 5th. |
those are good points! I've got 2 tensions with using signed cookies:
|
The first point is interesting and for sure harder in terms of engineering, which is great. I think that could be solved with a correct path structure in our buckets (like a foldr per page with its documents inside of it) + cookies with small TTLs (say minutes our 1h max) to whoever have access when it requires access. That said, I haven't spent enough time thinking and reading about this for now, and sadly I wouldn't be able to do it today.
As in, they cannot use CloudFront or they are just not using it at the moment? If it's a possibility, we shouldn't get it off the table IMHO. @dbumblis-parabol do you know/can ask if there is any change they might create a CloudFront distribution in front of an AWS S3 bucket for security reasons? |
that implies:
|
No, you are right 😸 as I said, I haven't spent the time thinking this thoroughly. I would like to spend at least a day going through this. Do you know how Confluence does this? |
I think that's why notion went with the 3rd approach. This way you can decouple the image permissions from the rest of the application logic and distribute the load better. |
don't know, don't care 🤣 Atlassian engineering is bottom of the barrel. if we had the time & resources, i'd say we go for the notion approach because then we could handle permissions in a whole separate microservice, but that would also mean more resources, both human & compute. That said, handling them in a gql resolve function that reduces a roundtrip? Pretty darn good IMO... |
AC
https://parabol.slack.com/archives/C836NA350/p1738279429094589?thread_ts=1738256782.141939&cid=C836NA350
The text was updated successfully, but these errors were encountered: