Skip to main content

Mitm

In Egern, Mitm provides the functionality for man-in-the-middle (MitM) attacks on HTTPS traffic. By decrypting and re-encrypting the traffic, it enables control over HTTP(S) requests, such as intercepting, modifying, and resending requests.

Configuration Instructions

Below are the configuration fields for Mitm:

Field NameTypeRequiredDescription
enabledbooleanYesWhether to enable MitM.
ca_p12stringYesPath to the CA certificate file. This certificate is used to establish trust between Egern and the target server, as well as for decrypting and re-encrypting the traffic.
ca_passphrasestringYesPassword for the CA certificate.
hostnamesarray of stringsNoA list of hostnames to restrict the MitM functionality. Only hostnames listed here will be intercepted by MitM.

Configuration Example

Here is an example configuration for Mitm:

mitm:
enabled: true
ca_p12: "/path/to/ca.p12"
ca_passphrase: "your_passphrase"
hostnames:
- "example.com"

In this configuration, we enable the MitM feature, specify the path and password for the CA certificate, and restrict MitM to only intercept traffic from the example.com hostname.