Security and the Twelve-Factor App - Step 7
A blog series by WhiteHat Security
April 08, 2019

Eric Sheridan
WhiteHat Security

The previous blog in this WhiteHat Security series recommended executing the app as one or more stateless processes by using small programs that communicate over the network. From a security standpoint it’s key to always assume that all process inputs are controlled by hackers, and create one or more processes that are dedicated exclusively to security services.

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

Step 7 of the Twelve-Factor App focuses on exporting services via port binding, and what to apply from a security point of view. Here is some actionable security-focused advice which developers and ops engineers can follow during the SaaS build and operations stages.

Defining Port Binding in the Twelve-Factor App

In this seventh step, the Twelve-Factor methodology encourages the integration of the network handling traffic code inside your running application. To explain, web apps are sometimes executed inside a web server container. For example, PHP apps might run as a module inside Apache HTTPD(link is external), or Java apps might run inside Tomcat(link is external).

The twelve-factor app is completely self-contained and does not rely on runtime injection of a webserver into the execution environment to create a web-facing service. The web app exports HTTP as a service by binding to a port, and listening to requests coming in on that port.

The challenge is that these modules must still be configured, which can lead to security risks if an app is bound to privileged ports or protected with poor passwords.

Applying Security to Step 6

To elevate security risks, bind your app to an unprivileged port and make use of port forwarding facilities. Unprivileged ports are any port number greater than 1024. Binding to a port above 1024 will not require system or root level privileges, thus allowing your app to run with least privilege. Port forwarding can then be used to transfer production traffic from a well-known privileged port, such as port 443, to a non-privileged port being used by your app. This can be achieved at the operating system level, often using firewall configurations. For example, the IP Tables firewall is commonly used to achieve port forwarding on Linux operating systems.

In the next blog we’ll chat through Step 8, which recommends scaling out via the process model, and two simple processes that can be incorporated to enhance security.

Read Security and the Twelve-Factor App - Step 8

Eric Sheridan is Chief Scientist at WhiteHat Security
Share this

Industry News

April 07, 2025

Appfire announced its launch of the Appfire Cloud Advantage Alliance.

April 07, 2025

Salt Security announced API integrations with the CrowdStrike Falcon® platform to enhance and accelerate API discovery, posture governance and threat protection.

April 07, 2025

Lucid Software has acquired airfocus, an AI-powered product management and roadmapping platform designed to help teams prioritize and build the right products faster.

April 03, 2025

StackGen has partnered with Google Cloud Platform (GCP) to bring its platform to the Google Cloud Marketplace.

April 03, 2025

Tricentis announced its spring release of new cloud capabilities for the company’s AI-powered, model-based test automation solution, Tricentis Tosca.

April 03, 2025

Lucid Software has acquired airfocus, an AI-powered product management and roadmapping platform designed to help teams prioritize and build the right products faster.

April 03, 2025

AutonomyAI announced its launch from stealth with $4 million in pre-seed funding.

April 02, 2025

Kong announced the launch of the latest version of Kong AI Gateway, which introduces new features to provide the AI security and governance guardrails needed to make GenAI and Agentic AI production-ready.

April 02, 2025

Traefik Labs announced significant enhancements to its AI Gateway platform along with new developer tools designed to streamline enterprise AI adoption and API development.

April 02, 2025

Zencoder released its next-generation AI coding and unit testing agents, designed to accelerate software development for professional engineers.

April 02, 2025

Windsurf (formerly Codeium) and Netlify announced a new technology partnership that brings seamless, one-click deployment directly into the developer's integrated development environment (IDE.)

April 02, 2025

Opsera raised $20M in Series B funding.

April 02, 2025

The Cloud Native Computing Foundation® (CNCF®), which builds sustainable ecosystems for cloud native software, is making significant updates to its certification offerings.

April 01, 2025

The Cloud Native Computing Foundation® (CNCF®), which builds sustainable ecosystems for cloud native software, announced the Golden Kubestronaut program, a distinguished recognition for professionals who have demonstrated the highest level of expertise in Kubernetes, cloud native technologies, and Linux administration.

April 01, 2025

Red Hat announced new capabilities and enhancements for Red Hat Developer Hub, Red Hat’s enterprise-grade internal developer portal based on the Backstage project.