Connection.hpp

1. Overview

Network connection model. Declares the normalized connection record shared by packet interception, socket discovery, process inspection, rules, statistics and the UI protocol.

The original source path is:

include/bsc/model/Connection.hpp

2. Role in the Daemon

This file participates in the privileged BastionGuard Secure Connection daemon. It uses the shared bsc models and follows the daemon-wide fallback strategy: optional high-fidelity backends are used when available, while portable polling or stub behavior preserves service startup.


3. Namespaces

  • bsc::model

4. Dependencies and Included Interfaces

  • bsc/model/ProcessInfo.hpp
  • chrono
  • cstdint
  • string

5. Declared Types

  • struct Connection

6. State and Data Members

The interface declares the following relevant state members:

  • std::string protocol
  • std::string src_ip
  • std::string dst_ip
  • std::string dst_host
  • std::string process_path
  • std::string process_comm
  • std::string process_cwd
  • std::vector<std::string> process_args
  • std::map<std::string, std::string> process_env
  • std::map<std::string, std::string> process_checksums
  • std::vector<std::pair<std::string, std::uint32_t>> process_tree

7. Connection Data

The model carries protocol, source and destination addresses/ports, resolved hostname, process PID/UID/GID, executable and command metadata, checksums, ancestry and timestamps. It is the canonical object passed to the rule engine and serialized to the UI.


8. External Resources and Protocol Values

Relevant paths, endpoints, command names or policy values referenced by this file include:

  • bsc/model/ProcessInfo.hpp

9. Security Considerations

  • The component processes privileged operating-system or network data and should run with only the capabilities required by its backend.
  • Process environment data may contain credentials and should not be exposed unnecessarily.

10. Implementation Considerations

  • Linux /proc data can disappear between reads because processes and sockets are inherently short-lived.

11. Source Metrics

MetricValue
File size992 bytes
Lines30
Detected API entries0
Detected types1