I am having a very similar issue. However, none of the admin users i create via terraform can do anything other than log in. For instance, i add the ssh boundary_account (refer to terraform) i made to a user via admin, i do a log in,
boundary authenticate password \
-login-name=ssh \
-password supersecure \
-auth-method-id=ampw_9pfeAr7tbi
with the response
Authentication information:
Account ID: apw_Eqf0TfRWAx
Auth Method ID: ampw_sQTelGNy1o
Expiration Time: Sat, 31 Oct 2020 10:56:24 -03
Token: at_4nip202bP7_s13B9hbMfw5mwoqrkcPyE4T5FFnM6yfDMDJ4MX1aBK8oFnYsnDpbJA6QgVnrnBEV197JXzdKY9XoXaBt6m3UEVVSa2LzypgUBDYAEuiZyt5yoigjJR
User ID: u_yMSDoLsY4Q
and i want to do boundary roles list -scope-id p_MGQYbBzG1W
where is the scope-id is the project that terraform created within the organization that the user exists
i get a
Error information:
Code:
Message: Forbidden
Status: 403
Terraform:
provider "boundary" {
addr = "http://127.0.0.1:9200"
auth_method_id = "ampw_NLkkHNcQoP"
password_auth_method_login_name = "admin"
password_auth_method_password = "pnB7j6d0FuLIEUGCe1tb"
}
variable "users" {
type = set(string)
default = [
"Jim",
"Mike",
"Todd",
"Jeff",
"Randy",
"Susmitha"
]
}
variable "readonly_users" {
type = set(string)
default = [
"Pete",
"JT"
]
}
variable "backend_server_ips" {
type = set(string)
default = [
"192.168.1.120",
"10.1.0.2",
]
}
resource "boundary_scope" "global" {
global_scope = true
scope_id = "global"
}
resource "boundary_scope" "corp" {
scope_id = boundary_scope.global.id
auto_create_admin_role = true
auto_create_default_role = true
name = "Corp"
description = "Corp"
}
resource "boundary_auth_method" "password" {
name = "org_auth_method"
description = "Password auth method for org"
type = "password"
scope_id = boundary_scope.corp.id
}
resource "boundary_account" "ssh_users" {
// for_each = var.users
name = "ssh"
description = "Login account for ssh"
type = "password"
login_name = "ssh"
password = "supersecure"
auth_method_id = boundary_auth_method.password.id
}
//locals {
// users = {for s in var.users: index(var.users, s) => s}
//}
resource "boundary_user" "users" {
for_each = var.users
name = each.key
description = "User resource for ${each.key}"
// account_ids = [ boundary_account.ssh_users[index(var.users, each.value) + 1].id ]
scope_id = boundary_scope.corp.id
}
resource "boundary_user" "readonly_users" {
for_each = var.readonly_users
name = each.key
description = "User resource for ${each.key}"
scope_id = boundary_scope.corp.id
}
// organiation level group for readonly users
resource "boundary_group" "readonly_users" {
name = "readonly"
description = "Organization group for readonly users"
member_ids = [for user in boundary_user.readonly_users : user.id]
scope_id = boundary_scope.corp.id
}
// add org-level role for readonly access
resource "boundary_role" "organization_readonly" {
name = "readonly"
description = "Read-only role"
principal_ids = [boundary_group.readonly_users.id]
grant_strings = ["id=*;type=*;actions=read"]
scope_id = boundary_scope.corp.id
}
// add org-level role for administration access
resource "boundary_role" "organization_admin" {
name = "admin"
description = "Administrator role"
principal_ids = concat(
[for user in boundary_user.users: user.id]
)
grant_strings = ["id=*;type=*;actions=create,read,update,delete"]
scope_id = boundary_scope.corp.id
}
// create a project for core infrastructure
resource "boundary_scope" "core_infra" {
description = "Core infrastrcture"
scope_id = boundary_scope.corp.id
auto_create_admin_role = true
}
resource "boundary_host_catalog" "backend_servers" {
name = "backend_servers"
description = "Backend servers host catalog"
type = "static"
scope_id = boundary_scope.core_infra.id
}
resource "boundary_host" "backend_servers" {
for_each = var.backend_server_ips
type = "static"
name = "backend_server_service_${each.value}"
description = "Backend server host"
address = each.key
host_catalog_id = boundary_host_catalog.backend_servers.id
}
resource "boundary_host_set" "backend_servers_ssh" {
type = "static"
name = "backend_servers_ssh"
description = "Host set for backend servers"
host_catalog_id = boundary_host_catalog.backend_servers.id
host_ids = [for host in boundary_host.backend_servers : host.id]
}
// create target for accessing backend servers on port :8000
resource "boundary_target" "backend_servers_service" {
type = "tcp"
name = "backend_servers_service"
description = "Backend service target"
scope_id = boundary_scope.core_infra.id
default_port = "8080"
host_set_ids = [
boundary_host_set.backend_servers_ssh.id
]
}
// create target for accessing backend servers on port :22
resource "boundary_target" "backend_servers_ssh" {
type = "tcp"
name = "backend_servers_ssh"
description = "Backend SSH target"
scope_id = boundary_scope.core_infra.id
default_port = "22"
host_set_ids = [
boundary_host_set.backend_servers_ssh.id
]
}
PS I am not USING DEV. this is the single instance server config i use:
disable_mlock = true
controller {
name = "demo-controller-1"
description = "A controller for a demo!"
database {
url = "postgresql://boundary:ohv5Tex2zei7bahbiekooqu6eingeesh@localhost:5432/boundary?sslmode=disable"
}
}
worker {
name = "demo-worker-1"
description = "A default worker created demonstration"
controllers = [
"127.0.0.1",
]
// public_addr = "myhost.mycompany.com"
}
listener "tcp" {
address = "0.0.0.0"
purpose = "api"
tls_disable = true
// cors_enabled = true
// cors_allowed_origins = ["yourcorp.yourdomain.com"]
}
listener "tcp" {
address = "127.0.0.1"
purpose = "cluster"
tls_disable = true
}
listener "tcp" {
purpose = "proxy"
tls_disable = true
}
# Root KMS configuration block: this is the root key for Boundary
# Use a production KMS such as AWS KMS in production installs
kms "aead" {
purpose = "root"
aead_type = "aes-gcm"
key = "sP1fnF5Xz85RrXyELHFeZg9Ad2qt4Z4bgNHVGtD6ung="
key_id = "global_root"
}
# Worker authorization KMS
# Use a production KMS such as AWS KMS for production installs
# This key is the same key used in the worker configuration
kms "aead" {
purpose = "worker-auth"
aead_type = "aes-gcm"
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
key_id = "global_worker-auth"
}
# Recovery KMS block: configures the recovery key for Boundary
# Use a production KMS such as AWS KMS for production installs
kms "aead" {
purpose = "recovery"
aead_type = "aes-gcm"
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
key_id = "global_recovery"
}