NethServer / nethsecurity

NethSecurity image and build environment
https://www.nethsecurity.org/
Other
98 stars 6 forks source link

Some IPSEC configurations always shown with default values #615

Closed cotosso closed 3 months ago

cotosso commented 3 months ago

Thid bug affect ipsec tunnels, in particular the parameters:

If these parameters are set to a value different from the default one, the UI always shows the default value (the right value is written in the configuration).

Steps to reproduce

Expected behavior

When editing the tunnel I expect to see exactly same values configured.

Actual behavior

When editing the tunnel, the displayed values are always the default ones, not the configured ones, so it's impossible to know the configured parameters from the UI, every modification to the tunnel restores these values to their default.

Components

ns-api: 0.0.76

Refs

cotosso commented 3 months ago

Trying to get tunnel values from the command line suggests that the problem may not be on the UI side, but on the backend side, cause the tunnel values ​​returned by the API are always the same:

  "dpdaction": ""
  "rekeytime": "3600"
  "ipcomp": ""

this is the API used:

root@NethSec:~# api-cli ns.ipsectunnel get-tunnel --data '{"id":"ns_35785395"}'|jq
{
  "dpdaction": "",
  "enabled": "1",
  "esp": {
    "dh_group": "modp2048",
    "encryption_algorithm": "aes256",
    "hash_algorithm": "sha256",
    "rekeytime": "3600"
  },
  "gateway": "1.2.3.4",
  "ike": {
    "dh_group": "modp2048",
    "encryption_algorithm": "aes256",
    "hash_algorithm": "sha256",
    "rekeytime": "86400"
  },
  "ipcomp": "",
  "keyexchange": "ike",
  "local_identifier": "@tun1.local",
  "local_ip": "192.168.5.194",
  "local_subnet": [
    "192.168.1.0/24"
  ],
  "ns_name": "ggggg",
  "pre_shared_key": "dWqSdsCV4FHZGE0EtzheW25qzk5c4gdpd3LF9Llv8ayGn+MdAk1mW9YD/55LkVCwfWZb0QsvCWQAwRy3v8O3Loha",
  "remote_identifier": "@tun1.remote",
  "remote_subnet": [
    "10.87.87.0/24"
  ]
}
gsanchietti commented 3 months ago

Testing image: 23.05.3-ns.1.0.1-37-gb1366bd

gsanchietti commented 3 months ago

Verified: reported fields now display the correct value