Troubleshooting Configurations
The Error Message You May Never See - MySQL Error 1175
Discover MySQL Error 1175 - SQL_SAFE_UPDATES Explained. Protect your data from unintended updates. Learn how to fix it with a simple configuration change.
Discover MySQL Error 1175 - SQL_SAFE_UPDATES Explained. Protect your data from unintended updates. Learn how to fix it with a simple configuration change.
Technology is neither good nor bad; nor is it neutral. - Kranzberg’s 1st Law of Technology
Errors can be bad, but in this case, it turns out to be a relief.
Have you ever seen this error message?
If you have seen it, then you should buy your systems administrator, IT infrastructure team, or DevOps team a beer (or whatever celebratory beverage you choose).
Imagine you are in charge of a banking database and suddenly set everyone’s bank balance to 0, and not just the person who created a transaction.
An example table:
But it is able to alter the rows in the transactions table unconditionally.
While this is not the intended update, it is possible to protect data from unintended user actions using a simple configuration parameter.
You can confirm your current configuration by querying your MySQL database:
Find the configuration option file (my.cnf or my.in) and add:
And restart your MySQL server, sudo systemctl restart mysqld (or variant for your infrastructure).
Humor sidenote: When running the MySQL server, you can also enable this setting by calling the executable with the parameter `--i-am-a-dummy` (mysql-client also supports –i-am-a-dummy and –safe-updates as valid command-line parameters).
This feels like a simple thing. That good developers should catch and prevent in their software development process. But it shows how the default configurations for a lot of the software applications we use everyday may not be configured to protect data, be secure, or otherwise be optimal for your specific usage.
At CoGuard, we believe that infrastructure as code includes the configurations of the deployment environment. Where does this live? Is it dev? Is it build? Is it deployment? It has implications for all users. We've built a tool that can be added to the development, build and deploy processes that can discover configuration files for IaC, containers, networks and applications. Install it tfo day to see if how your configurations stand up to security best practices and common security compliance frameworks.