You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if we want to use a sensitive string like a password in Byzer Script, what we can do is just use the password as plain text in byzer script, which is not secure and mostly does not satisfy the IT policy within the company.
So Byzer should support the encode and decode sensitive string when scripting
The scenario example:
If we want to send an email, the code like below
-- send email
run${CONTENT} as SendMultiMails.``where mailType ="config"and attachmentType ="text/csv"andfrom="${EMAIL_FROM}"and to ="${EMAIL_TO}"and cc ="${EMAIL_CC}"and smtpHost ="${HOST}"and smtpPort ="${PORT}"and`properties.mail.smtp.starttls.enable`="true"and`properties.mail.smtp.ssl.protocols`="TLSv1.2"and userName ="${USERNAME}"and password="${PWD}";
if the value of the sender's password is 123456, here we need to fill the password as plain text 123456.
The proposal
Provide aes encode/encode macro function
!aes_encode "123456";
this will return an encrypted string of "123456", we refer to it as "xxxxxx"
!aes_decode "xxxxxx";
this will return a decrypted string of "xxxxxx", it should return "123456"
provide aes encode/encode udf function
select aes_encode("123456") as t1;
this will return an encrypted string of "123456", we refer to it as "xxxxxx"
select aes_decode("xxxxxx") as t2;
this will return a decrypted string of "xxxxxx", it should return "123456"
Solution for the scenario above
First, the user can run
!aes_encode "123456";
or
select aes_encode("123456") as t1;
to get the encrypted value of password,we refer to it as ”xxxxxx“
set the variable PWD in byzer script as below
set PWD = `select aes_decode("xxxxxx")` where type="sql";
send email
-- send email
run${CONTENT} as SendMultiMails.``where mailType ="config"and attachmentType ="text/csv"andfrom="${EMAIL_FROM}"and to ="${EMAIL_TO}"and cc ="${EMAIL_CC}"and smtpHost ="${HOST}"and smtpPort ="${PORT}"and`properties.mail.smtp.starttls.enable`="true"and`properties.mail.smtp.ssl.protocols`="TLSv1.2"and userName ="${USERNAME}"and password="${PWD}";
This solution will keep the encrpted password in the byzer script instead of plain text
The text was updated successfully, but these errors were encountered:
Lindsaylin
changed the title
[Feature] Byzer should support AES encryption when using sensitive string in Byzer Script
[Feature] 在 Byzer 脚本中使用敏感字符串时,Byzer 支持 AES 加密. Byzer supports AES encryption when using sensitive strings in Byzer script.
Mar 30, 2022
Background
Currently, if we want to use a sensitive string like a password in Byzer Script, what we can do is just use the password as plain text in byzer script, which is not secure and mostly does not satisfy the IT policy within the company.
So Byzer should support the encode and decode sensitive string when scripting
The scenario example:
If we want to send an email, the code like below
if the value of the sender's password is
123456
, here we need to fill the password as plain text123456
.The proposal
this will return an encrypted string of "123456", we refer to it as "xxxxxx"
this will return a decrypted string of "xxxxxx", it should return "123456"
this will return an encrypted string of "123456", we refer to it as "xxxxxx"
this will return a decrypted string of "xxxxxx", it should return "123456"
Solution for the scenario above
or
to get the encrypted value of password,we refer to it as ”xxxxxx“
PWD
in byzer script as belowThis solution will keep the encrpted password in the byzer script instead of plain text
The text was updated successfully, but these errors were encountered: