Start  trial

    Start trial

      roundel-database-and-shileld-01Hey there, database gurus! 
      In our journey through the world of database security, today we're taking a focused dive into one example from the CIS Benchmark for PostgreSQL 16 – Section 4.4 on revoking excessive Data Manipulation Language (DML) privileges.

      Before we jump in, here's a pro tip: you can download this specific benchmark from the CIS website at https://www.cisecurity.org/benchmark/postgresql. I highly recommend grabbing a copy to follow along as we explore this together. It's a fantastic way to see how a specific guideline can significantly strengthen your database's defence mechanisms.

      Diving into this specific CIS Benchmark for PostgreSQL is more than just a theoretical exercise; it's a hands-on approach to tightening your database security. And it's just one part of the broader picture.

      In my previous article on this series, I emphasized the crucial role of security benchmarks in safeguarding the security of your database. Establishing and adhering to security benchmarks is a proactive approach to protect your valuable data from unauthorized access, breaches, and potential data mishaps. Before we delve into our example, you might want to read about it here.

      Understanding DML privileges in PostgreSQL

      First off, let's dive into the topic at hand. DML privileges, which encompass actions like INSERT, UPDATE, DELETE, etc., are critical for user interactions with your database. It's essential to find the right balance for these privileges – they need to be just right, neither too generous nor too restrictive.

      Why Choose This Example? In the realm of database management, excessive DML privileges can create significant security vulnerabilities, leaving your database open to unintended or malicious data mishaps. Think of it as being like distributing too many keys to a safe. This particular example is a good choice for its simplicity and clarity, making it a fitting introduction to the concept and advantages of using database benchmarks.

      Tackling CIS Benchmark for PostgreSQL 16 - Section 4.4

      Step 1: Audit your privilegesill-3d-security-01-security-9-variation-01

      Kick off with an audit of your current privilege settings. PostgreSQL offers handy functions for this. By carefully auditing your privilege settings, you can identify any unnecessary or excessive privileges that may pose a risk to the integrity of your data.

      Your goal here is to spot any privileges that overshoot a user's role needs.

      Step 2: Develop a revocation planill-3d-security-01-security-8-variation-01

      Found some privileges that need trimming? Great, but let's not be hasty in revoking them.

      Plan this out, considering the potential impacts and communicating with your team to prep for changes. Will it affect any ongoing projects or tasks? Are there any dependencies on these privileges that need to be addressed? By thoroughly planning out the revocation process, you can minimize any disruptions and ensure a smooth transition.

      Step 3: Execute the revocationill-3d-security-01-security-5-variation-01

      Next comes the crucial step – utilizing the REVOKE command to strip away those unneeded privileges. For instance, executing REVOKE DELETE ON table_name FROM user_name; effectively removes the permission to delete records from table_name.

      When modifying any database, it's always advisable to script these changes, commit them to source control, and keep a record of when and what alterations are made. I'll be discussing this further in an upcoming blog, where we'll delve into pg_audit, which is an invaluable tool for monitoring DML changes in both Fujitsu Enterprise Postgres and PostgreSQL databases. It generates comprehensive audit logs, enabling you to track and document all DML activities.

      Step 4: Keep it upill-3d-security-01-security-7-variation-01

      Remember, database security is an ongoing game. Continuously review and adjust privileges to align with changing roles and responsibilities.

      Consider automating these audits for efficiency.

      Best practices to remember

      1. Embrace least privilege

        This principle is your best friend. Only grant the bare minimum access needed for each user.

      2. Document and communicate

        Maintain clear records of access permissions and keep your team in the loop about any changes.

      3. Stay vigilant

        Regularly monitor how privileges are being used. Unusual patterns? Investigate!

      Conclusion

      Diving into this specific CIS Benchmark for PostgreSQL is more than just a theoretical exercise; it's a hands-on approach to tightening your database security. And it's just one part of the broader picture. Keep that CIS benchmark handy as we continue to explore other key strategies in our upcoming blogs. Together, we'll ensure that your databases are not just operational but also secure fortresses.

      Next on this series

      In my next article, I'll deepen our exploration into Fujitsu Enterprise Postgres and PostgreSQL security by focusing on Access Control. See you there.

      Don't miss out on this valuable information - be sure to subscribe to be notified of new posts.

      Topics: PostgreSQL, Fujitsu Enterprise Postgres, Data governance, Security, CIS Benchmark, "Database security" blog series

      Receive our blog

      Fill the form to receive notifications of future posts

      Search by topic

      see all >
      photo-matthew-egan-in-hlight-circle-orange-yellow
      Gary Evans
      Senior Offerings and Center of Excellence Manager
      Gary Evans heads the Center of Excellence team at Fujitsu Software, providing expert services for customers in relation to PostgreSQL and Fujitsu Enterprise Postgres.
      He previously worked in IBM, Cable and Wireless based in London and the Inland Revenue Department of New Zealand, before joining Fujitsu. With over 15 years’ experience in database technology, Gary appreciates the value of data and how to make it accessible across your organization.
      Gary loves working with organizations to create great outcomes through tailored data services and software.
      Our Migration Portal helps you assess the effort required to move to the enterprise-built version of Postgres - Fujitsu Enterprise Postgres.
      We also have a series of technical articles for PostgreSQL enthusiasts of all stripes, with tips and how-to's.

       

      Explore PostgreSQL Insider >
      Subscribe to be notified of future blog posts
      If you would like to be notified of my next blog posts and other PostgreSQL-related articles, fill the form here.

      Read our latest blogs

      Read our most recent articles regarding all aspects of PostgreSQL and Fujitsu Enterprise Postgres.

      Receive our blog

      Fill the form to receive notifications of future posts

      Search by topic

      see all >