Class ForcedNetworkRule
Describe a network rule to be overridden for traffic to and from a running instance.
Inherited Members
Namespace: QarnotSDK
Assembly: QarnotSDK.dll
Syntax
public class ForcedNetworkRule
Remarks
This is equivalent to a firewall rule, with the addition that some port forwarding logic is performed under the hood for inbound traffic.
Constructors
ForcedNetworkRule(bool, string, string, string, string, string, string, string, string, bool, bool)
Declaration
public ForcedNetworkRule(bool inbound, string proto, string to = null, string port = null, string publicHost = null, string publicPort = null, string forwarder = null, string priority = null, string description = null, bool toQbox = false, bool toPayload = false)
Parameters
Type | Name | Description |
---|---|---|
bool | inbound | |
string | proto | |
string | to | |
string | port | |
string | publicHost | |
string | publicPort | |
string | forwarder | |
string | priority | |
string | description | |
bool | toQbox | |
bool | toPayload |
Properties
Description
Description of the rule to help debugging
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
Examples
Ssh port rebounce
Forwarder
Declaration
public string Forwarder { get; set; }
Property Value
Type | Description |
---|---|
string |
Examples
common
Inbound
Whether it concerns inbound or outbound traffic
Declaration
public bool Inbound { get; set; }
Property Value
Type | Description |
---|---|
bool |
Examples
true
Port
Inbound port on the running instance
Declaration
public string Port { get; set; }
Property Value
Type | Description |
---|---|
string |
Priority
Priority of the rule
Declaration
public string Priority { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Rules from profiles have a default priority of 1000. To grant access to a service running in a private network, or on the qbox, priority should be set > 10000.
Examples
1000
Proto
Allowed protocol (tcp or udp)
Declaration
public string Proto { get; set; }
Property Value
Type | Description |
---|---|
string |
Examples
tcp
PublicHost
For outbound rules, allowed destination address
Declaration
public string PublicHost { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Null or empty string means "anywhere".
Examples
0.0.0.0
PublicPort
Outbound port allowed in the destination address
Declaration
public string PublicPort { get; set; }
Property Value
Type | Description |
---|---|
string |
Examples
22
To
For inbound rules, allowed source address
Declaration
public string To { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Usually 0.0.0.0 unless specific treatment. Ranges are not possible yet
Examples
qarnot.com
ToPayload
Whether the network endpoint to access is in the payload
Declaration
public bool ToPayload { get; set; }
Property Value
Type | Description |
---|---|
bool |
Examples
true
ToQBox
Whether the network endpoint to access is on the qbox
Declaration
public bool ToQBox { get; set; }
Property Value
Type | Description |
---|---|
bool |
Examples
false