Giter Site home page Giter Site logo

Comments (5)

jweilhammer avatar jweilhammer commented on May 30, 2024

Here are the full replication steps with an RDS PostgreSQL DB and psql:

  1. Logged in as master with psql:
-- Create two users for rotations 
CREATE ROLE user1 WITH PASSWORD 'password' LOGIN;
CREATE ROLE user2 WITH PASSWORD 'password' LOGIN;

-- Allow these to create objects in the DB (ours is already setup with master)
GRANT master TO user1;

-- Grant role membership like lambda does
GRANT user1 TO user2;
  1. Logged in as user2:
-- Create schema and table as user2
CREATE SCHEMA test_schema;
CREATE TABLE test_schema.test_table ( column1 TEXT );
SELECT * FROM test_schema.test_table;
/****************
 column1 
---------
(0 rows)
****************/


-- View schemas (notice owner)
\dn+

/****************
                                                    List of schemas
                         Name                         |   Owner    |    Access privileges     |      Description       
------------------------------------------------------+------------+--------------------------+------------------------
 public                                               | master     | master=UC/master        +| standard public schema
                                                      |            | =UC/master               | 
 test_schema                                          | user2      |                          | 
(2 rows)
****************/


-- View tables (notice owner)
\dt *.*

/****************
                                          List of relations
                        Schema                        |          Name           | Type  |   Owner    
------------------------------------------------------+-------------------------+-------+------------
 test_schema                                          | test_table              | table | user2
****************/
  1. Logged in as user1 (simulating rotation):
SELECT * FROM test_schema.test_table;
/****************
ERROR:  permission denied for schema test_schema
LINE 1: SELECT * FROM test_schema.test_table;
****************/

from aws-secrets-manager-rotation-lambdas.

whygoyal avatar whygoyal commented on May 30, 2024

Thank you for opening this issue - we are looking into it.

from aws-secrets-manager-rotation-lambdas.

jweilhammer avatar jweilhammer commented on May 30, 2024

Sorry, I had talked this out with AWS support a while ago.

The issue stems from the two users not being read-only. If they have write permissions, the rotation lambda runs into this issue

This issue can likely be closed out, and maybe the rotation documentation updated to specify the users are supposed to be read-only

from aws-secrets-manager-rotation-lambdas.

nidazehra1108 avatar nidazehra1108 commented on May 30, 2024

We have been facing this exact same issue with our service users(who are not read-only) and have opened up a case with AWS support as well. They mentioned adding it as a feature request.
For now, as a workaround, we are forcefully setting the role of the current user on application startup.
Any chance of reopening this PR that was closed #57?

from aws-secrets-manager-rotation-lambdas.

goyalya avatar goyalya commented on May 30, 2024

We have addressed this issue with updating the documentation on when to use single or Multi User rotation strategy.

from aws-secrets-manager-rotation-lambdas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.