Guest User

Untitled

a guest
May 25th, 2018
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. {
  2. "Version": "2012-10-17",
  3. "Statement": [
  4. {
  5. "Sid": "VisualEditor0",
  6. "Effect": "Allow",
  7. "Action": "rds-db:connect",
  8. "Resource": "arn:aws:rds:us-west-1:##########:db:foo_bar_instance/db_user_test"
  9. }
  10. ]
  11. }
  12.  
  13. mysql> CREATE USER db_user_test IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS';
  14. Query OK, 0 rows affected (0.01 sec)
  15.  
  16. mysql> GRANT USAGE ON *.* TO 'db_user_test'@'%'REQUIRE SSL;
  17. Query OK, 0 rows affected (0.01 sec)
  18.  
  19. mysql> show grants for 'db_user_test'@'%';
  20. +------------------------------------------------------+
  21. | Grants for db_user_test@% |
  22. +------------------------------------------------------+
  23. | GRANT USAGE ON *.* TO 'db_user_test'@'%' REQUIRE SSL |
  24. +------------------------------------------------------+
  25. 1 row in set (0.00 sec)
  26.  
  27. mysql>
  28.  
  29. [root@ip-10-101-115-129 ~]# bash -x test_auth_new.sh
  30. + RDSHOST=foo.bar.us-west-1.rds.amazonaws.com
  31. ++ aws rds generate-db-auth-token --hostname foo.bar.us-west-1.rds.amazonaws.com --port 3306 --username db_user_test
  32. + TOKEN='foo.bar.us-west-1.rds.amazonaws.com:3306/?TOKEN_HERE'
  33. + SSL_CERT=/root/rds-combined-ca-bundle.pem
  34. + mysql --host=foo.bar.us-west-1.rds.amazonaws.com --port=3306 --verbose --ssl-ca=/root/rds-combined-ca-bundle.pem --ssl-mode=VERIFY_IDENTITY --user=db_user_test '--password=foo.bar.us-west-1.rds.amazonaws.com:3306/?TOKEN_HERE' --enable-cleartext-plugin
  35. mysql: [Warning] Using a password on the command line interface can be insecure.
  36. ERROR 1045 (28000): Access denied for user 'db_user_test'@'10.101.115.129' (using password: YES)
Add Comment
Please, Sign In to add comment