Skip to content

Commit

Permalink
Merge pull request #1 from hackforla/cb/example
Browse files Browse the repository at this point in the history
adding mvp terraform config for aws iam resources
  • Loading branch information
chelseybeck authored Feb 8, 2024
2 parents a093b0f + 3784b59 commit 4788af4
Show file tree
Hide file tree
Showing 39 changed files with 1,006 additions and 395 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Local .terraform directories
**/.terraform/*

# Ignore variables files
*.auto.tfvars

# Ignore override files
*.tfoverride

# Ignore environment-specific files
.envrc

# Ignore CLI configuration files
.terraformrc
terraform.rc

# Ignore metadata files
*.tfstate.lock.info
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Local Development/Installation instructions

Step-by-step instructions help new contributors get a development environment up and running quickly.
2. You'll want to find the balance between being specific enough for novices to follow, without being so specific that you reinvent the wheel by providing overly-basic instructions that can be found elsewhere.
3. Feel free to adapt this section and its sub-sections to your own processes.
4. Alternatively, you can move everything from *Installation instructions* through *Testing* to a separate **Contributing.md** file to keep your **ReadMe.md** more succinct.


### Working with issues

- Explain how to contribute to an existing issue.

### Working with forks and branches

- Explain your guidelines here.


### Working with pull requests and reviews

- Explain your process.
360 changes: 21 additions & 339 deletions LICENSE

Large diffs are not rendered by default.

65 changes: 9 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,26 @@
# Project title and description
# DevOps Security | AWS IAM Resources

Include a project description that explains **what** your project is and **why** it exists. Aim for no more than 3-5 concise sentences. For example, you might say:

{Project Name} is a project of Hack for LA. Hack for LA is a brigade of a Code for America that exists to {your mission}. {Project Name} helps {target users} accomplish {goal of project}. The {app/site/thing you're building}'s main features include {very brief feature descriptions}.

### Project context

Civic projects often exist within a larger context that may include multiple stakeholders, historic relationships, associated research, or other details that are relevant but not *required* for direct contributions. Gathering these details in one place is useful, but the ReadMe isn't that place. Use this section to [link to a Google Doc](#) or other documentation repository where contributors can dig in if they so choose. This is also a good place to link to your Code of Conduct.
DevOps Security is a code repository used to maintain Hack for L.A.'s AWS Identity Access Management (IAM) resources as code. This includes users, groups, policies, and roles.

### Technology used

- Each platform or framework should get its own bullet.
- Each platform should include an [active link](#) to the official documentation.


- [Terraform](https://www.terraform.io/)
- [Terraform Docs](https://terraform-docs.io/)
- [AWS CLI](https://aws.amazon.com/cli/)

# How to contribute

Explain the different ways people can contribute. For example:

- Join the team {on Slack/at our weekly hack night/etc}.
- To help with user research, {do ABC}.
- To provide design support, {do XYZ}.
- To contribute to the code, follow the instructions below.

Remember to provide direct links to each channel.



## Installation instructions

1. Step-by-step instructions help new contributors get a development environment up and running quickly.
2. You'll want to find the balance between being specific enough for novices to follow, without being so specific that you reinvent the wheel by providing overly-basic instructions that can be found elsewhere.
3. Feel free to adapt this section and its sub-sections to your own processes.
4. Alternatively, you can move everything from *Installation instructions* through *Testing* to a separate **Contributing.md** file to keep your **ReadMe.md** more succinct.


### Working with issues

- Explain how to submit a bug.
- Explain how to submit a feature request.
- Explain how to contribute to an existing issue.

To create a new issue, please use the blank issue template (available when you click New Issue). If you want to create an issue for other projects to use, please create the issue in your own repository and send a slack message to one of your hack night hosts with the link.


### Working with forks and branches

- Explain your guidelines here.


### Working with pull requests and reviews

- Explain your process.


### Testing

- Provide instructions.

- Join the DevOps Community of Practice (CoP).
- To contribute to the codebase, follow the [CONTRIBUTING.md](CONTRIBUTING.md) guide.


# Contact info

Include at least one way (or more, if possible) to reach your team with questions or comments.
This repo is maintained by the DevOps team. Reach out to our [CoP leads](https://github.com/hackforla/ops/wiki/Community#ops-community-of-practice-cop-leads) on Slack with questions or attend a [community meeting](https://github.com/hackforla/ops/wiki/CoP-Meetings)


### Licensing

Include details about the project's open source status.
[MIT License](/LICENSE)

*this readme file sourced from [Jessica Sand](http://jessicasand.com/other-stuff/just-enough-docs/)*
71 changes: 71 additions & 0 deletions terraform/.terraform.docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
formatter: "markdown table" # this is required
version: ""

header-from: main.tf
footer-from: ""

recursive:
enabled: false
path: modules

sections:
hide: []
show: []

content: |-
# Overview
Resources created by this code repository.
{{ .Header }}
{{ .Modules }}
{{ .Resources }}
{{ .Inputs }}
{{ .Outputs }}
{{ .Providers }}
{{ .Requirements }}
{{ .Footer }}
# Directory Structure
Terraform directory structure
- 📁 [terraform](https://github.com/hackforla/ops-security/tree/cb/example/terraform)
- 📁 [aws-custom-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies) - JSON configurations for customer-managed policies (AWS-managed policies are referenced by ARN and not needed here)
- 📁 [existing-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies/existing-policies) - a few of our current policy configurations for reference
- 📁 [modules](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules) - reusable Terraform configurations
- 📄 [aws-custom-policies.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain custom policies here
- 📄 [aws-groups.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain groups here
- 📄 [aws-users.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-users) - maintain users here
To automatically update this documentation, install terraform-docs on your local machine run the following:
`cd <directory of README location to update>`
`terraform-docs -c .terraform.docs.yml .`
output:
file: README.md
mode: replace
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
output-values:
enabled: false
from: ""

sort:
enabled: true
by: name

settings:
anchor: true
color: true
default: true
description: false
escape: true
hide-empty: true
html: true
indent: 2
lockfile: true
read-comments: true
required: true
sensitive: true
type: true
24 changes: 24 additions & 0 deletions terraform/.terraform.lock.hcl

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

33 changes: 33 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- BEGIN_TF_DOCS -->
# Overview
Resources created by this code repository.


## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_iam_read_only_group"></a> [iam\_read\_only\_group](#module\_iam\_read\_only\_group) | ./modules/aws-groups | n/a |
| <a name="module_iam_user_gwenstacy"></a> [iam\_user\_gwenstacy](#module\_iam\_user\_gwenstacy) | ./modules/aws-users | n/a |







# Directory Structure
Terraform directory structure

- 📁 [terraform](https://github.com/hackforla/ops-security/tree/cb/example/terraform)
- 📁 [aws-custom-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies) - JSON configurations for customer-managed policies (AWS-managed policies are referenced by ARN and not needed here)
- 📁 [existing-policies](https://github.com/hackforla/ops-security/tree/cb/example/terraform/aws-custom-policies/existing-policies) - a few of our current policy configurations for reference
- 📁 [modules](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules) - reusable Terraform configurations
- 📄 [aws-custom-policies.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain custom policies here
- 📄 [aws-groups.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-groups) - maintain groups here
- 📄 [aws-users.tf](https://github.com/hackforla/ops-security/tree/cb/example/terraform/modules/aws-users) - maintain users here

To automatically update this documentation, install terraform-docs on your local machine run the following:
`cd <directory of README location to update>`
`terraform-docs -c .terraform.docs.yml .`
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListUsersForConsole",
"Effect": "Allow",
"Action": "iam:ListUsers",
"Resource": "arn:aws:iam::*:*"
},
{
"Sid": "ViewAndUpdateAccessKeys",
"Effect": "Allow",
"Action": [
"iam:UpdateAccessKey",
"iam:CreateAccessKey",
"iam:ListAccessKeys"
],
"Resource": "arn:aws:iam::*:user/*"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:GetAccountSummary"
],
"Resource": "*"
},
{
"Sid": "AllowManageOwnPasswords",
"Effect": "Allow",
"Action": [
"iam:ChangePassword",
"iam:GetUser"
],
"Resource": "arn:aws:iam::*:user/${aws:username}"
},
{
"Sid": "AllowManageOwnAccessKeys",
"Effect": "Allow",
"Action": [
"iam:CreateAccessKey",
"iam:DeleteAccessKey",
"iam:ListAccessKeys",
"iam:UpdateAccessKey"
],
"Resource": "arn:aws:iam::*:user/${aws:username}"
},
{
"Sid": "AllowManageOwnSSHPublicKeys",
"Effect": "Allow",
"Action": [
"iam:DeleteSSHPublicKey",
"iam:GetSSHPublicKey",
"iam:ListSSHPublicKeys",
"iam:UpdateSSHPublicKey",
"iam:UploadSSHPublicKey"
],
"Resource": "arn:aws:iam::*:user/${aws:username}"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"elasticloadbalancing:DescribeTargetGroupAttributes",
"elasticloadbalancing:DescribeTags",
"s3:ListAllMyBuckets",
"ecr:GetRegistryScanningConfiguration"
],
"Resource": "*"
},
{
"Sid": "RDS",
"Effect": "Allow",
"Action": [
"rds:DescribeDBInstances",
"rds:DescribeDBClusters",
"rds:DescribeGlobalClusters",
"rds:DescribeDBInstances"
],
"Resource": "*"
}
]
}
Loading

0 comments on commit 4788af4

Please sign in to comment.