Skip to content

describe-vpn-connection missing information #9421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ankenyr opened this issue Apr 3, 2025 · 4 comments
Open

describe-vpn-connection missing information #9421

ankenyr opened this issue Apr 3, 2025 · 4 comments
Assignees
Labels
bug This issue is a bug. documentation This is a problem with documentation. p3 This is a minor priority issue

Comments

@ankenyr
Copy link

ankenyr commented Apr 3, 2025

Describe the issue

In the doc page I linked, the example json does not have tunnelOptions which looks to me to be a non-optional field that must always be present. It also seems that when updating things like the encryption algorithm, authentication algorithm, and diffie-helman groups the XML does not reflect those changes and is instead static.

Can the documentation be updated to clarify a couple of things

  1. Are TunnelOptions always present or can the json sometimes not have them?
  2. Is the XML intended to be authoritative or not?

Links

https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpn-connections.html

@ankenyr ankenyr added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Apr 3, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Apr 4, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK added bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Apr 4, 2025
@RyanFitzSimmonsAK
Copy link
Contributor

RyanFitzSimmonsAK commented Apr 15, 2025

Hi @ankenyr, thanks for reaching out and for your patience.

Are TunnelOptions always present or can the json sometimes not have them?

TunnelOptions should always appear in the response unless it's a very old VPN. Some old VPNs might be missing this field, and if that occurs, the service team can manually backfill it to fix that.

Is the XML intended to be authoritative or not?

A common nuance of AWS documentation is that when structures (such as TunnelOptions) are part of a response, the documentation will list every possible attribute of that structure in the Output section. However, not all operations return every attribute, and that does tend to confuse people. The examples section can clear that up, and typically you can take it as a source of truth, at least syntactically. In this case, this example was handwritten five years ago, so it makes sense that TunnelOptions would be absent.

I've reached out to the CLI example writer about addressing this. Thank you for bringing it to our attention!

Ticket # for internal use : P225675113

@RyanFitzSimmonsAK RyanFitzSimmonsAK removed the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Apr 15, 2025
@ankenyr
Copy link
Author

ankenyr commented Apr 15, 2025

Just to be clear, there is XML in the JSON. My question was if the XML is to be considered authoritative because it is not. For example if you change the diffie helman groups or the encryption/authentication algorithms, it is not reflected in the XML but would be reflected in the JSON. The following is an example I created where I have removed sensitive values

{
 "VpnConnections": [
  {
   "Category": "VPN",
   "CustomerGatewayConfiguration": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vpn_connection id=\"vpn-2345\">\n  <customer_gateway_id>cgw-1234</customer_gateway_id>\n  <vpn_gateway_id></vpn_gateway_id>\n  <vpn_connection_type>ipsec.1</vpn_connection_type>\n  <ipsec_tunnel>\n    <customer_gateway>\n      <tunnel_outside_address>\n        <ip_address>9.9.2.1</ip_address>\n      </tunnel_outside_address>\n      <tunnel_inside_address>\n        <ip_address>169.254.105.118</ip_address>\n        <network_mask>255.255.255.252</network_mask>\n        <network_cidr>30</network_cidr>\n      </tunnel_inside_address>\n      <bgp>\n        <asn>65000</asn>\n        <hold_time>30</hold_time>\n      </bgp>\n    </customer_gateway>\n    <vpn_gateway>\n      <tunnel_outside_address>\n        <ip_address>1.1.1.1</ip_address>\n      </tunnel_outside_address>\n      <tunnel_inside_address>\n        <ip_address>169.254.105.117</ip_address>\n        <network_mask>255.255.255.252</network_mask>\n        <network_cidr>30</network_cidr>\n      </tunnel_inside_address>\n      <bgp>\n        <asn>64512</asn>\n        <hold_time>30</hold_time>\n      </bgp>\n    </vpn_gateway>\n    <ike>\n      <authentication_protocol>sha1</authentication_protocol>\n      <encryption_protocol>aes-256-cbc</encryption_protocol>\n      <lifetime>28800</lifetime>\n      <perfect_forward_secrecy>group2</perfect_forward_secrecy>\n      <mode>main</mode>\n      <pre_shared_key>abcdefg</pre_shared_key>\n    </ike>\n    <ipsec>\n      <protocol>esp</protocol>\n      <authentication_protocol>hmac-sha1-96</authentication_protocol>\n      <encryption_protocol>aes-128-cbc</encryption_protocol>\n      <lifetime>3600</lifetime>\n      <perfect_forward_secrecy>group2</perfect_forward_secrecy>\n      <mode>tunnel</mode>\n      <clear_df_bit>true</clear_df_bit>\n      <fragmentation_before_encryption>true</fragmentation_before_encryption>\n      <tcp_mss_adjustment>1379</tcp_mss_adjustment>\n      <dead_peer_detection>\n        <interval>10</interval>\n        <retries>3</retries>\n      </dead_peer_detection>\n    </ipsec>\n  </ipsec_tunnel>\n  <ipsec_tunnel>\n    <customer_gateway>\n      <tunnel_outside_address>\n        <ip_address>9.9.2.1</ip_address>\n      </tunnel_outside_address>\n      <tunnel_inside_address>\n        <ip_address>169.254.133.230</ip_address>\n        <network_mask>255.255.255.252</network_mask>\n        <network_cidr>30</network_cidr>\n      </tunnel_inside_address>\n      <bgp>\n        <asn>65000</asn>\n        <hold_time>30</hold_time>\n      </bgp>\n    </customer_gateway>\n    <vpn_gateway>\n      <tunnel_outside_address>\n        <ip_address>54.71.105.202</ip_address>\n      </tunnel_outside_address>\n      <tunnel_inside_address>\n        <ip_address>169.254.133.229</ip_address>\n        <network_mask>255.255.255.252</network_mask>\n        <network_cidr>30</network_cidr>\n      </tunnel_inside_address>\n      <bgp>\n        <asn>64512</asn>\n        <hold_time>30</hold_time>\n      </bgp>\n    </vpn_gateway>\n    <ike>\n      <authentication_protocol>sha1</authentication_protocol>\n      <encryption_protocol>aes-128-cbc</encryption_protocol>\n      <lifetime>28800</lifetime>\n      <perfect_forward_secrecy>group2</perfect_forward_secrecy>\n      <mode>main</mode>\n      <pre_shared_key>hijklmnop</pre_shared_key>\n    </ike>\n    <ipsec>\n      <protocol>esp</protocol>\n      <authentication_protocol>hmac-sha1-96</authentication_protocol>\n      <encryption_protocol>aes-128-cbc</encryption_protocol>\n      <lifetime>3600</lifetime>\n      <perfect_forward_secrecy>group2</perfect_forward_secrecy>\n      <mode>tunnel</mode>\n      <clear_df_bit>true</clear_df_bit>\n      <fragmentation_before_encryption>true</fragmentation_before_encryption>\n      <tcp_mss_adjustment>1379</tcp_mss_adjustment>\n      <dead_peer_detection>\n        <interval>10</interval>\n        <retries>3</retries>\n      </dead_peer_detection>\n    </ipsec>\n  </ipsec_tunnel>\n</vpn_connection>\n",
   "CustomerGatewayId": "cgw-1234",
   "GatewayAssociationState": "associated",
   "Options": {
    "EnableAcceleration": false,
    "LocalIpv4NetworkCidr": "0.0.0.0/0",
    "OutsideIpAddressType": "PublicIpv4",
    "RemoteIpv4NetworkCidr": "0.0.0.0/0",
    "StaticRoutesOnly": false,
    "TunnelInsideIpVersion": "ipv4",
    "TunnelOptions": [
     {
      "DpdTimeoutAction": "clear",
      "EnableTunnelLifecycleControl": false,
      "IkeVersions": [
       {
        "Value": "ikev1"
       },
       {
        "Value": "ikev2"
       }
      ],
      "LogOptions": {
       "CloudWatchLogOptions": {
        "LogEnabled": false,
        "LogGroupArn": "",
        "LogOutputFormat": "json"
       }
      },
      "OutsideIpAddress": "1.1.1.1",
      "Phase1DHGroupNumbers": [
       {
        "Value": 2
       },
       {
        "Value": 20
       },
       {
        "Value": 21
       },
       {
        "Value": 22
       },
       {
        "Value": 23
       },
       {
        "Value": 24
       }
      ],
      "Phase1EncryptionAlgorithms": [
       {
        "Value": "AES256"
       },
       {
        "Value": "AES128-GCM-16"
       }
      ],
      "Phase1IntegrityAlgorithms": [
       {
        "Value": "SHA1"
       },
       {
        "Value": "SHA2-512"
       }
      ],
      "Phase2DHGroupNumbers": [
       {
        "Value": 14
       },
       {
        "Value": 15
       },
       {
        "Value": 16
       },
       {
        "Value": 20
       },
       {
        "Value": 21
       },
       {
        "Value": 22
       },
       {
        "Value": 23
       },
       {
        "Value": 24
       }
      ],
      "Phase2EncryptionAlgorithms": [
       {
        "Value": "AES128"
       },
       {
        "Value": "AES128-GCM-16"
       }
      ],
      "Phase2IntegrityAlgorithms": [
       {
        "Value": "SHA2-512"
       }
      ],
      "PreSharedKey": "abcdefg",
      "StartupAction": "add",
      "TunnelInsideCidr": "169.254.105.116/30"
     },
     {
      "EnableTunnelLifecycleControl": false,
      "LogOptions": {
       "CloudWatchLogOptions": {
        "LogEnabled": false
       }
      },
      "OutsideIpAddress": "54.71.105.202",
      "PreSharedKey": "hijklmnop",
      "TunnelInsideCidr": "169.254.133.228/30"
     }
    ]
   },
   "Routes": [],
   "State": "modifying",
   "Tags": [
    {
     "Key": "Name",
     "Value": "foo2"
    }
   ],
   "TransitGatewayId": "tgw-5678",
   "Type": "ipsec.1",
   "VgwTelemetry": [
    {
     "AcceptedRouteCount": 0,
     "LastStatusChange": "2024-12-12 22:12:34+00:00",
     "OutsideIpAddress": "1.1.1.1",
     "Status": "DOWN",
     "StatusMessage": "IPSEC IS DOWN"
    },
    {
     "AcceptedRouteCount": 0,
     "LastStatusChange": "2024-12-12 22:12:34+00:00",
     "OutsideIpAddress": "54.71.105.202",
     "Status": "DOWN",
     "StatusMessage": "IPSEC IS DOWN"
    }
   ],
   "VpnConnectionId": "vpn-2345"
  }
 ]
}

You can see I have changed Phase2DHGroupNumbers to be a certain number of explicit values. However in the XML you can see it is only group2.

What should the XML be used for if it is not accurate? For older VPNs that do not have tunneloptions, how should someone get the correct configuration of the VPN?

@RyanFitzSimmonsAK
Copy link
Contributor

For example if you change the diffie helman groups or the encryption/authentication algorithms, it is not reflected in the XML but would be reflected in the JSON.

I'm not sure I'm following here. The XML you're referring to (CustomerGatewayConfiguration) doesn't contain the same attributes as the JSON. Unless you were referring to the JSON response of DescribeCustomerGateways? For the XML to change, you'd need to change an attribute of your customer gateway.

For older VPNs that do not have tunneloptions, how should someone get the correct configuration of the VPN?

Using modify-vpn-tunnel-options should backfill the TunnelOption value automatically.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 15, 2025
@ankenyr
Copy link
Author

ankenyr commented Apr 15, 2025

Yea the CustomerGatewayConfiguration does not contain the correct information. In the above I setup my tunnels and the correct configuration is reflected in the JSON. The xml in CustomerGatewayConfiguration does not have the correct configuration information. The documentation says

The configuration information for the VPN connection’s customer gateway
This is not correct though as it would be incompatible. The AWS side has Phase2DHGroupNumbers configured to exclude value 2 which would map to group2 in the xml. The XML however has <perfect_forward_secrecy>group2</perfect_forward_secrecy>

Is CustomerGatewayConfiguration supposed to be accurate to the actual configuration? If so, that is not reflected in the real world and there is a bug.
If it is not supposed to be accurate then the documentation needs to be updated stating as such and it should be clarified what it is used for. My suspicion is that it is only used by AWS to create the configs generated by the "download configuration " button

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. documentation This is a problem with documentation. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants