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

[ANSIENG-4245] | scram support in kraft (#49) #1795

Open
wants to merge 25 commits into
base: 7.8.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
259581a
[ANSIENG-4245] | poc for scram in kraft (#49)
mansi-jain-1206 Sep 25, 2024
183951b
Scram kraft ansieng 4245 (#58)
mansi-jain-1206 Oct 16, 2024
f970a44
[ANSIENG-4245] | added more test
mansi-jain-1206 Oct 16, 2024
599a00f
[ANSIENG-4245] | added more test
mansi-jain-1206 Oct 16, 2024
b47eceb
[ANSIENG-4245] | added sample inventory file
mansi-jain-1206 Oct 17, 2024
0bccff5
[ANSIENG-4245] | added sample inventory file
mansi-jain-1206 Oct 17, 2024
65bb151
[ANSIENG-4245] | add eol
mansi-jain-1206 Oct 18, 2024
03d870a
[ANSIENG-4245] | modified message
mansi-jain-1206 Oct 21, 2024
d1b3b84
[ANSIENG-4245] | modified message
mansi-jain-1206 Oct 21, 2024
1d2b043
[ANSIENG-4245] | validation fix
mansi-jain-1206 Oct 23, 2024
f6ca8d8
[ANSIENG-4245] | linting issue fix
mansi-jain-1206 Oct 23, 2024
a8b82da
[ANSIENG-4245] | modified test
mansi-jain-1206 Oct 24, 2024
6d29100
[ANSIENG-4245] | assertion fix
mansi-jain-1206 Oct 24, 2024
8977cb7
[ANSIENG-4245] | Merge remote-tracking branch 'refs/remotes/origin/7.…
mansi-jain-1206 Oct 24, 2024
4d49e89
[ANSIENG-4245] | remove empty line
mansi-jain-1206 Oct 24, 2024
d8cbc4e
[ANSIENG-4245] | update sample inventory
mansi-jain-1206 Oct 24, 2024
267ec06
[ANSIENG-4245] | added scram,kerberos scenario
mansi-jain-1206 Oct 24, 2024
1000126
[ANSIENG-4245] | added validation in multiple protocols PR
mansi-jain-1206 Oct 24, 2024
b101353
[ANSIENG-4245] | path fix
mansi-jain-1206 Oct 24, 2024
a73eea0
[ANSIENG-4245] | modified test for multiple broker protocol
mansi-jain-1206 Oct 24, 2024
73be25f
[ANSIENG-4245] | update validation
mansi-jain-1206 Oct 25, 2024
9667416
[ANSIENG-4245] | add eol
mansi-jain-1206 Oct 25, 2024
9c2b68c
[ANSIENG-4245] | code review fix
mansi-jain-1206 Oct 25, 2024
970827a
[ANSIENG-4245] | add migration sample for migration
mansi-jain-1206 Oct 25, 2024
b835424
[ANSIENG-4245] | add migration sample for scram
mansi-jain-1206 Oct 25, 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
49 changes: 49 additions & 0 deletions docs/sample_inventories/controller_broker_scram_kraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
##
## The following is an example inventory file of the configuration required for setting up Confluent Platform with Kraft Controller with SCRAM.
## This will set up controller-controller communication via plain and other communication via scram.

all:
vars:
ansible_connection: ssh
ansible_user: ec2-user
ansible_become: true
ansible_ssh_private_key_file: /home/ec2-user/guest.pem
ansible_python_interpreter: /usr/bin/python3

ssl_enabled: true
sasl_protocol: scram

kafka_controller:
vars:
kafka_controller_sasl_protocol: plain,scram
hosts:
ec2-35-160-193-90.us-west-2.compute.amazonaws.com:
ec2-35-85-219-150.us-west-2.compute.amazonaws.com:
ec2-34-219-169-190.us-west-2.compute.amazonaws.com:

kafka_broker:
hosts:
ec2-35-91-214-11.us-west-2.compute.amazonaws.com:
ec2-54-71-228-219.us-west-2.compute.amazonaws.com:
ec2-54-218-9-145.us-west-2.compute.amazonaws.com:

schema_registry:
hosts:
ec2-35-160-193-90.us-west-2.compute.amazonaws.com:

kafka_connect:
hosts:
ec2-35-85-219-150.us-west-2.compute.amazonaws.com:

kafka_rest:
hosts:
ec2-34-219-169-190.us-west-2.compute.amazonaws.com:

ksql:
hosts:
ec2-35-91-214-11.us-west-2.compute.amazonaws.com:

control_center:
hosts:
ec2-35-85-219-150.us-west-2.compute.amazonaws.com:
49 changes: 49 additions & 0 deletions docs/sample_inventories/inter_broker_scram_kraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
##
## The following is an example inventory file of the configuration required for setting up Confluent Platform with Kraft Controller with SCRAM.
## This will set up controller-controller and controller-broker communication via plain and other communication, including inter-broker via scram.

all:
vars:
ansible_connection: ssh
ansible_user: ec2-user
ansible_become: true
ansible_ssh_private_key_file: /home/ec2-user/guest.pem
ansible_python_interpreter: /usr/bin/python3

ssl_enabled: true
sasl_protocol: scram

kafka_controller_sasl_protocol: plain

kafka_controller:
hosts:
ec2-35-160-193-90.us-west-2.compute.amazonaws.com:
ec2-35-85-219-150.us-west-2.compute.amazonaws.com:
ec2-34-219-169-190.us-west-2.compute.amazonaws.com:

kafka_broker:
hosts:
ec2-35-91-214-11.us-west-2.compute.amazonaws.com:
ec2-54-71-228-219.us-west-2.compute.amazonaws.com:
ec2-54-218-9-145.us-west-2.compute.amazonaws.com:

schema_registry:
hosts:
ec2-35-160-193-90.us-west-2.compute.amazonaws.com:

kafka_connect:
hosts:
ec2-35-85-219-150.us-west-2.compute.amazonaws.com:

kafka_rest:
hosts:
ec2-34-219-169-190.us-west-2.compute.amazonaws.com:

ksql:
hosts:
ec2-35-91-214-11.us-west-2.compute.amazonaws.com:

control_center:
hosts:
ec2-35-85-219-150.us-west-2.compute.amazonaws.com:
6 changes: 4 additions & 2 deletions docs/sample_inventories/migration_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
## steps to run:
## 1. Run command "ansible-playbook -i <inv.yml> confluent.platform.all" to setup a ZK cluster
## 2. Once ZK cluster setup is complete, uncomment "kraft_migration: true" and kafka_controller section.
## 3. Run command "ansible-playbook -i <inv.yml> confluent.platform.ZKtoKraftMigration"
## 4. Once Kraft cluster is up and running, Remove "kraft_migration: true" and Zookeeper section from the inventory file.
## 3. If your sasl_protocol is scram or scram256, uncomment the kafka_controller_sasl_protocol variable and set it to "plain"
mansi-jain-1206 marked this conversation as resolved.
Show resolved Hide resolved
## 4. Run command "ansible-playbook -i <inv.yml> confluent.platform.ZKtoKraftMigration"
## 5. Once Kraft cluster is up and running, Remove "kraft_migration: true" and Zookeeper section from the inventory file.

all:
vars:
Expand All @@ -14,6 +15,7 @@ all:
ansible_become: true
ansible_ssh_private_key_file: /home/ec2-user/guest.pem
ansible_python_interpreter: /usr/bin/python3
# kafka_controller_sasl_protocol: plain

#kraft_migration: true

Expand Down
15 changes: 10 additions & 5 deletions molecule/archive-scram-rhel/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
driver:
name: docker
platforms:
- name: zookeeper1
hostname: zookeeper1.confluent
- name: ${KRAFT_CONTROLLER:-zookeeper}1
hostname: ${KRAFT_CONTROLLER:-zookeeper}1.confluent
groups:
- zookeeper
- ${CONTROLLER_HOSTGROUP:-zookeeper}
- ${CONTROLLER_HOSTGROUP:-zookeeper}_migration
image: oraclelinux:8-slim
dockerfile: ../Dockerfile-rhel-tar.j2
command: ""
Expand Down Expand Up @@ -94,18 +95,22 @@ platforms:
networks:
- name: confluent
provisioner:
playbooks:
converge: ${MIGRATION_CONVERGE:-../collections_converge.yml}
inventory:
group_vars:
all:
ssl_enabled: true
sasl_protocol: scram
sasl_protocol: scram256

installation_method: archive

archive_group: custom
archive_owner: cp-custom

mask_secrets: false

kafka_broker_custom_properties:
log.dirs: /tmp/logs1,/tmp/logs2

kafka_controller:
kafka_controller_sasl_protocol: plain,scram256
4 changes: 4 additions & 0 deletions molecule/archive-scram-rhel/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
- name: Create Custom User
user:
name: "{{archive_owner}}"

- name: Install Zookeeper Cluster
import_playbook: confluent.platform.all
when: lookup('env', 'MIGRATION')|default('false') == 'true'
36 changes: 36 additions & 0 deletions molecule/archive-scram-rhel/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,42 @@
- archive.stat.pw_name == 'cp-custom'
quiet: true

- name: Verify - kafka_controller
hosts: kafka_controller
gather_facts: false
tasks:
- import_role:
name: variables
- import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /opt/confluent/etc/controller/server.properties
property: sasl.enabled.mechanisms
expected_value: SCRAM-SHA-256,PLAIN
- import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /opt/confluent/etc/controller/server.properties
property: sasl.mechanism.controller.protocol
expected_value: PLAIN

- name: Verify - kafka_broker
hosts: kafka_broker
gather_facts: false
tasks:
- set_fact:
kraft_mode: "{{ ('kafka_controller' in groups.keys() and groups['kafka_controller'] | length > 0) }}"

- import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /opt/confluent/etc/kafka/server.properties
property: sasl.mechanism.controller.protocol
expected_value: SCRAM-SHA-256

- name: Verify - kafka_connect
hosts: kafka_connect
gather_facts: false
Expand Down
9 changes: 5 additions & 4 deletions molecule/oauth-rbac-mds-scram-custom-rhel/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ platforms:
privileged: true
networks:
- name: confluent
# MDS Zookeeper and Kafka
# MDS Controller, Zookeeper and Kafka
- name: mds-${KRAFT_CONTROLLER:-zookeeper}1
hostname: mds-${KRAFT_CONTROLLER:-zookeeper}1.confluent
groups:
Expand Down Expand Up @@ -86,10 +86,10 @@ platforms:
networks:
- name: confluent
# Cluster 2 goups, groupnames will be changed during converge phase
- name: zookeeper1
hostname: zookeeper1.confluent
- name: ${KRAFT_CONTROLLER:-zookeeper}1
hostname: ${KRAFT_CONTROLLER:-zookeeper}1.confluent
groups:
- zookeeper2
- ${KRAFT_CONTROLLER:-zookeeper}2
- cluster2
image: rockylinux:9-minimal
dockerfile: ../Dockerfile-rhel-java17.j2
Expand Down Expand Up @@ -216,6 +216,7 @@ provisioner:

ssl_enabled: true
sasl_protocol: scram
kafka_controller_sasl_protocol: plain

ssl_custom_certs: true
ssl_ca_cert_filepath: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}/generated_ssl_files/ca.crt"
Expand Down
4 changes: 4 additions & 0 deletions molecule/oauth-rbac-mds-scram-custom-rhel/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@

- name: Install MDS Cluster
import_playbook: confluent.platform.all

- name: Install Zookeeper Cluster
import_playbook: confluent.platform.all
when: lookup('env', 'MIGRATION')|default('false') == 'true'
1 change: 1 addition & 0 deletions molecule/rbac-scram-custom-rhel-fips/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ provisioner:

ssl_enabled: true
sasl_protocol: scram
kafka_controller_sasl_protocol: plain
ssl_custom_certs: true
ssl_ca_cert_filepath: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}/generated_ssl_files/ca.crt"
ssl_signed_cert_filepath: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}/generated_ssl_files/{{inventory_hostname}}-ca1-signed.crt"
Expand Down
4 changes: 4 additions & 0 deletions molecule/rbac-scram-custom-rhel-fips/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@

- name: Provision LDAP Server
import_playbook: ../ldap.yml

- name: Install Zookeeper Cluster
import_playbook: confluent.platform.all
when: lookup('env', 'MIGRATION')|default('false') == 'true'
21 changes: 21 additions & 0 deletions molecule/rbac-scram-custom-rhel-fips/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
### Validates that FIPS is in use in OpenSSL.
### Validates that both the Connectors are Running

- name: Verify - kafka_controller
hosts: kafka_controller
gather_facts: false
tasks:
- import_role:
name: variables
- import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/controller/server.properties
property: sasl.enabled.mechanisms
expected_value: SCRAM-SHA-512,PLAIN
- import_role:
name: confluent.test
tasks_from: check_property.yml
vars:
file_path: /etc/controller/server.properties
property: sasl.mechanism.controller.protocol
expected_value: PLAIN

- name: Verify - kafka_broker
hosts: kafka_broker
gather_facts: false
Expand Down
Loading