Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install instructions for EC2 and other typos #33

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ target/
**/*.rs.bk
*.pdb
logs/
aws_secretsmanager_agent/configuration/aws_secretsmanager_agent

#######

Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/aws-secretsmanager-agent.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,21 @@ Based on the type of compute, you have several options for installing the Secret

**To install the Secrets Manager Agent**

1. Use the `install` script provided in the repository\.
1. Copy the binary from the `target/` directory to the `aws_secretsmanager_agent/configuration/` directory:

The script generates a random SSRF token on startup and stores it in the file `/var/run/awssmatoken`\. The token is readable by the `awssmatokenreader` group that the install script creates\.
```sh
cp target/release/aws_secretsmanager_agent aws_secretsmanager_agent/configuration/.
```
2. Use the `install` script provided in the repository:

1. To allow your application to read the token file, you need to add the user account that your application runs under to the `awssmatokenreader` group\. For example, you can grant permissions for your application to read the token file with the following usermod command, where *<APP\_USER>* is the user ID under which your application runs\.
```sh
cd aws_secretsmanager_agent/configuration/ && ./install
```

The script generates a random SSRF token on startup and stores it in the file `/var/run/awssmatoken`\. The token is readable by the `awssmatokenreader` group that the install script creates.


3. To allow your application to read the token file, you need to add the user account that your application runs under to the `awssmatokenreader` group\. For example, you can grant permissions for your application to read the token file with the following usermod command, where *<APP\_USER>* is the user ID under which your application runs\.

```sh
sudo usermod -aG awssmatokenreader <APP_USER>
Expand Down Expand Up @@ -285,7 +295,7 @@ The following curl example shows how to get a secret from the Secrets Manager Ag
```sh
curl -v -H \
"X-Aws-Parameters-Secrets-Token: $(</var/run/awssmatoken)" \
'http://localhost:2773/secretsmanager/get?secretId=<YOUR_SECRET_ID>}'; \
'http://localhost:2773/secretsmanager/get?secretId=<YOUR_SECRET_ID>'; \
echo
```

Expand All @@ -301,7 +311,7 @@ import json
# Function that fetches the secret from Secrets Manager Agent for the provided secret id.
def get_secret():
# Construct the URL for the GET request
url = f"http://localhost:2773/secretsmanager/get?secretId=<YOUR_SECRET_ID>}"
url = f"http://localhost:2773/secretsmanager/get?secretId=<YOUR_SECRET_ID>"

# Get the SSRF token from the token file
with open('/var/run/awssmatoken') as fp:
Expand Down
Loading