Coverage area · Partly checked automatically

Network exposure in code and service config

Which ports a service listens on, whether it requires authentication and whether it uses TLS are usually decided in code and config files. This page covers those decisions in your repository; OpenRouting checks the TLS and binding parts automatically.

what to look for · Network
[ ] Datastores published to all hosts?
[ ] Services running without auth?
[ ] Cleartext where TLS is expected?
fix: internal network, auth, TLS
$ 

A manual checklist for this area. The example below isn't flagged by a stock rule; see what is checked today.

What OpenRouting checks today

Partly checked automatically

Semgrep's default ruleset flags disabled TLS verification and cleartext transport across many languages and drivers, old TLS versions in nginx, and services bound to all interfaces in Python, Go and C#; the network agent reviews each one. A passive website scan reports missing HSTS and mixed content on a live URL. Not checked: published ports and datastore authentication in compose files (the example below isn't flagged), and nothing scans your network.

Why this area matters

Databases and caches exposed to the internet without authentication are a steady source of data leaks; services bound to 0.0.0.0 or published from a compose file are often reachable far beyond where the developer intended. Cleartext transport (CWE-319) and disabled certificate validation (CWE-295) let anyone on the path read or change traffic.

Rules flag 0.0.0.0 and HTTP URLs everywhere, including local development and health checks. The network agent checks which environment the config is for, whether the service requires authentication and whether traffic leaves a private network.

What goes wrong in real applications

  • Datastores exposed without authentication

    Redis, MongoDB, Elasticsearch and similar services published on all interfaces with auth disabled can be read or wiped by anyone who can reach them.

  • Cleartext protocols

    HTTP, FTP, telnet and unencrypted database connections expose credentials and data in transit.

  • Disabled certificate validation

    Skipping TLS verification makes encrypted connections open to interception.

  • Over-broad binding

    Services bound to 0.0.0.0 when they only need localhost or a private network are reachable from more places than intended.

Sample: the risky pattern and the fix

Riskydeploy/docker-compose.prod.yml
services:
  redis:
    image: redis:7
    command: redis-server --protected-mode no
    ports:
      - "6379:6379"
  mongo:
    image: mongo:8.2
    ports:
      - "27017:27017"
Saferdeploy/docker-compose.prod.yml
services:
  redis:
    image: redis:7
    command: redis-server /run/secrets/redis_conf   # requirepass, protected-mode yes
    secrets: [redis_conf]
    networks: [backend]                             # no published ports
  mongo:
    image: mongo:8.2
    environment:
      MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo_root_password
    secrets: [mongo_root_password]
    networks: [backend]
networks:
  backend:
    internal: true
secrets:
  redis_conf:
    file: ./secrets/redis.conf
  mongo_root_password:
    file: ./secrets/mongo_root_password

The production compose file publishes Redis with protection disabled and MongoDB without credentials on every interface of the host. The fix keeps both on an internal network with no published ports and enables authentication with credentials supplied as secrets rather than in the file.

Illustrative code, simplified for clarity — not taken from a customer repository.

What to look for in your code

  • Ports and bind addresses in compose files, Kubernetes services and application config
  • Datastore and cache settings: authentication, protected mode, TLS (a manual check today)
  • HTTP, FTP and telnet URLs and clients for non-local traffic
  • TLS verification flags in HTTP clients and database drivers
  • Whether a config is for local development or production (the main false-positive signal)

Scope and limits

  • It doesn't scan networks, ports or hosts and never sends traffic — it reviews the configuration and code that define your services.
  • Firewalls, cloud network rules and load balancers outside the repository may already block a flagged port; the finding says what the repo alone allows.

The checklist above is broader than what runs automatically; see what OpenRouting checks today. Where a scanner does run, it surfaces candidates and a review agent decides whether each one is real — it doesn't promise to find every issue.

Review agents for this area

These agents give the verdict and fix when a scanner raises a finding here.

Common questions

Is OpenRouting a network scanner?

No. It never touches your network. It reviews the code and config that decide what your services expose.

Will it flag 0.0.0.0 in my local docker-compose file?

Published compose ports aren't flagged by a stock rule; a bind to 0.0.0.0 in Python, Go or C# code is. The network agent marks local-development configs as likely false positives with the reason, and focuses on production config.