Segmenting application components by trust and exposure
Segmenting application components by trust and exposure connects a security requirement to the behaviour of a real feature. The relevant controls need to remain effective across custom code, integrations and the production configuration. Understanding segmenting application components by trust and exposure helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Configuration can change an application's security boundary without changing its business code. Effective production values, inherited defaults, exposed services and operational interfaces need to be assessed together rather than as isolated files.
Network segmentation is the core of multi-layer defense in depth for modern services. Segmentation slow down an attacker if he cannot implement attacks such as:
Usually some information systems of the company interact with each other. It is important to define a firewall policy for such interactions. The base allowed interactions are indicated by the green arrows in the image below: The image above also shows the allowed access from the FRONTEND and MIDDLEWARE segments to external networks (the Internet, for example).
Why it matters
Consider a realistic failure: a public application component can connect directly to operational services it has no legitimate reason to use.
A permissive setting can expose private information or administrative capabilities through a route the application owner did not expect. The consequence depends on how the service is actually deployed and which identities can reach it.
Implementation guidance should be applied to a real feature and its deployment. Framework defaults, custom handlers and integrated services all influence whether the intended protection remains effective.
How penetration testers check for it
Trace the relevant feature from its entry point to the data or operation it protects, including custom code and alternate paths.
- Review effective production settings and inherited defaults.
- Identify exposed management and diagnostic interfaces.
- Trace secret and connection configuration to its use.
- Compare configured policy with observed behaviour.
How to fix it
Use the appropriate maintained mechanisms and verify the result in the actual production configuration.
- executing arbitrary commands on a public web server (NginX, Apache, Internet Information Service) prevents an attacker from gaining direct access to the database.
- DMZ Inbound - a segment for hosting services and applications accessible from the Internet, they must be protected by WAF.
- DMZ Outgoing - a segment for hosting services that are inaccessible from the Internet, but have access to external networks (the firewall does not contain any rules for allowing traffic from external networks).
- AD SERVICES - segment designed to host various Active Directory services, in the example only one server with a domain controller Contoso.com is shown.
- Protect secrets and remove unnecessary diagnostic exposure.
- Check configuration drift during deployment and maintenance.
A setting should be interpreted in its environment. A deliberately public resource and an unintended private exposure can look similar until ownership, purpose and reachable operations are established.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Managing npm dependency trust and installation risks
- Isolating trust between independently deployed frontend modules
- Controlling the trust and privileges of third-party JavaScript
Read about our methodology or contact pentested.com to discuss secure development and code review.