The main issue is that files in /etc are considered conffiles by dh_installdeb, that you are probably using during package build and thus are treated in a particular way by the packaging system as it is supposed that users may edit those files and that those changes should be preserved. For this reason they will not be removed with the package unless you explicitly purge it and they will preserve their permissions. I do not know any way that will let you to change the permissions of the configuration files with those of the same files in the package (e.g., --force-confnew
option of dpkg
does not work).
From the admin point of view, you should either purge the package (so that configuration files will be removed) and then reinstall the package or manually changing permissions.
From the packager point of view, you can fix the permissions in the postinst script, so that upgrading the package will fix the permissions. As an alternative you may also tweak the conffiles as explained here: once you install the new package, the permissions will be set to those of the files in the package.
In general you may also want to check if dh_fixperms is changing the permissions of your files during the packaging and eventually make it not act on those files (this is not the case).