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

allowing enabling / disabling specific firewall rules / etc #49

Open
garci66 opened this issue May 3, 2021 · 8 comments
Open

allowing enabling / disabling specific firewall rules / etc #49

garci66 opened this issue May 3, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@garci66
Copy link

garci66 commented May 3, 2021

Looking at an enhancement and willing to contribute, but just wanted to share the idea first

I use my ER to setup a vpn for "out of country" access for my smart TV, etc which can't host their own vpn client. I enable it and disable it by activating a particular modify firewall rule.

Do you think it would be possible to do this through this integration? so that I can enable my vpn through HA?

thanks a million!

@elad-bar
Copy link
Owner

elad-bar commented May 3, 2021

Will check if that configuration is available over API

@elad-bar elad-bar added the enhancement New feature or request label May 3, 2021
@garci66
Copy link
Author

garci66 commented May 3, 2021

Thanks!! I looked into the GUI API (undocumented) but not sure which api you use.

in my case, for example its using the following:
https://192.168.1.1/api/edge/batch.json and with payload:
{"DELETE":{"firewall":{"modify":{"balance":{"rule":{"50":{"disable":null}}}}}}}

(in this case, it "deletes" the "disabled" status of the entry).

The reverse action is
{"SET":{"firewall":{"modify":{"balance":{"rule":{"50":{"disable":null}}}}}}}

(targetting the same endpoint)

@elad-bar
Copy link
Owner

elad-bar commented May 7, 2021

This is very specific use case, if i'll add it, it should be done more genric, how do you see it work?

Thanks

@garci66
Copy link
Author

garci66 commented May 8, 2021

Hi Elad, absolutely agree its super specific.

Maybe have a way of doing a customizable "set" and "delete" actions and the "content" is configurable by the user?

im currently on edgeos 1.9.0 but could upgrade no problem.

maybe we expose a one or more "switch" objects which use the "SET" verb when turned on and "DELETE" when off and have a user-provided api path like above? like

{"firewall":{"modify":{"balance":{"rule":{"50":{"disable":null}}}}}}

and we can configure this from the gui?

@Riftr
Copy link

Riftr commented May 25, 2021

This is very specific use case, if i'll add it, it should be done more genric, how do you see it work?

Thanks

Being able to enable/disable firewall rules will allow me to disable my kids internet access until their chores are done. Every parent will love you and every kid will curse your name!

@garci66
Copy link
Author

garci66 commented May 25, 2021 via email

@elad-bar
Copy link
Owner

in v2.x there is an option to store debug data, it will allow you to get the data available in the API, so we can add more features based on that information.

I would like to understand what is the structure of the rule you have set, can you please extract the firewall section out of the debug data?

once you have switch on the store debug data switch, there will be debug file in:
/config/.storage/edgeos.{entry_id}.debug.api.json

thanks

@elad-bar
Copy link
Owner

please note that with v2.0.14 there is no store debug files and data available in API:
http://[REPLACE_WITH_HA:PORT]/api/edgeos/[REPLACE_WITH_ENTRY_ID]/api

request authentication is the same as HA with long living token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants