diff --git a/Dockerfile.bullseye b/Dockerfile.bullseye
index 30a6735952d6e625b01e21544f19c0aa46140fa5..d1cd9c4a3ffb787104d8ebd79f40b952101ad73a 100644
--- a/Dockerfile.bullseye
+++ b/Dockerfile.bullseye
@@ -9,6 +9,7 @@ RUN apt-get -qq update && \
         python3-pip python3-qrcode python3-fido2 python3-oauthlib python3-flask-babel python3-pytest python3-all python3-pip \
         git-buildpackage debhelper dh-python mariadb-server && \
     pip3 install pylint html5validator twine build --upgrade && \
+    mysql_secure_installation && \
     apt-get -qq clean
 
 FROM uffd-base AS openldap-base
diff --git a/Dockerfile.buster b/Dockerfile.buster
index 2f8a4f5f4b25fc2d637412483b46f006eb40e010..22da9cda56a40cee0ba82eb776f3a110f044c08d 100644
--- a/Dockerfile.buster
+++ b/Dockerfile.buster
@@ -9,6 +9,7 @@ RUN apt-get -qq update && \
         python3-pip python3-qrcode python3-fido2 python3-oauthlib python3-flask-babel python3-pytest python3-all python3-pip \
         git-buildpackage debhelper dh-python mariadb-server && \
     pip3 install pylint html5validator twine build --upgrade && \
+    mysql_secure_installation && \
     apt-get -qq clean
 
 FROM uffd-base AS openldap-base