This module allows you to create Nexus Security as a global resource and individual Nexus Security resources. For individual examples, see the usage snippets and examples.
You need use a Nexus provider.
provider "nexus" {
insecure = true
password = "admin123"
url = "https://127.0.0.1:8080"
username = "admin"
}
nexus-security
:
module "nexus_security" {
source = "devops-ia/security/nexus"
nexus_security_anonymous = [
{
realm_name = "NexusAuthorizingRealm"
enabled = true
user_id = "anonymous"
},
]
nexus_security_content_selector = [
{
name = "example"
description = "example content selector"
expression = "format == \"raw\""
},
]
nexus_security_ldap = [
{
name = "example-ldap"
auth_schema = "NONE"
auth_username = "admin"
connection_retry_delay_seconds = 1
connection_timeout_seconds = 1
group_type = "static"
host = "ldap.example.com"
max_incident_count = 1
port = 389
protocol = "LDAP"
search_base = "dc=example,dc=com"
use_trust_store = false
auth_password = "t0ps3cr3t"
auth_realm = "EXAMPLE"
group_base_dn = "ou=Group"
group_id_attribute = "cn"
group_member_attribute = "memberUid"
group_member_format = "uid=username,ou=people,dc=example,dc=com"
group_object_class = "example"
group_subtree = true
ldap_groups_as_roles = true
user_base_dn = "ou=people"
user_email_address_attribute = "mail"
user_id_attribute = "uid"
user_ldap_filter = "(|(mail=*@example.com)(uid=dom*))"
user_member_of_attribute = "memberOf"
user_object_class = "posixGroup"
user_password_attribute = "exmaple"
user_real_name_attribute = "cn"
user_subtree = true
},
]
nexus_security_role = [
{
description = "Docker deployment role"
name = "docker-deploy"
privileges = [
"nx-repository-view-docker-*-*",
]
roleid = "docker-deploy"
},
]
nexus_security_saml = [
{
idp_metadata = "<EntityDescriptor ...>...</EntityDescriptor>"
username_attribute = "username"
entity_id = "http://nexus.example/service/rest/v1/security/saml/metadata"
validate_response_signature = true
validate_assertion_signature = true
first_name_attribute = "firstName"
last_name_attribute = "lastName"
email_attribute = "email"
groups_attribute = "groups"
},
]
nexus_security_user = [
{
userid = "admin"
firstname = "Administrator"
lastname = "User"
email = "[email protected]"
password = "admin123"
roles = ["nx-admin"]
status = "active"
},
]
}
nexus-security-anonymous
:
module "nexus_security_anonymous" {
source = "devops-ia/security/nexus//modules/nexus-security-anonymous"
enabled = true
realm_name = "NexusAuthorizingRealm"
user_id = "anonymous"
}
nexus-security-content-selector
:
module "nexus_security_content_selector" {
source = "devops-ia/security/nexus//modules/nexus-security-content-selector"
name = "example"
description = "example content selector"
expression = "format == \"raw\""
}
nexus-security-ldap
:
module "nexus_security_ldap" {
source = "devops-ia/security/nexus//modules/nexus-security-ldap"
name = "example-ldap"
auth_schema = "NONE"
auth_username = "admin"
connection_retry_delay_seconds = 1
connection_timeout_seconds = 1
group_type = "static"
host = "ldap.example.com"
max_incident_count = 1
port = 389
protocol = "LDAP"
search_base = "dc=example,dc=com"
use_trust_store = false
auth_password = "t0ps3cr3t"
auth_realm = "EXAMPLE"
group_base_dn = "ou=Group"
group_id_attribute = "cn"
group_member_attribute = "memberUid"
group_member_format = "uid=username,ou=people,dc=example,dc=com"
group_object_class = "example"
group_subtree = true
ldap_groups_as_roles = true
user_base_dn = "ou=people"
user_email_address_attribute = "mail"
user_id_attribute = "uid"
user_ldap_filter = "(|(mail=*@example.com)(uid=dom*))"
user_member_of_attribute = "memberOf"
user_object_class = "posixGroup"
user_password_attribute = "exmaple"
user_real_name_attribute = "cn"
user_subtree = true
}
nexus-security-ldap-order
:
module "nexus_security_ldap_order" {
source = "devops-ia/security/nexus//modules/nexus-security-ldap-order"
order = [
"server1",
"server2"
]
}
nexus-security-reamls
:
module "nexus_privilege_script" {
source = "devops-ia/security/nexus//modules/nexus-security-realms"
active = [
"NexusAuthenticatingRealm",
"DockerToken",
]
}
nexus-security-role
:
module "nexus_security_role" {
source = "devops-ia/security/nexus//modules/nexus-security-role"
description = "Docker deployment role"
name = "docker-deploy"
privileges = [
"nx-repository-view-docker-*-*",
]
roleid = "docker-deploy"
}
nexus-security-saml
:
module "nexus_security_saml" {
source = "devops-ia/security/nexus//modules/nexus-security-saml"
idp_metadata = "<EntityDescriptor ...>...</EntityDescriptor>"
entity_id = "http://nexus.example/service/rest/v1/security/saml/metadata"
validate_response_signature = true
validate_assertion_signature = true
username_attribute = "username"
first_name_attribute = "firstName"
last_name_attribute = "lastName"
email_attribute = "email"
groups_attribute = "groups"
}
nexus-security-user
:
module "nexus_security_user" {
source = "devops-ia/security/nexus//modules/nexus-security-user"
userid = "admin"
firstname = "Administrator"
lastname = "User"
email = "[email protected]"
password = "admin123"
roles = ["nx-admin"]
status = "active"
}
nexus-security-token
:
module "nexus_security_user_token" {
source = "devops-ia/security/nexus//modules/nexus-security-token"
enabled = true
protect_content = false
}
Name | Version |
---|---|
terraform | >= 1.3.0 |
nexus | >= 2.0.0 |
No providers.
Name | Source | Version |
---|---|---|
nexus_security_anonymous | ./modules/nexus-security-anonymous | n/a |
nexus_security_content_selector | ./modules/nexus-security-content-selector | n/a |
nexus_security_ldap | ./modules/nexus-security-ldap | n/a |
nexus_security_role | ./modules/nexus-security-role | n/a |
nexus_security_saml | ./modules/nexus-security-saml | n/a |
nexus_security_user | ./modules/nexus-security-user | n/a |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
nexus_security_anonymous | Security Anonymous. | list(object({ |
[] |
no |
nexus_security_content_selector | Security Content Selector. | list(object({ |
[] |
no |
nexus_security_ldap | Security Ldap. | list(object({ |
[] |
no |
nexus_security_role | Security Role. | list(object({ |
[] |
no |
nexus_security_saml | Security Saml. | list(object({ |
[] |
no |
nexus_security_user | Security User. | list(object({ |
[] |
no |
Name | Description |
---|---|
security_anonymous | Security Anonymous. |
security_content_selector | Security Content Selector. |
security_ldap | Security Ldap. |
security_role | Security Role. |
security_saml | Security Saml. |
security_user | Security User. |
Module is maintained by DevOps IA with help from these awesome contributors.