Issue 8 - Serverless. Case Study - Service Security - What's Left To Protect
Issue 8 - Serverless. Case Study - Service Security - What's Left To Protect
html
We are delighted to be able to share our eighth monthly architects' newsletter with you, which we will send on the last Friday of every month. InfoQ
strives to facilitate the spread of knowledge and innovation within this space, and in this newsletter we aim to curate and summarise key learnings
from news items, articles and presentations created by industry peers, both on InfoQ and across the web. We aim to keep readers informed and
educated about emerging trends, peer-validated early adoption of technologies, and architectural best practices, and are always keen to receive
feedback from our readers.
News
Gruhl discusses the use of a "distributed ledger" pattern -- an immutable, replicated, partitioned, distributed, append-only log with multi-reader
capability -- via Kinesis Data Streams. There are several benefits from leveraging this pattern, one example being able to replay streams when issues
emerge, "from moving the backpressure you have from your consumers off of your producers, from having multiple consumers of the same stream,
even new versions of old systems running in parallel while in development". A key takeaway from the article is the benefits from embracing event-
driven architecture when working with FaaS technologies: "you just naturally start thinking in terms of events when you go serverless. It's very
impedance-matched to the technology".
Gloo provides a unified entry point for access to all services and serverless functions, translating from any client-facing API to any backend function.
The gateway also aggregates HTTP/REST APIs and events from clients, "glueing" together functions "in-cluster, out of cluster, across clusters, along
with any provider of serverless functions". Gloo features a pluggable architecture, with an extendable configuration language, pluggable upstream
types, discovery services, and internal components.
AWS introduced the Serverless Application Model (SAM) at re:Invent 2016 with the goal to make it easier to "manage and deploy serverless
applications on AWS". AWS then followed up with the Docker-based SAM Local so that developers can test functions locally via simulating an API
Gateway and enabling the generation of sample payloads for various event sources. AWS has now added the Serverless Application Repository as a
dedicated packaging, discovery and provisioning service for SAM applications. Similar to the still available blueprints feature, it integrates with the
AWS Lambda console's create function wizard to guide users through the discovery and deployment steps.
This edition of The Software Architects' Newsletter is brought to you by:
• Java - Avoids using Web Archive or Enterprise Archive files; Components are not auto-deployed. Instead, Docker containers or Amazon
Machine Images are auto-deployed.
• .NET - Building a .NET self-hosted web service using Open Web Interface for .NET (OWIN). You can then use it to incorporate microservices.
• Python - It’s easy to create a Python service that acts as a front-end web service for microservices in other languages such as ASP or PHP.
Case Study
Although the term "serverless" is a misnomer -- serverless technologies still use servers (and OS containers) behind the scenes -- FaaS vendors do
take on the responsibility for "patching" the underlying servers, freeing engineers from OS patching. Known vulnerabilities in unpatched servers and
apps are the primary vector through which systems are exploited, due to their frequency and broad deployment, along with the fact that updating apps
and servers at scale is hard.
The elastic nature of FaaS platforms means that Denial of Service (DoS) attacks are naturally thwarted by the (presumed) infinite capacity offered by
serverless solutions, although Podjarny warned in his talk that this can have serious financial implications without proper account scaling limits in
place.
The finer granularity of application code (functions versus microservices/monoliths) lets engineers implement the "least privilege" concept well,
minimizing the damage a compromised function can cause -- in theory. In practice, however, managing granular permissions for hundreds or
thousands of functions is very hard to do unless automation is used. Podjarny recommends watching Aaron Kammerer's talk explaining (amongst
other Serverless Ops topics) how iRobot auto tunes Lambda permissions.
While FaaS platforms handle the server-level security concerns, it cannot be expected that attackers will simply give up! Instead, they will shift their
attention to the areas that remain exposed - and first amongst those would be the application itself. The chance a given function will have a SQL
Injection, Cross-Site Scripting or Command Injection vulnerability is neither higher or lower with Serverless, but these vectors may get extra attention
from attackers in the FaaS world. API gateways also offer an opportunity to create schemas and whitelists that reduce the chance of a malicious input
making its way in.
A key takeaway for function developers is that the responsibility for addressing vulnerable third-party application libraries and dependencies lies firmly
with them. Podjarny suggests that when developing functions, the developer must continuously monitor for and fix known vulnerabilities within
libraries, using tools such as Snyk, Victims DB, or the OWASP Dependency check. More can be learnt about this in Podjarny's book, "Securing Open
Source Libraries", which is also available in a series of posts on the O'Reilly blog.
Additional information on securing serverless applications can be found in Jeremy Daly's blog post "Securing Serverless: A Newbie's Guide", which
discusses implementation details in more depth, and also provides several useful references. For engineers looking for a practical introduction to
securing their own serverless platform using OpenFaaS, Daniel Shapira has written "Securing Kubernetes for OpenFaaS and beyond", which
demonstrates how to override basic platform defaults and enable isolation between pods and implement authentication.
The upcoming introduction of the General Data Protection Regulation (GDPR), which will apply to any organisation working with data from the
European Union (EU), adds even more impetus for ensuring infrastructure is secure. In a recent InfoQ article, "GDPR for Operations", Jon Topper has
explored this topic in depth.
To get notifications when InfoQ publishes content on this topic follow Serverless on InfoQ.
This is the eighth issue of a monthly newsletter, focusing exclusively on software architecture. We thought it would be valuable for you to get a quick
overview of things you might like to keep an eye on. If this is not the case, you can unsubscribe using the link below.