Repository navigation
fix(users): block deletion of users with VPN - #1968
Open
gsanchietti wants to merge 2 commits into
Open
gsanchietti wants to merge 2 commits into
gsanchietti wants to merge 2 commits into
Conversation
Deleting a user from the users database left its OpenVPN Road Warrior certificate valid: it worked again if a user with the same name was created later. Refuse the deletion while the user has a Road Warrior account, so the account must be removed first and the certificate revoked. Assisted-by: Claude Code:Opus 5.5
Users deleted before the previous fix left a valid certificate behind: adding a Road Warrior account for a new user with the same name failed, and no action could revoke it. When adding an account, revoke a certificate left by a deleted user and generate a new one. Assisted-by: Claude Code:Opus 5.5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting a user from Users & Objects left their OpenVPN Road Warrior certificate valid. The certificate could work again if a user with the same name was created later. Found during the review of #1961, related to #1963.
A user with a Road Warrior account can no longer be deleted: the administrator must delete the VPN account first, and that step revokes the certificate. Certificates already left behind by older releases are revoked when a VPN account is added for a user with the same name. Before, that operation always failed with
user_certificate_already_exists.nethsec.users:delete_local_user()anddelete_remote_user()return the newuser_has_vpn_accountvalidation error, with unit testsns.ovpnrw add-user: revokes a certificate left by a deleted user and generates a new oneThis PR is based on #1961, which adds the certificate revocation code it uses: merge #1961 first.
How to test
uci delete users.<id>; uci commit users), leaving the certificate. Create the user again and add the VPN account: it succeeds, the old configuration is rejected withcertificate revoked, the new one connectsSee also
Generated by Claude Code:claude-opus-5-5 with nethserver-pr