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

Should remove unmanaged rules #5

Open
OrangeDog opened this issue Jan 10, 2019 · 5 comments
Open

Should remove unmanaged rules #5

OrangeDog opened this issue Jan 10, 2019 · 5 comments

Comments

@OrangeDog
Copy link

Removing an item from pillar does not remove the corresponding rules.
This state appears only able to add rules.

@ZakHargz
Copy link

+1 for this, it would be nice for the rule to be removed upon the pillar data being removed.

@ZakHargz
Copy link

ZakHargz commented Apr 15, 2020

We can include this within the "_states/ufw.py"

`import subprocess

subprocess.check_call('yes|ufw reset',
shell=True, executable='/bin/bash')
`

That fixes the problem (for the interim) it'll reset the rules and then re-apply from your Pillar data.

@OrangeDog
Copy link
Author

ufw reset will cause an interruption of service though. Especially bad if you drop your salt connection.

@ZakHargz
Copy link

The better solution would be to write a rule removal in python? Is this something you've done?

@OrangeDog
Copy link
Author

You would need to enumerate the current rules, compare them to the managed rules in some way, and remove the ones that don't match.

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

No branches or pull requests

2 participants