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/2of 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
.appfile 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 ofphoenix_pubsubwhen the project starts a PubSub, extra_entrypointsfrom 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
@spec build( VulnCheck.Types.Workspace.t(), VulnCheck.Beam.CallGraph.t(), VulnCheck.Config.t() | nil ) :: {VulnCheck.Types.EntrypointModel.t(), VulnCheck.Beam.CallGraph.t()}
Builds the entrypoint model and returns the call graph extended with the synthetic edges.
@spec daemon_packages() :: [String.t()]
Packages treated as network-facing daemons.
@spec protocol_clients() :: [String.t()]
Protocol client packages whose receive functions become roots once they are used.