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

Password rule does not take effect bug #34152

Open
Y-sir opened this issue Dec 26, 2024 · 1 comment
Open

Password rule does not take effect bug #34152

Y-sir opened this issue Dec 26, 2024 · 1 comment

Comments

@Y-sir
Copy link

Y-sir commented Dec 26, 2024

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

5.5.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

After using distsql to create encryption rules, the data can be converted to ciphertext when inserted in the proxy, but when querying, the ciphertext is still queried in the proxy. Under normal conditions, it should be plaintext.

Actual behavior

The query in the proxy is plain text

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

1、Create a table called xxl_job_user

CREATE TABLE xxl_job_user(idint NOT NULL AUTO_INCREMENT,usernamevarchar(50) NOT NULL COMMENT '账号',passwordvarchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',roletinyint NOT NULL COMMENT '角色:0-普通用户、1-管理员',permission varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割', PRIMARY KEY (id) USING BTREE, UNIQUE KEY i_username (username) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3;

2、Use distsql statements to create encryption rules for the password field

CREATE ENCRYPT RULE xxl_job_user ( COLUMNS (( NAME = password, CIPHER = password, ENCRYPT_ALGORITHM ( TYPE ( NAME = 'AES', PROPERTIES ( 'aes-key-value' = '123456abc', 'digest-algorithm-name' = 'SHA-1'))))));

3、Insert a piece of data into the proxy

INSERT INTO xxx.xxl_job_user(id, username, password, role, permission ) VALUES ( 4, 'admin1', '123456', 1, NULL );

4、Query data in proxy

SELECT * FROM xxx.xxl_job_user LIMIT 0,1000

5、The data queried in the proxy should be 123456, but the queried data is encrypted data.

image

Example codes for reproduce this issue (such as a github link).

@RaigorJiang
Copy link
Contributor

Hi @Y-sir, I can't reproduce your issue

In Proxy

image

In MySQL

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants