3 ms·
This code scares me: https://github.com/transcend-io/beyondcorp-cloudfront/blob/master/src/handleNoAuth.js https://github.com/transcend-io/beyondcorp-cloudfront
by ec109685 6y ago
This code scares me:
https://github.com/transcend-io/beyondcorp-cloudfront/blob/master/src/handleNoAuth.js https://github.com/transcend-io/beyondcorp-cloudfront/blob/m...
This encourages a behavior of copy and pasted authentication javascript from service to service.
The ALB approach from the article at least centralizes the SSO dance in one place, but still a typo in terraform would be very hard to detect.
The BeyondCorp approach Google uses, as far as I know, relies on sophisticated proxy servers in front of ALL protected services to ensure the very tricky aspects like posture assessments, zero day patching, logging, rate limiting and other security best practices are handled in one place.
With a scattershot approach, companies may not be open to a VPN exploit anymore, but may have opened themselves up to many more individual exploits and much slower reaction times when an exploit is found.
- paranoidrobot 6y agoPerhaps I don't see what you see, but this is server-side javascript (cloudfront calling a 'lambda at edge' function - similar to Cloudflare Workers). What's particularly scary about it? As for "a typo in terraform would be very hard to detect" - perhaps, yes, assuming it didn't fail outright. To mitigate that I'd expect anyone deploying this for real to protect anything valuable would ensure unit tests were written for the Javascript and to have code reviews of any security-sensitive code like this.
- ec109685 6y agoI don't think individual development teams should be hosting this code in their own services. Instead, they should declaratively specify the rules on what roles can do what, and rely on another layer to honor those requirements.