-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/4/self managed ssh keys (#5)
* Support self-managed SSH keys plus file cleanup * CHANGELOG.md bump
- Loading branch information
Showing
13 changed files
with
89 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## v0.0.3 (2019-08-02) | ||
|
||
* Self-managed SSH keys supported | ||
|
||
## v0.0.2 (2019-08-01) | ||
|
||
* Tags added! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ locals { | |
}, | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ locals { | |
}, | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,4 +77,3 @@ variable "tags" { | |
type = map(string) | ||
default = {} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,79 +9,79 @@ This module generates a single user, and adds them to appropriate groups. | |
# Usage instructions: | ||
1. Generate a PGP key | ||
1. Generate a PGP key | ||
### Option A | ||
### Option A | ||
Use keybase.io. You can just feed your keybase.io username in to this module | ||
and we'll do the rest. | ||
Use keybase.io. You can just feed your keybase.io username in to this module | ||
and we'll do the rest. | ||
### Option B | ||
### Option B | ||
[Find some supported software for your platform](https://gnupg.org/download/) | ||
[Find some supported software for your platform](https://gnupg.org/download/) | ||
2. Use this module to create your user | ||
2. Use this module to create your user | ||
\`\`\` | ||
module "stuart" { | ||
source = "[email protected]:aceteknologi/terraform-iam.git//user?ref=v0.0.1" | ||
\`\`\` | ||
module "stuart" { | ||
source = "[email protected]:aceteknologi/terraform-iam.git//user?ref=v0.0.1" | ||
username = "[email protected]" | ||
username = "[email protected]" | ||
# if you used keybase.io this could be | ||
# public_pgp_key = "keybase:<username>" | ||
# if you used keybase.io this could be | ||
# public_pgp_key = "keybase:<username>" | ||
# or it could be something long-winded, like | ||
# public_pgp_key = "mQINBFxre0gBEADEP8d8Lp9Yn6wMLhBuJxtTpEOivHkvxClBdz7neGz/t679LwbDIZJcbX3maFpH8+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GVsAEQEAAYkCPAQYAQgAJhYhBP3a+j9ZC9jmPTIyIWE+fRA/VsHqBQJca3tIAhsMBQkACTqAAAoJEGE+fRA/VsHqr9kQAL8icxR1JnhoCPwoGLiTTOXH8wBvJFol1aYeGE9nSkvIa3h1XrqgzvoHQDJYqbzgcFwhmxklFilQDPHEygmRHliQNgu/XxIJFxP21VWPlP3cJzLmmCluc0yd8lEaFlQHOQd+BP7YRCktnTcQQNc3/xQVnopIGVAfDVADSGnnz510rAWVQV3QHG4acY5E2ArdCMWcktqa5kuyEzGT0tWrebH7eiTj9l2v46ypfvgSfxGFmaMgqQmT8Ug+fYo9RXUg3hpM8hseq4d+fdkIZXlKkKTMgv3wH9i86zjuVMAmOrEty6EFDC284gjmIunVxpIbZTYsEucrMYIBytfqLNmOC49utScOQWhpT3aXknpXHE0zVKxVcn/VM/dlWD9rKJKTp4RuWVKKv161360/0oMMzBb/CSiexsIJI2IEAjpw4n53RKRNZjX6RDeRnQqvAYEKG3qMUlEvMN2WtmVuKChmgg5Kc2qbTAa0FkY1SSH2QYt+ew+USabX6+Ni8UG7uKCht81Wo26ffkdSfiIj+jKJBS7A8llvNQpNU9r7fyOmlxvUxdqUBw2BDVX3RVul5jHEckJb6JpCZh9ik8TYo8TOAWM111Cwm5xTAaSBcqc7E4w5/RlGfQN4diC4FdsQicSiG05vnPrh/ROQYbge1ZwRN7w9hAJ8JMywYFN/GpzdroYJ" | ||
# or it could be something long-winded, like | ||
# public_pgp_key = "mQINBFxre0gBEADEP8d8Lp9Yn6wMLhBuJxtTpEOivHkvxClBdz7neGz/t679LwbDIZJcbX3maFpH8+2LwRSFlV5OPJvv4Ldee2xKDxkSI7mhBSd0VsrndJ+gD2n++P1iN5XElif75O7OS5kdU3ikloZGxgGXA+bz1hKYlg48PTvWatHGlQoZvd4yzMxBhW80eNlW+rUOAQ8fKAzur0VJdA8VYGAo1IV6EhZXRrLiQGvCG2HY5oKux4TZqrh8+OXNjRRdhtVk9sKPHHbwd+Zkm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cJzLmmCluc0yd8lEaFlQHOQd+BP7YRCktnTcQQNc3/xQVnopIGVAfDVADSGnnz510rAWVQV3QHG4acY5E2ArdCMWcktqa5kuyEzGT0tWrebH7eiTj9l2v46ypfvgSfxGFmaMgqQmT8Ug+fYo9RXUg3hpM8hseq4d+fdkIZXlKkKTMgv3wH9i86zjuVMAmOrEty6EFDC284gjmIunVxpIbZTYsEucrMYIBytfqLNmOC49utScOQWhpT3aXknpXHE0zVKxVcn/VM/dlWD9rKJKTp4RuWVKKv161360/0oMMzBb/CSiexsIJI2IEAjpw4n53RKRNZjX6RDeRnQqvAYEKG3qMUlEvMN2WtmVuKChmgg5Kc2qbTAa0FkY1SSH2QYt+ew+USabX6+Ni8UG7uKCht81Wo26ffkdSfiIj+jKJBS7A8llvNQpNU9r7fyOmlxvUxdqUBw2BDVX3RVul5jHEckJb6JpCZh9ik8TYo8TOAWM111Cwm5xTAaSBcqc7E4w5/RlGfQN4diC4FdsQicSiG05vnPrh/ROQYbge1ZwRN7w9hAJ8JMywYFN/GpzdroYJ" | ||
# Maximum 10 groups! | ||
groups = [ | ||
"\${module.groups.self_management_group_name}", | ||
"\${module.groups.devops_group_name}", | ||
"\${module.groups.devops_prod_group_name}", | ||
"\${module.groups.superuser_group_name}", | ||
"\${module.groups.superuser_prod_group_name}", | ||
] | ||
# Maximum 10 groups! | ||
groups = [ | ||
"\${module.groups.self_management_group_name}", | ||
"\${module.groups.devops_group_name}", | ||
"\${module.groups.devops_prod_group_name}", | ||
"\${module.groups.superuser_group_name}", | ||
"\${module.groups.superuser_prod_group_name}", | ||
] | ||
tags = "\${local.tags}" | ||
} | ||
tags = "\${local.tags}" | ||
} | ||
output "stuart" { | ||
value = <<EOF | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Initial login details for \${module.stuart.name} | ||
output "stuart" { | ||
value = <<EOF | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Initial login details for \${module.stuart.name} | ||
Password: \${module.stuart.encrypted_password} | ||
Password: \${module.stuart.encrypted_password} | ||
Please decrypt this password with the PGP key with the fingerprint \${module.stuart.key_fingerprint} | ||
Hint: \`echo "\${module.stuart.encrypted_password}" | base64 --decode | gpg\` | ||
OR | ||
\`echo "\${module.stuart.encrypted_password}" | base64 --decode | keybase pgp decrypt\` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
EOF | ||
} | ||
\`\`\` | ||
Please decrypt this password with the PGP key with the fingerprint \${module.stuart.key_fingerprint} | ||
Hint: \`echo "\${module.stuart.encrypted_password}" | base64 --decode | gpg\` | ||
OR | ||
\`echo "\${module.stuart.encrypted_password}" | base64 --decode | keybase pgp decrypt\` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
EOF | ||
} | ||
\`\`\` | ||
3. Decode the output | ||
3. Decode the output | ||
\`echo "wcFMA/........." | base64 --decode | gpg\` | ||
\`echo "wcFMA/........." | base64 --decode | gpg\` | ||
4. Login to the [console!](https://console.aws.amazon.com/) | ||
4. Login to the [console!](https://console.aws.amazon.com/) | ||
# Enter your account ID | ||
# Enter your username | ||
# Enter your decrypted password | ||
# Enter your account ID | ||
# Enter your username | ||
# Enter your decrypted password | ||
5. Navigate to IAM » <Your User> » Security credentials | ||
5. Navigate to IAM » <Your User> » Security credentials | ||
6. Next to "Assigned MFA device", hit the "Manage" link and create yourself an | ||
MFA device | ||
6. Next to "Assigned MFA device", hit the "Manage" link and create yourself an | ||
MFA device | ||
7. Sign out | ||
7. Sign out | ||
8. Sign in (this time with MFA!) | ||
8. Sign in (this time with MFA!) | ||
9. Navigate back to IAM » <Your User> » Security credentials | ||
9. Navigate back to IAM » <Your User> » Security credentials | ||
10. Hit the create access key button! You now have keys. Rotate them often. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ locals { | |
}, | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ variable "tags" { | |
|
||
variable "username" { | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |