September 11, 2018
Hey, Everyone! Welcome to Issue #2 of Off-by-none. Thanks so much for being here. 🙌
Last week we talked about the goal of Off-by-none and introduced a new way to think about managing MySQL connections at serverless scale. This week, I want to focus on security, and how we can use cloud provider tools, common sense strategies, and other vendor solutions to lock down our serverless applications.
Here we go! 🚀
Not too long ago, 54% of the NPM ecosystem was compromised by using a series of brute force attacks, leaked datasets, and fuzzing passwords. NPM has continued to add more protections to mitigate these types of risks, but nothing is foolproof. Sometimes, the developers using them are to blame for installing malware with similar names to popular packages. As with the NPM hack above, sometimes the compromised dependency could be way down the dependency chain. This could leave your application, user data, credentials, and even access keys, extremely vulnerable.
This isn't meant to scare you away from serverless. In fact, the issues above aren't even specific to serverless. However, the built-in scalability of FaaS is what can exacerbate an attack by spinning up thousands of functions to do a hacker's bidding. So, when building serverless applications, we want to do whatever we can to minimize these types of risks.
There are some serverless security basics that developers should really know. These will go a long way to mitigating a number of popular attack vectors. Serverless also requires us to think about event injection since many of our functions will be processing events without protection from WAFs or WSGs. But beyond the basics, we still run the risk of compromised third-party packages leaking sensitive information when we run our functions.
I had conversation with Ory Segal, the CTO at PureSec about this and gave their free FunctionShield product a try. I wrote a posts called Serverless Security: Locking Down Your Apps with FunctionShield which tests it out and goes through the pros and cons. Perhaps some day the cloud providers will add additional security controls, but until then, I really think this is worth a look.
Troy Hunt, creator of haveibeenpwned.com, wrote an excellent post about how it only costs him 2.6 cents per day to support 141M monthly queries of 517M records. Yeah, I didn't quite believe it at first either, but read the post and see for yourself: Serverless to the Max: Doing Big Things for Small Dollars with Cloudflare Workers and Azure Functions. 💰
Sam Bashton over at runbook.cloud threw some shade at Ben Kehoe with his How We Massively Reduced Our AWS Lambda Bill With Go post. He argues that single thread, single task functions are NOT always the best choice for serverless. Several people (including myself) weighed in on the Twitter debate. 😬
The New Stack had a chat with Nate Taggart from Stackery and discussed Serverless Analytics: Metrics, Collection and Visibility. Some interesting bits in there about the challenges with tracing, logging and observability in serverless applications. 🔭
And speaking of tracing, AWS X-Ray Now Supports Amazon API Gateway and New Sampling Rules API. This was a huge missing feature of X-Ray. I've haven't tried it yet, but it is on my list of things to do. 📝
Jeff Barr not only gave a ringing endorsement of Marcia Villalba's new Getting Started with AWS SAM video series, but also tweeted a link (with one of his classic screenshots) to Lambda API. If you're not familiar with Lambda API, it's a lightweight web framework, built specifically for serverless applications. It's similar to to ExpressJS and Fastify, just ridiculously smaller with ZERO dependencies.
I think we all know by now that minimizing dependencies helps to secure and speed up our serverless apps. But size matters too. The other day I had put together this infographic that shows the comparison between the
node_modules directories of different web frameworks and their total package sizes:
These libraries are great for servers, but Lambda API is so small, it adds almost nothing to your cold start times. There is an important lesson here, especially when you follow the “single purpose” best practice.
There are a few webinars coming up that look extremely interesting. These are all AWS Online Tech Talks, so they are free to attend. I've been looking for webinars from other providers as well, but Amazon seems to be the leader here. If you know of any great webinars coming up, please let me know.
There is a very long list of people that are doing #ServerlessGood and contributing to the Serverless community. These people deserve recognition for their efforts. So each week, I will mention someone whose recent contribution really stood out to me. I love meeting new people, so if you know someone who deserves recognition, please let me know.
He's also got another great post that looks at Containers vs. Serverless from a DevOps standpoint. Excellent read for those of you looking for an apples-to-apples comparison.
Security is an extremely important consideration when building our serverless applications. And since developers are now much closer to the execution environment, we must remember that with great power comes great responsibility. I think it's imperative that the serverless community continues to focus on security best practices, and I hope all of us will continue to do our part.
I hope you enjoyed this issue of Off-by-none. Please send me your feedback so I can continue to make this newsletter better each week. Reach out via Twitter, LinkedIn, Facebook, or email and let me know your thoughts, criticisms, or even how you’d like to contribute to Off-by-none.
Go build some great (and secure) serverless apps. Hope to see you next week!
Stay up to date on using serverless to build modern applications in the cloud. Get insights from experts, product releases, industry happenings, tutorials and much more, every week!
Check out all our amazing sponsors and find out how you can help spread the #serverless word by sponsoring an issue.
Jeremy is the GM of Serverless Cloud at Serverless, Inc. and an AWS Serverless Hero that has a soft spot for helping people solve problems using serverless. He frequently consults with companies and developers transitioning away from the traditional “server-full” approach. You can find him ranting about serverless on Twitter, in several forums and Slack groups, hosting the Serverless Chats podcast, and at (virtual) conferences around the world.
Off-by-none is committed to celebrating the diversity of the serverless community and recognizing the people who make it awesome. If you know of someone doing amazing things with serverless, please nominate them to be a Serverless Star ⭐️!