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

19.1.1 Alias API fails to retain data or create new alias #3214

Closed
chrismarkovic opened this Issue Feb 10, 2019 · 11 comments

Comments

Projects
None yet
3 participants
@chrismarkovic
Copy link

chrismarkovic commented Feb 10, 2019

When using the alias_util api for Add / List, I am able to add an address to an existing alias list which is visible in the web interface. The additional entry will be added and will be visible via the API if "list"ing the alias, but after 10 - 20 seconds it will drop every entry in the list except the new one I just added. The

Existing Alias:

name: myalias
Hosts: 100.100.100.100

POST details:
addurl = 'https://fw/api/firewall/alias_util/add/myalias'

addalias = requests.post(addurl,
                verify=False,
                auth=(api_key, api_secret),
                json={'address': '200.200.200.200'})

i.e: listing the alias:
{u'current': 1, u'rowCount': 9999, u'total': 2, u'rows': [{u'ip': u'100.100.100.100'}, {u'ip': u'200.200.200.200'}]
}

after 10 seconds or so:
{u'current': 1, u'rowCount': 9999, u'total': 1, u'rows': [{u'ip': u'200.200.200.200'}]}

Additionally, when adding a NEW alias via the API, the alias is not visible in the web interface, nor selectable for any rules.

Please let me know if you require any further info or if I'm doing something wrong :)

@AdSchellevis

This comment has been minimized.

Copy link
Member

AdSchellevis commented Feb 10, 2019

Can you replicate the exact same behaviour using the gui? if so, please provide steps and alias type used. All endpoints are also available through the user interface.

@chrismarkovic

This comment has been minimized.

Copy link
Author

chrismarkovic commented Feb 10, 2019

I'm sorry, I'm not quite sure I understand you. I can use the gui to add/remove/modify an alias, then click apply and it works as expected. This is only occurring when using the /api/firewall/alias_util/add/ endpoint. Is there another API endpoint I should be trying or another component in the gui you're referring to?

@AdSchellevis

This comment has been minimized.

Copy link
Member

AdSchellevis commented Feb 10, 2019

The alias_util endpoint is available in the diagnostic section (https://your-host/ui/firewall/alias_util/), could you replicate your issue there?

@chrismarkovic

This comment has been minimized.

Copy link
Author

chrismarkovic commented Feb 10, 2019

Yes, that has the same symptom. The new address added via the "Quick add address" box, adds the address into the list and then the existing entry vanishes after 10 - 20 seconds

@AdSchellevis

This comment has been minimized.

Copy link
Member

AdSchellevis commented Feb 10, 2019

Which type of alias are you using?

@chrismarkovic

This comment has been minimized.

Copy link
Author

chrismarkovic commented Feb 10, 2019

I'm just working with the default Host(s) one

@AdSchellevis

This comment has been minimized.

Copy link
Member

AdSchellevis commented Feb 10, 2019

looks like a bug, it's replacing the content instead of adding it...

@AdSchellevis AdSchellevis self-assigned this Feb 10, 2019

@AdSchellevis AdSchellevis added bug and removed support labels Feb 10, 2019

@chrismarkovic

This comment has been minimized.

Copy link
Author

chrismarkovic commented Feb 10, 2019

Thank you for your help with this. We've been looking forward to this feature :)

@chrismarkovic

This comment has been minimized.

Copy link
Author

chrismarkovic commented Feb 10, 2019

Is it also intentional that the API created Alias would not be assignable to rules via the gui?

@AdSchellevis

This comment has been minimized.

Copy link
Member

AdSchellevis commented Feb 10, 2019

50c25ea fixes the replacement on my end.

Install locally using:

opnsense-patch 50c25ea
@AdSchellevis

This comment has been minimized.

Copy link
Member

AdSchellevis commented Feb 10, 2019

if the alias is visible in the interface, you should be able to assign it.

@fichtner fichtner added this to the 19.7 milestone Feb 10, 2019

fichtner added a commit that referenced this issue Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment