Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Fix iam permissions to access session recordings (#28)
Browse files Browse the repository at this point in the history
Also adjusted variable defaults

As per gravitational/teleport#3095
  • Loading branch information
iuriaranda authored Oct 22, 2019
1 parent 3c65424 commit a20d2bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ These are the requirements to apply this module:
| allowed_web_cidr_blocks | CIDR blocks that are allowed to access the web interface of the `proxy` server | list(string) | `["0.0.0.0/0"]` | no |
| ami_id | AMI id for the EC2 instance | string | `""` | no |
| environment | The environment where this setup belongs to. Only for naming reasons | string | - | yes |
| instance_type | Instance type for the EC2 instance | string | `"t2.small"` | no |
| key_name | SSH key name for the EC2 instance | string | - | yes |
| letsencrypt_email | Email to use to register to letsencrypt | string | `"[email protected]"` | no |
| instance_type | Instance type for the EC2 instance | string | `"t3.small"` | no |
| key_name | SSH key name for the EC2 instance | string | `null` | no |
| letsencrypt_email | Email to use to register to letsencrypt | string | - | yes |
| project | A project where this setup belongs to. Only for naming reasons | string | - | yes |
| r53_zone | The Route53 zone where to add the Teleport DNS record | string | - | yes |
| root_vl_delete | Whether the root volume of the EC2 instance should be destroyed on instance termination | bool | `true` | no |
Expand Down
10 changes: 7 additions & 3 deletions teleport-server/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EOF
}

resource "aws_iam_role_policy" "policy" {
role = aws_iam_role.role.id
role = aws_iam_role.role.id
policy = data.aws_iam_policy_document.teleport.json
}

Expand Down Expand Up @@ -64,8 +64,10 @@ data "aws_iam_policy_document" "teleport" {
resources = [
"arn:aws:dynamodb:${data.aws_region.current.name}:*:table/${local.teleport_dynamodb_table}",
"arn:aws:dynamodb:${data.aws_region.current.name}:*:table/${local.teleport_dynamodb_table}/*", # also allow operations on the table indexes
"arn:aws:dynamodb:${data.aws_region.current.name}:*:table/${local.teleport_dynamodb_table}/stream/*",
"arn:aws:dynamodb:${data.aws_region.current.name}:*:table/${local.teleport_dynamodb_table}_events",
"arn:aws:dynamodb:${data.aws_region.current.name}:*:table/${local.teleport_dynamodb_table}_events/*", # also allow operations on the table indexes
"arn:aws:dynamodb:${data.aws_region.current.name}:*:table/${local.teleport_dynamodb_table}_events/stream/*",
]
}

Expand All @@ -92,8 +94,9 @@ data "aws_iam_policy_document" "teleport" {
sid = "S3EventAccess"

actions = [
"s3:Get*",
"s3:Put*",
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectVersion"
]

resources = [
Expand All @@ -106,6 +109,7 @@ data "aws_iam_policy_document" "teleport" {

actions = [
"s3:ListBucket",
"s3:ListBucketVersions"
]

resources = [
Expand Down
4 changes: 2 additions & 2 deletions teleport-server/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ variable "subnet_id" {
variable "key_name" {
type = string
description = "SSH key name for the EC2 instance"
default = null
}

variable "r53_zone" {
Expand Down Expand Up @@ -44,13 +45,12 @@ variable "teleport_dynamodb_table" {
variable "instance_type" {
type = string
description = "Instance type for the EC2 instance"
default = "t2.small"
default = "t3.small"
}

variable "letsencrypt_email" {
type = string
description = "Email to use to register to letsencrypt"
default = "[email protected]"
}

variable "teleport_log_output" {
Expand Down

0 comments on commit a20d2bf

Please sign in to comment.