Skip to content
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
Closed

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

chrismarkovic opened this issue Feb 10, 2019 · 11 comments
Assignees
Labels
bug Production bug
Milestone

Comments

@chrismarkovic
Copy link

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 AdSchellevis added the support Community support label Feb 10, 2019
@AdSchellevis
Copy link
Member

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
Copy link
Author

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
Copy link
Member

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

@chrismarkovic
Copy link
Author

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
Copy link
Member

Which type of alias are you using?

@chrismarkovic
Copy link
Author

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

@AdSchellevis
Copy link
Member

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 Production bug and removed support Community support labels Feb 10, 2019
@chrismarkovic
Copy link
Author

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

@chrismarkovic
Copy link
Author

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

@AdSchellevis
Copy link
Member

50c25ea fixes the replacement on my end.

Install locally using:

opnsense-patch 50c25ea

@AdSchellevis
Copy link
Member

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 pushed 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
Labels
bug Production bug
Development

No branches or pull requests

3 participants