f5-appsvcs-extension
f5-appsvcs-extension copied to clipboard
sourceAddress with direct value for virtualPort removes the port from configuration
Environment
- Application Services Version: 3.53.0
- BIG-IP Version: 17.1.1.1
Summary
Using sourceAddress with a Net_Address_List object and using a direct value for virtualPort removes the virtualPort from the final configuration (VIP is listening on all ports) Workaround: use a Net_Port_List object also for virtualPort, with a single value
Steps To Reproduce
Steps to reproduce the behavior:
- Submit the following declaration:
{
"schemaVersion": "3.53.0",
"class": "ADC",
"Tenant": {
"class": "Tenant",
"Application": {
"template": "generic",
"vip": {
"class": "Service_HTTP",
"pool": "web_pool",
"virtualAddresses": ["192.0.2.0"],
"virtualPort": 123,
"sourceAddress": {
"use": "allowed_source"
}
},
"allowed_source": {
"class": "Net_Addr_List",
"addresses": ["10.10.10.10"]
},
"web_pool": {
"class": "Pool",
"monitors": [
{
"bigip": "/Common/http"
}
],
"members": [
{
"addressDiscovery": "static",
"servicePort": 80,
"serverAddresses": [
"192.10.0.1"
]
}
]
}
}
}
}
- Observe the following error response: No error is reported:
{
"code": 200,
"message": "success",
"host": "localhost",
"tenant": "Tenant",
"runTime": 872
}
Expected Behavior
Using sourceAddress with a Net_Address_List object should not have any impact on the vip virtualPort defined, being a single value or via an object
Actual Behavior
Using sourceAddress with a Net_Address_List object in the vip declaration forces the vip virtualPort value to 0 (all ports) instead of using the actual value defined.
Additional information
Looking at the code, I would say this happens in map_as3.js file around line 2627.
The tmcObj does not contain a destinationPortInline but only the destinationPortList (even if the virtualPort was declared inline):
const tmcObj = {
protocol: item.layer4,
destinationAddressInline: ${destIp.split('%')[0]}/${msk}, // strip the route domain
destinationAddressList: bigipPathFromSrc(destinationAddressList),
destinationPortList: bigipPathFromSrc(destinationPortList),
sourceAddressList: bigipPathFromSrc(sourceAddressList),
sourceAddressInline: source
};