VulnCheck.Entrypoints (VulnCheck v1.0.1)

Copy Markdown View Source

Synthesizes the BEAM execution model of a workspace: the roots of the reachability analysis and the indirect edges created by OTP, frameworks and configuration.

Roots:

  • start/2 of every application callback module that boots (:application_start),
  • every public function of the project when it is a library without an application callback, or when no compiled .app file is available (:library_export),
  • start functions and callbacks of modules named in config/*.exs (:entrypoint),
  • protocol handlers of active network daemons (:daemon): servers (bandit, cowboy, ranch, thousand_island, grpc, ...) whose application starts at boot or that the project names, and the cluster message handlers of phoenix_pubsub when the project starts a PubSub,
  • extra_entrypoints from the configuration (:extra).

Protocol clients (mint, gun, finch) contribute conditional roots (client_roots): the functions that process data received from servers. The solver only uses them once a function of the client package is reachable, that is, once the project opens connections with it.

Roots the project does not call itself carry an activation hop (VulnCheck.Types.Entrypoint): a daemon's protocol handlers point to the project function that starts the daemon (or one depending on it, such as Bandit for thousand_island), else to the .app file whose boot tree starts it; modules of dependencies named in the configuration point to the configuration line.

Summary

Functions

Builds the entrypoint model and returns the call graph extended with the synthetic edges.

Packages treated as network-facing daemons.

Protocol client packages whose receive functions become roots once they are used.

Functions

build(workspace, graph, config \\ nil)

Builds the entrypoint model and returns the call graph extended with the synthetic edges.

daemon_packages()

@spec daemon_packages() :: [String.t()]

Packages treated as network-facing daemons.

protocol_clients()

@spec protocol_clients() :: [String.t()]

Protocol client packages whose receive functions become roots once they are used.