Security and the Twelve-Factor App - Step 8
A blog series by WhiteHat Security
May 13, 2019

Eric Sheridan
WhiteHat Security

In the previous blog of this WhiteHat Security series, the Twelve-Factor App looked at exporting services via port binding and included advice on what to apply from a security point of view.

We now move on to Step 8 of the Twelve-Factor App, which recommends scaling out via the process model discussed in Step 7.

Start with Security and the Twelve-Factor App - Step 1
Start with Security and the Twelve-Factor App - Step 2
Start with Security and the Twelve-Factor App - Step 3
Start with Security and the Twelve-Factor App - Step 4
Start with Security and the Twelve-Factor App - Step 5
Start with Security and the Twelve-Factor App - Step 6
Start with Security and the Twelve-Factor App - Step 7

Defining Concurrency in the Twelve-Factor App

A simple explanation for this factor is to picture a lot of little processes handling specific requirements, such as web requests, API calls, or sending tweets. Keeping all these working independently means that the application will scale better, and you’ll be able to manage more activities concurrently.

According to the Twelve-factor app, processes are a first class citizen, in which processes take strong cues from the unix process model for running service daemons. Twelve-Factor goes on to say that by using this model, the developer can architect the app to handle diverse workloads by assigning each type of work to a process type. For example, HTTP requests may be handled by a web process, and long-running background tasks handled by a worker process.

Applying Security to Step 8

The security challenge to this step is that the ability to scale requires paying attention to APIs that are known to introduce Denial of Service issues. One such API is known as "readLine". Implementations of this method are available on almost every software development platform and yet is subject to Denial of Service. "readLine" will continuously read bytes from a given input stream until a newline character is found. Assume the attacker controls that stream… what if the attacker never provides a newline character? What will happen? More often than not, this will result in errors and stability issues stemming from memory exhaustion.

Two simple processes can be implemented to strengthen the security posture of this step:

1. Ban DoS-able API i.e. Document relevant DoS-able API for your platform (such as readLine) and ban them

2. Resource Closure i.e. Expose simplistic patterns to facilitate closing of I/O resources (e.g. scope)

In the next blog we will cover Step 9, Disposability, which is all about maximizing robustness with fast startup and a graceful shutdown, and what this means from a security point of view.

Read Security and the Twelve-Factor App - Step 9

Eric Sheridan is Chief Scientist at WhiteHat Security
Share this

Industry News

September 17, 2020

env0, a developer of Infrastructure-as-Code (IaC) management software, announced the availability of its new open source solution for Terraform users, Terratag.

September 17, 2020

Push Technology announced a partnership with Innova Solutions, an ACS Solutions company, specializing in global information technology services.

September 17, 2020

Alcide achieved the AWS Outposts Ready designation, part of the Amazon Web Services (AWS) Service Ready Program.

September 16, 2020

Portshift announced serverless container security support for AWS Fargate.

September 16, 2020

Sonatype and NeuVector announced a new integration that provides a comprehensive view of all Kubernetes and Container open source risk in one place.

September 16, 2020

Pure Storage entered into a definitive agreement to acquire Portworx, a Kubernetes data services platform enterprises trust to run mission-critical applications in containers in production.

September 15, 2020

OutSystems announced a series of new tools and capabilities that will empower organizations of all sizes to build applications quickly, build them right, and build them for the future.

September 15, 2020

VMware unveiled new offerings to help customers further accelerate their app and infrastructure modernization initiatives. VMware vSphere 7 Update 1, VMware vSAN 7 Update 1 and VMware Cloud Foundation 4.1 product releases streamline customer adoption of Kubernetes and support stateful applications with new developer-ready capabilities and enhance scalability and operations with new features.

September 15, 2020

Oracle announced the general availability of Java 15 (Oracle JDK 15).

September 14, 2020

Actifio announced a global alliance with Persistent Systems, a global solutions company with deep technology expertise, to help enterprises with data stack modernization and acceleration of digital transformation initiatives.

September 14, 2020

Perforce Software announced the release of the Helix TeamHub Command-Line Client (hth-cli).

September 14, 2020

StackRox secured an additional $26.5 million in funding.

September 10, 2020

JourneyApps announced the official launch of its OXIDE Integrated Development Environment (IDE) which ushers in a new paradigm of building, deploying and managing secure and powerful business applications.

September 10, 2020

Solo.io announced the WebAssembly OCI Image Specification, which defines a standard format for bundling and storing a Wasm module and its metadata as an OCI (Open Container Initiative) image in order to facilitate interoperability across different solutions.

September 10, 2020

Flexential announced new dedicated Hosted Private Cloud - vCenter Access capabilities that enable organizations to use industry-leading third-party tools to manage workloads and data protection requirements on a single, consolidated cloud platform.