Documentation
¶
Index ¶
Constants ¶
const ( TargetIDCloudNat = "com.steadybit.extension_gcp.cloud-nat" CloudNatDisassociateActionId = "com.steadybit.extension_gcp.cloud-nat.disassociate-subnets" )
Variables ¶
This section is empty.
Functions ¶
func NewCloudNatDisassociateAction ¶
func NewCloudNatDisassociateAction() action_kit_sdk.ActionWithStop[CloudNatDisassociateState]
func NewNatDiscovery ¶
func NewNatDiscovery() discovery_kit_sdk.TargetDiscovery
Types ¶
type CloudNatDisassociateState ¶
type CloudNatDisassociateState struct {
ProjectID string
Region string
RouterName string
NatName string
NatSnapshot []byte // proto.Marshal of the original computepb.RouterNat
// SourceMode is the NAT's sourceSubnetworkIpRangesToNat mode, captured for
// human-readable Prepare/Start/Stop messages. Set to the literal string
// GCP returned (e.g. LIST_OF_SUBNETWORKS, ALL_SUBNETWORKS_ALL_IP_RANGES).
SourceMode string
// SubnetCount is only meaningful when SourceMode is LIST_OF_SUBNETWORKS —
// the other modes NAT every subnet in the region without populating an
// explicit list, so this field stays 0 there.
SubnetCount int
}
CloudNatDisassociateState captures the entire original NAT proto so the attack can restore it byte-identically on stop. We serialise via proto.Marshal (base64 in JSON) rather than snapshotting individual fields because a LIST_OF_SUBNETWORKS NAT can't survive an empty subnetworks list — the only way to disassociate a NAT from all its subnetworks in GCP is to remove the NAT entry from the router entirely, then re-add it.