Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment version to 1.3.19 #166

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
01b8e4b
1.x only have 1.x opensearch/dashboards apps (#64)
peterzhuamazon May 23, 2022
5bb16bc
[backport 1.x] Backport #62 (#69)
peterzhuamazon May 25, 2022
5bc19d5
Release 1.3.3 (#73)
prudhvigodithi Jun 9, 2022
d45969a
Add saravanan30erd as the default reviewer of ansible repo (#76)
peterzhuamazon Jun 30, 2022
690f3c5
OIDC auth, custom configs (#63) (#78)
peterzhuamazon Jul 13, 2022
9b47ca6
Update to 1.3.4 version (#79)
zelinh Jul 14, 2022
58dbda2
Release 1.3.3 (#93)
prudhvigodithi Sep 1, 2022
20af2f8
[1.x] Fix nonexistent os_sec_plugin_conf_path directory error. (#81)
rodolfovillordo Oct 4, 2022
1ec957d
Update version to 1.3.6 (#100)
zelinh Oct 6, 2022
e5463ca
Fix securityadmin.sh when copy_custom_security_configs is False (#85)…
peterzhuamazon Oct 7, 2022
1ccd332
become: false on "Check that the files/internal_users.yml exists" (#8…
peterzhuamazon Oct 7, 2022
4b91e9c
Update version to 1.3.7 (#105)
rishabh6788 Dec 13, 2022
e1351e0
version bump to 1.3.8 (#110)
rishabh6788 Feb 2, 2023
c8ff034
bump 1.x version to 1.3.9 (#121)
jordarlu Mar 20, 2023
59a4354
wait for port to be open instead of hard-coded 10 seconds (#123) (#128)
peterzhuamazon Mar 31, 2023
0aaabc8
Release 1.3.10 (#131)
prudhvigodithi May 18, 2023
3339f2e
Release version 1.3.11 (#136)
jordarlu Jun 29, 2023
99f8eb4
Backport 1.x PR #119 #129 #126 #135 #132 (#139)
peterzhuamazon Aug 10, 2023
0940543
Release 1.3.12 (#140)
Divyaasm Aug 10, 2023
8bb9b4b
Increment os & osd version for the release 1.3.13 (#143)
zelinh Sep 21, 2023
e4fa148
Increment OS&OSD version for release 1.3.14 (#150)
zelinh Dec 19, 2023
38aafaa
Increment version to release 1.3.15 (#154)
jordarlu Mar 5, 2024
e81de08
Increment version for 1.3.16 release (#157)
zelinh Apr 23, 2024
3586724
ncrement version for 1.3.17 release (#161)
Divyaasm Jun 6, 2024
37a2d2a
Increment version for 1.3.18 release (#163)
zelinh Jul 17, 2024
82ddaed
disable selinux for debian (#152) (#164)
peterzhuamazon Jul 22, 2024
730fe73
Increment version for 1.3.19
bshien Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
* @opensearch-project/engineering-effectiveness
* @bbarani @saravanan30erd @peterzhuamazon @prudhvigodithi @gaiksaya @TheAlgo
18 changes: 0 additions & 18 deletions .github/workflows/dco.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .idea/.gitignore

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

22 changes: 13 additions & 9 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
## Maintainers
## Overview

| Maintainer | GitHub ID | Affiliation |
| --------------- | --------- | ----------- |
| Barani Bikshandi | [bbarani](https://github.com/bbarani) | Amazon |
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
| Sayali Gaikawad | [gaiksaya](https://github.com/gaiksaya) | Amazon |
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
| Saravanan Palanisamy | [saravanan30erd](https://github.com/saravanan30erd) | Community |
This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md).

## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| ------------------- | --------------------------------------------------- | ----------- |
| Barani Bikshandi | [bbarani](https://github.com/bbarani) | Amazon |
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
| Sayali Gaikawad | [gaiksaya](https://github.com/gaiksaya) | Amazon |
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
|Dhiraj Kumar Jain | [TheAlgo](https://github.com/TheAlgo) | Amazon |
| Saravanan Palanisamy | [saravanan30erd](https://github.com/saravanan30erd) | Community |

[This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) explains what maintainers do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
58 changes: 55 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@

A community repository for Ansible Playbook of OpenSearch Project.

## Version and Branching
As of now, this ansible-playbook repository maintains 2 branches:
* _main_ (Version is 2.x.x for both `os_version` and `os_dashboards_version` in `inventories/opensearch/group_vars/all/all.yml`)
* _1.x_ (Version is 1.x.x for both `os_version` and `os_dashboards_version` in `inventories/opensearch/group_vars/all/all.yml`)
<br>

Contributors should choose the corresponding branch(es) when commiting their change(s):
* If you have a change for a specific version, only open PR to specific branch
* If you have a change for all available versions, first open a PR on `main`, then open a backport PR with `[backport 1.x]` in the title, with label `backport 1.x`, etc.

## OpenSearch Installation with Dashboards

This ansible playbook supports the following,
Expand All @@ -23,6 +33,8 @@ This ansible playbook supports the following,
- Configure TLS/SSL for OpenSearch transport layer(Nodes to Nodes communication) and REST API layer
- Generate self-signed certificates to configure TLS/SSL for opensearch
- Configure the Internal Users Database with limited users and user-defined passwords
- Configuration of authentication and authorization via OpenID
- Overriding default settings with your own
- Install and configure the Apache2.0 opensource OpenSearch Dashboards

### Prerequisite
Expand Down Expand Up @@ -83,17 +95,57 @@ cluster_type: single-node


# Deploy with ansible playbook - run the playbook as root
ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789"
ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789 logstash_password=Test@456"

You should set the reserved users(`admin` and `kibanaserver`) password using `admin_password` and `kibanaserver_password` variables.
You should set the reserved users(`admin`, `kibanaserver`, and `logstash`) password using `admin_password`, `kibanaserver_password`, and `logstash_password` variables.

If you define your own internal users (in addition to the reserved `admin`, `kibanaserver`, and `logstash`) in custom configuration
files, then passwords to them should be set via variables on the principle of `<username>_password`

It will install and configure the opensearch. Once the deployment completed, you can access the opensearch Dashboards with user `admin` and password which you provided for variable `admin_password`.

# Deploy with ansible playbook - run the playbook as non-root user which have sudo privileges,
ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789" --become
ansible-playbook -i inventories/opensearch/hosts opensearch.yml --extra-vars "admin_password=Test@123 kibanaserver_password=Test@6789 logstash_password=Test@456" --become

**Note**: Change the user details in `ansible_user` parameter in `inventories/opensearch/hosts` inventory file.

### OpenID authentification
To enable authentication via OpenID, you need to change the `auth_type` variable in the inventory file
`inventories/opensearch/group_vars/all/all.yml` by setting the value `oidc` and prescribe the necessary settings
in the `oidc:` block.

### Custom configuration files

To override the default settings files, you need to put your settings in the `files` directory. The files should be
named exactly the same as the original ones (internal_users.yml, roles.yml, tenants.yml, etc.)

Especially note the file `files/internal_users.yml`. If it exists and the `copy_custom_security_configs: true` setting is enabled,
then only in this case the task of setting passwords for internal users from variables is started. If the file `internal_users.yml`
is not located in the `files` directory, but, for example, in one of its subdirectories, then playbook will not work correctly

### IaC (Infrastructure-as-Code)

If you want to use the role not only for the initial deployment of the cluster, but also for further management of it,
then set the `iac_enable` parameter to `true`.

By default, if the /tmp/opensearch-nodecerts directory with certificates exists on the server from which the playbook
is launched, it is assumed that the configuration has not changed and some settings are not copied to the target servers.

Conversely, if the /tmp/opensearch-nodecerts directory does not exist on the server from which the playbook is launched,
then new certificates and settings are generated and they are copied to the target servers.

If you use this repository not only for the initial deployment of the cluster, but also for its automatic configuration
via CI/CD, then new certificates will be generated every time the pipeline is launched, overwriting existing ones, which
is not always necessary if the cluster is already in production.

When iac_enable enabling, and all the cluster servers have all the necessary certificates, they will not be copied again.
If at least on one server (for example, when adding a new server to the cluster) if there is not at least one certificate
from the list, then all certificates on all cluster servers will be updated

Also, if the option is enabled, the settings files will be updated with each execution (previously, the settings were
updated only if the /tmp/opensearch-nodecerts directory was missing on the server from which the playbook was launched
and new certificates were generated)

## Contributing

See [developer guide](DEVELOPER_GUIDE.md) and [how to contribute to this project](CONTRIBUTING.md).
Expand Down
26 changes: 26 additions & 0 deletions files/internal_users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# This is the internal user database
# The hash value is a bcrypt hash and can be generated with plugin/tools/hash.sh

_meta:
type: "internalusers"
config_version: 2

# Define your internal users here

admin:
hash: "{{ admin_password }}"
reserved: true
backend_roles:
- "admin"
description: "admin user"

kibanaserver:
hash: "{{ kibanaserver_password }}"
reserved: true
description: "kibanaserver user"

logstash:
hash: "{{ logstash_password }}"
reserved: true
description: "logstash user"
54 changes: 54 additions & 0 deletions files/roles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
_meta:
type: "roles"
config_version: 2


indexes_full_access:
reserved: false
index_permissions:
- index_patterns:
- "*"
allowed_actions:
- "*"
tenant_permissions:
- tenant_patterns:
- "*"
allowed_actions:
- "kibana_all_write"
# ----------------------------------------------------
indexes_security_search_full_access:
reserved: true
index_permissions:
- index_patterns:
- "kube-apiserver-audit-*"
- "syslog-*"
allowed_actions:
- "indices:data/read/search*"
- "read"
- "view_index_metadata"
tenant_permissions:
- tenant_patterns:
- "SECURITY"
allowed_actions:
- "kibana_all_write"
# ----------------------------------------------------
indexes_web_search_full_access:
reserved: true
index_permissions:
- index_patterns:
- "ingress-nginx-*"
- "mywebapp-*"
allowed_actions:
- "indices:data/read/search*"
- "read"
- "view_index_metadata"
tenant_permissions:
- tenant_patterns:
- "WEB"
allowed_actions:
- "kibana_all_write"
# ----------------------------------------------------
# Restrict users so they can only view visualization and dashboard on OpenSearchDashboards
kibana_read_only:
reserved: true
59 changes: 59 additions & 0 deletions files/roles_mapping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# In this file users, backendroles and hosts can be mapped to Security roles.
# Permissions for OpenSearch roles are configured in roles.yml

_meta:
type: "rolesmapping"
config_version: 2

kibana_server:
reserved: true
users:
- "kibanaserver"

logstash:
reserved: true
users:
- "logstash"

# Define your roles mapping here
all_access:
reserved: false
backend_roles:
- "admin"
- "opensearch_admin"
description: "Maps admin to all_access"
# ----------------------------------------------------
indexes_full_access:
reserved: false
backend_roles:
- "opensearch_admin"
description: "Maps admin to indexes_full_access"
# ----------------------------------------------------
own_index:
reserved: false
users:
- "*"
description: "Allow full access to an index named like the username"
# ----------------------------------------------------
readall:
reserved: false
backend_roles:
- "opensearch_index_read_all"
# ----------------------------------------------------
indexes_security_search_full_access:
reserved: true
backend_roles:
- "opensearch_index_read_all"
- "opensearch_index_read_security"
description: "Maps users to indexes_security_search_full_access"
# ----------------------------------------------------
indexes_web_search_full_access:
reserved: true
backend_roles:
- "opensearch_index_read_all"
- "opensearch_index_read_web"
description: "Maps users to indexes_web_search_full_access"



12 changes: 12 additions & 0 deletions files/tenants.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
_meta:
type: "tenants"
config_version: 2

# Define your tenants here
SECURITY:
reserved: false
description: "Tenant for security logs (e.g. kubernetes audit or opensearch audit)"
WEB:
reserved: false
description: "Tenant for web-app logs"
70 changes: 64 additions & 6 deletions inventories/opensearch/group_vars/all/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ os_download_url: https://artifacts.opensearch.org/releases/bundle/opensearch

# opensearch version
# 1.x Latest Version
os_version: "1.3.2"
# 2.x Latest Version
# os_version: "2.0.0-rc1"
os_version: "1.3.19"

# opensearch dashboards version
# 1.x Latest Version
os_dashboards_version: "1.3.2"
# 2.x Latest Version
# os_dashboards_version: "2.0.0-rc1"
os_dashboards_version: "1.3.19"

# Configure hostnames for opensearch nodes
# It is required to configure SSL
Expand All @@ -34,3 +30,65 @@ cluster_type: multi-node
os_user: opensearch

os_dashboards_user: opensearch-dashboards

# Number of days that certificates are valid
cert_valid_days: 730

# Auth type: 'internal' or 'oidc' (OpenID). Default: internal
auth_type: internal

# OIDC settings
oidc:
description: "Authenticate via IdP"
# OpenID server URI
connect_url: https://oidc.example.com/auth/realms/<realm name>/.well-known/openid-configuration
# The JWT token field that contains the user name
subject_key: preferred_username
# the JWT token field that contains a list of user roles
roles_key: roles
# Scopes
scopes: "openid profile email"
# The address of Dashboards to redirect the user to after successful authentication
dashboards_url: http(s)://<dashboards address>.example.com
# IdP client ID
client_id: opensearch
# IdP client secret
client_secret: "00000000-0000-0000-0000-000000000000"

# Overwrite demo configurations with your own
copy_custom_security_configs: false

# To override demo configurations, you can use your own configuration files.
# Place them in the "files" directory. Specify the path to the files
custom_security_plugin_configs:
- files/tenants.yml
- files/roles.yml
- files/roles_mapping.yml
- files/internal_users.yml

# By default, if the /tmp/opensearch-nodecerts directory with certificates
# exists on the server from which the playbook is launched, it is assumed
# that the configuration has not changed and some settings are not copied
# to the target servers.
#
# Conversely, if the /tmp/opensearch-nodecerts directory does not exist on
# the server from which the playbook is launched, then new certificates and
# settings are generated and they are copied to the target servers.
#
# If you use this repository not only for the initial deployment of the
# cluster, but also for its automatic configuration via CI/CD, then new
# certificates will be generated every time the pipeline is launched,
# overwriting existing ones, which is not always necessary if the cluster is
# already in production.
#
# When iac_enable enabling, and all the cluster servers have all the necessary
# certificates, they will not be copied again. If at least on one server (for
# example, when adding a new server to the cluster) if there is not at least one
# certificate from the list, then all certificates on all cluster servers will
# be updated
#
# Also, if the option is enabled, the settings files will be updated with each
# execution (previously, the settings were updated only if the
# /tmp/opensearch-nodecerts directory was missing on the server from which the
# playbook was launched and new certificates were generated)
iac_enable: false
4 changes: 2 additions & 2 deletions opensearch.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

- name: opensearch installation & configuration
- name: Opensearch installation & configuration
hosts: os-cluster
gather_facts: true
roles:
- { role: linux/opensearch }

- name: opensearch dashboards installation & configuration
- name: Opensearch dashboards installation & configuration
hosts: dashboards
gather_facts: true
roles:
Expand Down
Loading
Loading