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

Potential race condition on host startup #40

Closed
shinebayar-g opened this issue Dec 26, 2021 · 1 comment
Closed

Potential race condition on host startup #40

shinebayar-g opened this issue Dec 26, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@shinebayar-g
Copy link
Owner

There is a potential race condition on host startup. ufw-docker-automated needs to connect to docker socket to stream event data, thus it'll always start behind docker service. There could be a little window ufw-docker-automated might miss some containers on startup because of this.
Currently on startup, ufw-docker-automated will only look through ghost rules but doesn't perform any catch-up action to fix such issues. To fix this issue, program could get the running container list on startup then check if they needed follow up ufw-docker rules.

@shinebayar-g shinebayar-g self-assigned this Dec 26, 2021
@shinebayar-g shinebayar-g added the enhancement New feature or request label Dec 26, 2021
@shinebayar-g
Copy link
Owner Author

This is fixed. However, I'm not sure if it's optimal fix. Current implementation is program will get the list of the running containers on startup, then filter through UFW_MANAGED=TRUE label. Then simply creating all of the ufw rules for them without checking if it's existing or not, since ufw program handles duplication correctly. This duplication check is mentioned in #38

This was referenced Dec 27, 2021
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

1 participant