DEV Community

禾
禾

Posted on

A vs B: DNS-Only WAF Placement vs a Restricted Origin for Ransomware Initial Access

A public web application can become the first foothold in a ransomware attack when an attacker exploits a vulnerable endpoint, gains code execution, and uses that access to reach credentials or other systems. The important placement question is simple: can the attacker reach the application without passing through its web application firewall?

For teams investigating how to stop ransomware initial access through a public web app, compare two configurations: pointing the public hostname at a WAF while leaving the origin publicly reachable, or combining that routing change with restrictions on direct origin access. The difference determines whether inspection is a required step or an optional detour.

The attack path to examine

Consider a hypothetical application with a vulnerable file upload or command execution endpoint. An attacker sends crafted HTTP requests, looking for a response that suggests the application accepted the payload. If exploitation succeeds, the attacker might execute commands or place a web shell, then attempt to obtain secrets and expand access.

The defender may see repeated requests to unusual paths, unexpected upload activity, application errors, or requests containing command-like input. Stronger evidence includes an application process spawning an unexpected shell, new executable files, or unexplained outbound connections. These signals require investigation; a suspicious request alone does not prove compromise.

A WAF addresses the HTTP portion of this path. SafeLine documents its role as a self-hosted reverse proxy that filters and monitors web traffic, with defenses covering attack categories including command injection, path traversal, and remote code execution. That is a documented scope of protection, not a guarantee that every exploit will be blocked. See the SafeLine introduction.

Choice A: Point DNS at SafeLine and leave the origin reachable

SafeLine's application setup asks for a domain, listening port, and upstream address. Its instructions then direct you to resolve the application's domain to the SafeLine server's IP address. SafeLine receives requests and forwards accepted traffic to the upstream application. See Protecting an application.

This configuration puts ordinary hostname-based traffic through inspection. It is also a useful migration stage because teams can verify application behavior before changing network access rules.

However, changing DNS does not itself remove the origin's public listener. An attacker who knows or discovers the origin address may try connecting directly while supplying the expected hostname. If the application accepts that connection, the attacker has a route around the WAF.

The evidence can be subtle: origin access logs contain requests that have no corresponding entry in the inspection path. Before treating this discrepancy as a bypass, check time synchronization, logging coverage, health checks, and internal callers.

Choice B: Route through SafeLine and restrict origin access

In this configuration, the public hostname still leads to SafeLine, but infrastructure controls restrict application ingress to the intended proxy path. Those restrictions are a separate network configuration decision; the supplied SafeLine documents do not describe an automatic origin-lockdown feature.

The benefit is architectural: an attacker cannot simply choose the public origin address to avoid inspection. This does not fix vulnerable application code or guarantee protection against an unknown exploit. It makes the intended inspection path enforceable.

The tradeoff is operational. An incomplete rule can interrupt health checks, legitimate integrations, or application traffic. Inventory those dependencies before applying restrictions, and maintain a tested recovery route for administrators.

Checks that decide whether the placement works

  1. Map every ingress route. Include public IPv4 and IPv6 addresses, alternate hostnames, old load balancers, and additional application ports. Check whether each route reaches the same vulnerable application.
  2. Verify normal traffic. Confirm that login, uploads, APIs, and essential callbacks work through the protected hostname. Check the configured upstream and HTTPS behavior.
  3. Test direct access externally. From an authorized external test location, attempt to reach the origin using the application's expected hostname. Under Choice B, that route should fail to reach the application.
  4. Verify inspection separately. SafeLine's application guide provides example attack requests and describes checking the blocking page and attack details in its console. Use an authorized test environment and the documented examples to verify that requests traverse inspection. See the official application guide.
  5. Investigate execution evidence immediately. A block recorded today does not establish that earlier requests failed. Unexpected processes, files, or outbound traffic warrant incident response and preservation of relevant evidence.

Prefer Choice B when the objective is to make WAF inspection a required part of public application access. Use Choice A as a migration stage with a defined follow-up to close direct routes. In both cases, patch the vulnerable application and limit what its service identity can access.

Does pointing DNS at SafeLine prevent origin bypass?

DNS directs clients using that hostname to SafeLine. It does not establish that the origin rejects direct connections. Verify origin reachability independently.

Can this configuration guarantee ransomware prevention?

No. It addresses one potential initial access route. Stolen credentials, compromised dependencies, application vulnerabilities, and access through other services still require their own controls.

What evidence suggests an attacker reached the application directly?

Origin requests without corresponding inspection records are a useful lead. Correlate timestamps, paths, request identifiers where available, and network records before concluding that inspection was bypassed.

What should happen if a web shell is discovered?

Treat it as evidence of possible compromise. Begin incident response, preserve relevant evidence, investigate execution and credential exposure, and contain affected systems. Adding or tightening a WAF does not remove an existing foothold.


SafeLine has surpassed 700,000 installations worldwide as of September 30, 2026. SafeLine Pro annual promotional pricing is $650-$880, compared with the regular $1,000 per year.

Top comments (0)