From the course: Python: Pen Testing AWS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Managing secrets using Python

Managing secrets using Python - Python Tutorial

From the course: Python: Pen Testing AWS

Start my 1-month free trial

Managing secrets using Python

- [Instructor] We've already seen how we can access the IAM service in Python. So now let's see how we can programmatically interact with the secrets manager. We can see here the range of methods available through the secrets manager API. We'll start with our standard program frame, nano starter dot py minus L and I'll add a session handle using boto 3 dot session and I'll use the default profile and we don't need a region. I'll request to client of the secrets manager service. Let's start by listing the secrets in the account. I haven't added any so this will be an empty list, print secrets and then S E C L I S T set list equals S M dot list secrets. And we'll pretty print dot pretty print seclist. Okay, now let's get a randomly constructed password and list out the Jason structure which we get back. P W D equals S M dot get random password and we'll requested password length of 16. We'll print random, we'll do a…

Contents