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, or Java apps might run inside Tomcat.

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 23, 2024

mabl announced the addition of mobile application testing to its platform.

April 23, 2024

Spectro Cloud announced the achievement of a new Amazon Web Services (AWS) Competency designation.

April 22, 2024

GitLab announced the general availability of GitLab Duo Chat.

April 18, 2024

SmartBear announced a new version of its API design and documentation tool, SwaggerHub, integrating Stoplight’s API open source tools.

April 18, 2024

Red Hat announced updates to Red Hat Trusted Software Supply Chain.

April 18, 2024

Tricentis announced the latest update to the company’s AI offerings with the launch of Tricentis Copilot, a suite of solutions leveraging generative AI to enhance productivity throughout the entire testing lifecycle.

April 17, 2024

CIQ launched fully supported, upstream stable kernels for Rocky Linux via the CIQ Enterprise Linux Platform, providing enhanced performance, hardware compatibility and security.

April 17, 2024

Redgate launched an enterprise version of its database monitoring tool, providing a range of new features to address the challenges of scale and complexity faced by larger organizations.

April 17, 2024

Snyk announced the expansion of its current partnership with Google Cloud to advance secure code generated by Google Cloud’s generative-AI-powered collaborator service, Gemini Code Assist.

April 16, 2024

Kong announced the commercial availability of Kong Konnect Dedicated Cloud Gateways on Amazon Web Services (AWS).

April 16, 2024

Pegasystems announced the general availability of Pega Infinity ’24.1™.

April 16, 2024

Sylabs announces the launch of a new certification focusing on the Singularity container platform.

April 15, 2024

OpenText™ announced Cloud Editions (CE) 24.2, including OpenText DevOps Cloud and OpenText™ DevOps Aviator.

April 15, 2024

Postman announced its acquisition of Orbit, the community growth platform for developer companies.

April 11, 2024

Check Point® Software Technologies Ltd. announced new email security features that enhance its Check Point Harmony Email & Collaboration portfolio: Patented unified quarantine, DMARC monitoring, archiving, and Smart Banners.