kafka权限认证ssl

kafka sasl_ssl配置 阅读详情

 

2016-11-14 18:16:01 shengjk1 阅读数 18141更多

分类专栏: 工作之行

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/jsjsjs1789/article/details/53161985

背景: 
最近公司因为用的云服务器,需要保证kafka的安全性。可喜的是kafka0.9开始,已经支持权限控制了。网上中文资料又少,特此基于kafka0.9,记录kafaka的权限控制 ( flume需要1.7及其以上才支持kafka的SSL认证)。

下面各位看官跟着小二一起开始kafak权限认证之旅吧!嘎嘎嘎!

介绍: 
kafka权限控制整体可以分为三种类型: 
1.基于SSL(CDH 5.8不支持) 
2.基于Kerberos(此认证一般基于CDH,本文不与讨论) 
3.基于acl的 (CDH5.8中的kafka2.X不支持 )

本文主要基于apace版本的,实现1和3,也是用的最多的展开讨论。

统一说明: 
在本文中&符号表示注释

一,准备工作 
组件分布 
kafka centos11,centos12,centos13 
zoopeeker centos11,centos12,centos13

二、在kafka集群任选一台机子 ( 先介绍基于SSL的 )

密码统一为123456

&Step 1  Generate SSL key and certificate for each Kafka broker
keytool -keystore server.keystore.jks -alias centos11 -validity 365 -genkey

%Step 2  Creating your own CA
openssl req -new -x509 -keyout ca-key -out ca-cert -days 365
keytool -keystore server.truststore.jks -alias CARoot -import -file ca-cert
keytool -keystore client.truststore.jks -alias CARoot -import -file ca-cert

&Step 3  Signing the certificate
keytool -keystore server.keystore.jks -alias centos11 -certreq -file cert-file
openssl x509 -req -CA ca-cert -CAkey ca-key -in cert-file -out cert-signed -days 365 -CAcreateserial -passin pass:123456
keytool -keystore server.keystore.jks -alias CARoot -import -file ca-cert
keytool -keystore server.keystore.jks -alias centos11 -import -file cert-signed
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

三、其他的kafka集群

 &机器centos13  centos12
 keytool -keystore kafka.client.keystore.jks -alias centos13 -validity 365 -genkey 
  keytool -keystore kafka.client.keystore.jks -alias centos13 -certreq -file cert-file
  cp cert-file cert-file-centos13

 &centos11
 scp ./ca* ce* server* root@centos13:/opt/kafka_2.10/

  openssl x509 -req -CA ca-cert -CAkey ca-key -in cert-file-centos13  -out cert-signed-centos13  -days 365 -CAcreateserial -passin pass:123456 
 keytool -keystore kafkacentos13.client.keystore.jks -alias CARoot -import -file ca-cert 
 keytool -keystore kafkacentos13.client.keystore.jks -alias centos13 -import -file cert-signed-centos13 



rm -rf producer.properties
echo "bootstrap.servers=centos13:9093" >> producer.properties  
echo "security.protocol=SSL" >> producer.properties  
echo "ssl.truststore.location=/opt/kafka_2.10/kafkacentos12.client.keystore.jks">> producer.properties  
echo "ssl.truststore.password=123456">> producer.properties  
echo "ssl.keystore.location=/opt/kafka_2.10/server.keystore.jks">> producer.properties  
echo "ssl.keystore.password=123456">> producer.properties  
echo "ssl.key.password=123456">> producer.properties   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

4.验证:

openssl s_client -debug -connect localhost:9093 -tls1

output:
    -----BEGIN CERTIFICATE-----
        {variable sized random bytes}
        -----END CERTIFICATE-----
        subject=/C=US/ST=CA/L=Santa Clara/O=org/OU=org/CN=Sriharsha Chintalapani
        issuer=/C=US/ST=CA/L=Santa Clara/O=org/OU=org/CN=kafka/emailAddress=test@test.com
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

5.使用:

bin/kafka-console-consumer.sh --bootstrap-server kafka2:9093 --topic test --new-consumer --consumer.config  config/producer.properties

bin/kafka-console-producer.sh --broker-list centos11:9093 --topic test --producer.config  ./config/producer.properties  

bin/kafka-console-consumer.sh --bootstrap-server centos11:9093 --topic test --new-consumer --consumer.config ./config/producer.properties 

bin/kafka-console-consumer.sh --bootstrap-server centos13:9093 --topic test --new-consumer --consumer.config ./config/producer.properties  --from-beginning
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

6.基于ACL

server.properties中加配置

allow.everyone.if.no.acl.found=true
super.users=User:root
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer  
principal.builder.class=org.apache.kafka.common.security.auth.DefaultPrincipalBuilder 
  • 1
  • 2
  • 3
  • 4

7.ACL的简单使用:

bin/kafka-acls.sh --authorizer-properties zookeeper.connect=centos11:2181 --add --allow-principal User:Bob --allow-principal User:Alice --allow-host 198.51.100.0 --allow-host 198.51.100.1 --operation Read --operation Write --topic test

bin/kafka-acls.sh --authorizer-properties zookeeper.connect=centos11:2181 --remove --allow-principal User:Bob --allow-principal User:Alice --allow-host 198.51.100.0 --allow-host 198.51.100.1 --operation Read --operation Write --topic test
  • 1
  • 2
  • 3

8.Java Demo 
需要将server.keystore.jks、client.truststore.jks从任一台机器上拷贝下来即可。

SSL is supported only for the new Kafka Producer and Consumer, the older API is not supported

ConsumerDemo

package xmhd.examples;

import org.apache.kafka.clients.CommonClientConfigs;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.config.SslConfigs;
import java.util.Arrays;
import java.util.Properties;
/**
  * Created by shengjk1.
  * blog address :http://blog.csdn.net/jsjsjs1789
 *
 *  生产者可以保证权限认证
 *  SSL is supported only for the new Kafka Producer and Consumer, the older API is not supported
 */
public class ConsumerZbdba {
    public static void main(String[] args) {
//      new ConsumerZbdba("test").start();// 使用kafka集群中创建好的主题 test
        Properties props = new Properties();
/* 定义kakfa 服务的地址,不需要将所有broker指定上 */
        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "centos11:9093;centos13:9093;centos12:9093");
/* 制定consumer group */
        props.put("group.id", "test");
        props.put("auto.offset.reset","earliest");
/* 是否自动确认offset */
//      props.put("enable.auto.commit", "true");
//      props.put(ProducerConfig.CLIENT_ID_CONFIG, "myApiKey");
        props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "F:\\server.keystore.jks");
        props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, "123456");
        props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, "F:\\client.truststore.jks");
        props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "123456");
        props.put(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, "JKS");
        props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
//


///* 自动确认offset的时间间隔 */
//      props.put("auto.commit.interval.ms", "1000");
//      props.put("session.timeout.ms", "30000");
/* key的序列化类 */
        props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
/* value的序列化类 */
        props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
 /* 定义consumer */
        KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
/* 消费者订阅的topic, 可同时订阅多个 */
        consumer.subscribe(Arrays.asList("test"));

 /* 读取数据,读取超时时间为100ms */
        while (true) {
            ConsumerRecords<String, String> records = consumer.poll(100);
            for (ConsumerRecord<String, String> record : records)
                System.out.printf("offset = %d, key = %s, value = %s", record.offset(), record.key(), record.value()+"\n");
        }
    } 
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58

ProducerDemo

package xmhd.examples;
import org.apache.kafka.clients.CommonClientConfigs;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.config.SslConfigs;
import java.util.Properties;
/**
 * Created by shengjk1.
 * blog address :http://blog.csdn.net/jsjsjs1789
 *  生产者可以保证权限认证
 */
public class ProducerZbdba {
    public static void main(String[] args) {
         Properties producerProps = new Properties();
         producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "centos12:9093");
//         producerProps.put(ProducerConfig.CLIENT_ID_CONFIG, "myApiKey");
        producerProps.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "F:\\server.keystore.jks");
        producerProps.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, "123456");
        producerProps.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, "F:\\client.truststore.jks");
        producerProps.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "123456");
        producerProps.put(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, "JKS");
        producerProps.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SSL");
         producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");  
         producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");  
         KafkaProducer producer = new KafkaProducer(producerProps);  
         for(int i = 0; i < 100; i++)  
             producer.send(new ProducerRecord<String, String>("test", Integer.toString(i), Integer.toString(i)));
             System.out.println("test");  
         producer.close();  
    }  
}  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

8.1 flume1.7 的配置 (基于kafka SSL认证)

tier1.sources  = source1
tier1.channels = channel1
tier1.sinks    = sink1


tier1.sources.source1.type     = exec
tier1.sources.source1.command = tail -F -n+1 /opt/scan.log
tier1.sources.source1.channels = channel1

tier1.channels.channel1.type   = memory
tier1.sinks.sink1.type         = org.apache.flume.sink.kafka.KafkaSink
tier1.sinks.sink1.topic = test
tier1.sinks.sink1.kafka.bootstrap.servers = centos11:9093,centos12:9093,centos13:9093
tier1.channels.channel1.kafka.bootstrap.servers = centos11:9093,centos12:9093,centos13:9093
tier1.sinks.sink1.requiredAcks = 1
tier1.sinks.sink1.batchSize = 100


tier1.sinks.sink1.kafka.producer.security.protocol = SSL
tier1.sinks.sink1.kafka.producer.ssl.truststore.type=JKS
tier1.sinks.sink1.kafka.producer.ssl.truststore.location = /opt/kafka_2.10/server.truststore.jks
tier1.sinks.sink1.kafka.producer.ssl.truststore.password =123456
tier1.sinks.sink1.kafka.producer.security.protocol = SSL
tier1.sinks.sink1.kafka.producer.ssl.keystore.location = /opt/kafka_2.10/server.keystore.jks
tier1.sinks.sink1.kafka.producer.ssl.keystore.password =123456
&tier1.sinks.sink1.kafka.producer.ssl.endpoint.identification.algorithm = HTTPS


tier1.sinks.sink1.channel      = channel1
tier1.channels.channel1.capacity = 100


&tier1.channels.channel1.kafka.producer.security.protocol = SSL
&tier1.channels.channel1.kafka.producer.ssl.truststore.type=JKS
&tier1.channels.channel1.kafka.producer.ssl.truststore.location = /opt/kafka_2.10/server.truststore.jks
&tier1.channels.channel1.kafka.producer.ssl.truststore.password =123456
&tier1.channels.channel1.kafka.producer.security.protocol = SSL
&tier1.channels.channel1.kafka.producer.ssl.keystore.location = /opt/kafka_2.10/server.keystore.jks
&tier1.channels.channel1.kafka.producer.ssl.keystore.password =123456
&tier1.channels.channel1.kafka.producer.ssl.endpoint.identification.algorithm = HTTPS


&tier1.channels.channel1.kafka.consumer.security.protocol = SSL
&tier1.channels.channel1.kafka.consumer.ssl.truststore.location = /opt/kafka_2.10/server.truststore.jks
&tier1.channels.channel1.kafka.consumer.ssl.truststore.password =123456
&tier1.channels.channel1.kafka.consumer.security.protocol = SSL
&tier1.channels.channel1.kafka.consumer.ssl.keystore.location = /opt/kafka_2.10/server.truststore.jks
&tier1.channels.channel1.kafka.consumer.ssl.keystore.password =123456
&tier1.channels.channel1.kafka.consumer.ssl.endpoint.identification.algorithm = HTTPS
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49

9.kafak Server.properties最终版的

三台机子需保证一样,centos11为机器名,根据需要自行修改

broker.id=0
############################# Socket Server Settings #############################
&这一点可能需要特别的注意,PLAINTEXT注释掉之后,一些基本的kafka脚本都不在能用了
&listeners=PLAINTEXT://centos11:9092,SSL://centos11:9093
listeners=SSL://centos11:9093
advertised.listeners=SSL://centos11:9093  
ssl.keystore.location=/opt/kafka_2.10/server.keystore.jks  
ssl.keystore.password=123456
ssl.key.password=123456
ssl.truststore.location=/opt/kafka_2.10/server.truststore.jks  
ssl.truststore.password=123456  
ssl.client.auth=required  
ssl.enabled.protocols=TLSv1.2,TLSv1.1,TLSv1  
ssl.keystore.type=JKS  
ssl.truststore.type=JKS  
security.inter.broker.protocol=SSL  

&acl
allow.everyone.if.no.acl.found=true
super.users=User:root
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer  
principal.builder.class=org.apache.kafka.common.security.auth.DefaultPrincipalBuilder 

host.name=centos11
advertised.host.name=centos11

num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
############################# Log Basics #############################
log.dirs=/opt/kafka-logs
num.partitions=1
num.recovery.threads.per.data.dir=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
############################# Zookeeper #############################
zookeeper.connect=centos11:2181,centos12:2181,centos13:2181
zookeeper.connection.timeout.ms=6000
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41

kafka producer.properties 
centos11为机器名,根据需求自行修改

bootstrap.servers=centos11:9093
security.protocol=SSL
ssl.truststore.location=/opt/kafka_2.10/client.truststore.jks  
ssl.truststore.password=123456  
ssl.keystore.location=/opt/kafka_2.10/server.keystore.jks  
ssl.keystore.password=123456
ssl.key.password=123456
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

10、参考网址: 
具体细节可参考官网!

http://kafka.apache.org/090/documentation.html#security_authz 
http://www.cloudera.com/documentation/kafka/latest/topics/kafka_security.html 
http://blog.csdn.net/zbdba/article/details/52458654

11.通信协议的支持情况 
这里写图片描述

12.扩展阅读:

关于SSL原理 http://www.linuxde.net/2012/03/8301.html

Kafka部署全攻略——基于SASL_PLAIN/SSL认证的ACL权限控制 基于SASL_PLAIN/SSL认证的ACL权限控制 阅读详情

相关推荐

Kafka部署指南:SASL_SCRAM/SSL认证的ACL权限控制

在本篇文章中,我们提供了一个详细的Kafka部署指南,重点介绍了如何使用SASL_SCRAM/SSL认证来实现ACL权限控制。我们涵盖了安装和配置Kafka、生成SSL证书和密钥、配置SSL认证、配置SASL_SCRAM认证以及配置ACL权限控制的步骤。在本篇文章中,我们将为您提供一个详细的Kafka部署指南,重点介绍如何使用SASL_SCRAM/SSL认证来实现ACL权限控制。我们将提供相应的源代码和步骤,帮助您完成Kafka的安装和配置。接下来,我们将生成SSL证书和密钥,用于Kafka的SSL认证。

DeoSql的博客 349

SpringBoot中Kafka的SSL链接

运维给了账号, 密码,还有jks的秘钥, 现在jks文件上传不到服务器上去, 只能使用Base64编码成配置文件, 在项目启动后再从base64的字符串变成文件. 配置文件如下: spring: # kafka config start kafka: bootstrap-servers: XXX producer: value-serializer: org.apache.kafka.common.serialization.StringSerializer

长河的博客 7174

Kafka三种认证模式,Kafka 安全认证及权限控制详细配置与搭建

Kafka三种认证模式,Kafka 安全认证及权限控制详细配置与搭建。

代码讲故事 1417

Zookeeper & Kafka 开启安全认证的配置

Zookeeper&Kafka 安全认证

IT布道 1万+

掌握Kafka安全配置:自建CA与权限控制策略

本文介绍了在Kafka集群中实施安全性的方法,包括创建自签名证书颁发机构(CA)、配置SSL认证、使用Kerberos和SASL进行用户认证、以及设置访问控制列表(ACLs)和配额来管理用户权限和防止DDoS攻击。

weixin_42599558的博客 1147

STM32+W5500实战:5分钟搞定FreeModbus TCP移植(附完整代码)

本文详细介绍了如何在STM32微控制器上,结合W5500以太网芯片,快速完成FreeModbus TCP协议栈的移植,构建稳定可靠的工业级Modbus TCP服务器。内容涵盖硬件连接、软件架构、驱动适配、核心移植代码实现及调试优化技巧,旨在提供可直接应用于实际项目的完整解决方案。

life6的博客 884

开启kafka密码认证

Kafka默认未开启密码认证,可以免密登录,太不安全,因此需要开启密码认证。 一 kafka认证方式类型 kafka提供了多种安全认证机制,主要分为SSL和SASL大类。其中SASL/PLAIN是基于账号密码的认证方式,比较常用 1.1 SSL 1.2 SASL 1.2.1 SASL/Kerberos 1.2.2 SASL/PLAIN 1.2.3 SASL/SCRAM 二 测试SASL/PLAIN进行身份验证 SASL/PLAIN是一种简单的用户名/密码身份..

雅冰石的专栏 2万+

Vue3集成百度实时语音识别

Vue3集成百度实时语音识别

weixin_61769998的博客 551

2021-05-12

如何通过Cloudera Manager为Kafka启用Kerberos及使用 1.文档编写目的 在CDH集群中启用了Kerberos认证,本文主要讲述通过Clouder Manager为kafka集群启用Kerberos认证及客户端配置使用。 内容概述 修改kafka配置 配置客户端 客户端测试Proudcer和Consumer 测试环境 CentOS Linux release 7.9.2009 (Core) CM和CDH版本为6.2.1 采用root用户 Kafka2.1.0 前置

weixin_45392855的博客 873

从Power到HO:一文搞懂主流脑图谱在DPABI里怎么选,让你的rs-fMRI分析更精准

本文深入解析了rs-fMRI分析中主流脑图谱(如Power、HO、AAL等)在DPABI中的科学选择策略,帮助研究者根据不同的神经科学研究目标优化分析流程。从解剖学图谱到功能连接图谱的特性对比,到DPABI实操中的多图谱分析工作流,提供了全面的方法论指导,助力提升静息态功能磁共振成像(rs-fMRI)研究的精准度和可重复性。

weixin_30654583的博客 409

影视站泛目录程序(泛目录站群):构建多元化影视内容平台的利器

同时,搭建多元化影视内容平台还能够为平台创造更多商业价值,提升平台的竞争力。构建多元化影视内容平台:通过影视站泛目录程序,影视平台可以整合来自不同渠道和来源的影视资源,打破传统影视平台的局限性,提供更加多样化的影视内容供用户选择。提高用户体验:泛目录站群程序能够自动化处理和分类整理影视资源,提供便捷的搜索功能,使用户能够快速找到所需的影视内容,提升用户的使用体验。增加用户粘性:通过提供多元化的影视资源和个性化的推荐服务,影视站泛目录程序可以吸引用户长时间停留在平台上,增加用户的粘性和忠诚度。

qq_20005121的博客 844

Kafka SSL 认证与 ACL 权限最佳实践(实战流程)

● 每个客户端独立生成私钥和证书请求,由同一个 CA 签发。● 服务端只需信任 CA。● 客户端用自己的证书和私钥连接。● 可通过证书 CN 字段实现精细化权限控制。

MaFei的博客 1442

基于SHIS凝视型短波红外高光谱相机(900-1700nm)区分不同宝石的差异性和可分性(宝石分选)

SHIS系列凝视型高光谱相机基于液晶可调谐滤波器(LCTF),通过电控LCTF进行连续细分窄波段分光,对每个波段进行高分辨率的二维面阵成像,进行图像处理后,获得完整的高光谱高清图像序列。具有低功耗、小型化、使用方便和易于扩展的优势。其工作波段覆盖400nm至1000nm,能够捕捉宝石在不同波长下的光谱特征,为宝石鉴定提供了新的工具。

wayho的博客 716

Kafka部署全攻略——基于SASL_SCRAM/SSL认证的ACL权限控制

基于SASL_SCRAM/SSL认证的ACL权限控制

bbsxb520的博客 522

ESP32 驱动 SYN6288 语音合成:Arduino IDE 下实现中文数字混合文本的智能播报

本文详细介绍了如何在Arduino IDE环境下使用ESP32驱动SYN6288语音合成模块,实现中文数字混合文本的智能播报。通过硬件选型、开发环境搭建、编码转换原理、命令帧构造及串口通信实战等步骤,帮助开发者快速掌握语音播报技术。文章还提供了混合文本处理技巧和常见问题排查方法,适合智能硬件开发者参考。

weixin_42553471的博客 452

Cadence SPB16. 6 安装流程

1.首先下载CadenceAllegroSPBorCAD16.6安装包 下载之后运行其中的setup.exe,然后先安装第一项LicenseManager 一直按next或install, 直到被询问license时,单击cancel,然后选是和finish。 2,安装Product Installtion 直接点next跳过这一步 安装完成后,点Exit退出 3.按ctrl+alt+delete打开任务管...

wangjie36的博客 5165

Kafka SSL安装与配置

在Kafka 0.9.0.0之后,Kafka社区增加了一系列的功能,其中包含对Kafka集群进行安全管控。Broker与Client之间的权限认证(例如Producer和Consumer)。可以使用SSL或SASL,而SASL支持如下方案:SASL/GSSAPI(Kerberos),开始于0.9.0.0版本SASL/PLAIN,开始于0.10.0.0版本SASL/SCRAM-SHA-256和SASL/SCRAM-SHA-512,开始于0.10.2.0版本。

csdn_manong1的博客 1147

9、硬件工程师笔试面试知识器件篇——三极管(2025版本)

本文全面介绍了三极管的基础知识与应用,包括其结构、类型、工作原理、工作状态、功能、应用场景及特性参数。详细探讨了三极管在信号放大、无线通信、音频设备及医疗设备中的具体应用,并深入分析了设计放大电路时如何平衡增益与噪声、优化偏置电路以提高稳定性、使用负反馈改善性能等关键问题。此外,文章还涵盖了高频电路设计、温度补偿策略、电磁干扰防护等实用内容,为硬件工程师提供了全面的技术参考和设计指导。

XU157303764的博客 7322

kafka权限认证

背景: 最近公司因为用的云服务器,需要保证kafka的安全性。可喜的是kafka0.9开始,已经支持权限控制了。网上中文资料又少,特此基于kafka0.9,记录kafaka的权限控制。 下面各位看官跟着小二一起开始kafak权限控制之旅吧!嘎嘎嘎!介绍: kafka权限控制整体可以分为三种类型: 1.基于SSL 2.基于Kerberos(本文不与讨论) 3.基于acl的 本文主要基于1

shengjk1的博客 2万+

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

kafka权限控制功能

Kafka Topic 权限控制可以通过使用 Apache Kafka 的内置安全特性来实现。这主要涉及到两个方面:认证(Authentication)和授权(Authorization)。

WangYouJin321的博客 2262

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Flink消费Kafka到HDFS实现及详解

在Kafka 0.9.0.0之后,Kafka社区增加了一系列的功能,其中包含对Kafka集群进行安全管控。Broker与Client之间的权限认证(例如Producer和Consumer)。可以使用SSL或SASL,而SASL支持如下方案:SASL/GSSAPI(Kerberos),开始于0.9.0.0版本SASL/PLAIN,开始于0.10.0.0版本SASL/SCRAM-SHA-256和SASL/SCRAM-SHA-512,开始于0.10.2.0版本。

csdn_manong1的博客 758

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Kafka安全认证机制详解之SASL_PLAIN

上面配置是新增了两个用户,admin和tly,这两个用户都是普通用户,KafkaServer中的username、password配置的用户和密码,是用来broker和broker连接认证。在本例中,admin是代理broker间通信的用户。这个时候使用auth.conf已经不能创建topic了,使用admin.conf可以创建,因为admin账号和配置的超级管理员一致;使用权限配置并且超级用户是admin,这个用户和我们上面配置的列表中的admin用户相互映射,每个机器都需要配置然后重启所有节点。

空城的博客 4386

实战Kafka ACL机制

  在处理一些核心的业务数据时,Kafka的ACL机制还是非常重要的,对核心业务主题进行权限管控,能够避免不必要的风险。

zouduchen的博客 1111

简述一下kafka的安全机制

在。

u012534547的博客 1573

Kafka SASL/SCRAM认证与ACL配置

Kafka SASL/SCRAM认证与ACL配置

u010100623的博客 2697

Kafka安全机制:认证、授权与加密传输

Kafka安全机制:认证、授权与加密传输 【免费下载链接】Kafka Kafka 是一款高吞吐量、可靠、分布式的消息队列系统,被广泛应用于日志收集、实时数据流处理等领域。高效的Kafka分布式消息队列,支持大规模数据流处理。Kafka适用实时数据处理、日志收集和消息传递等应用场景 ...

gitblog_00110的博客 1323
上一篇: 线程中断
下一篇: 安装sdk的 pom
王树民
博客等级 码龄10年 912粉丝 560原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址