Skip to content

Commit 51488c1

Browse files
TomatoMrtaloric
authored andcommitted
fix: agent desensitizes the content in backticks
1 parent f559e63 commit 51488c1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

agent/src/flow_generator/protocol_logs/sql/sql_obfuscate.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pub enum Operator {
4646
Regex, // ~*
4747

4848
At, // @
49-
Backtick, // `
5049
Caret, // ^
5150
Colon, // :
5251
Dash, // -
@@ -102,7 +101,6 @@ impl Operator {
102101
Operator::Percent => b"%",
103102
Operator::Pipe => b"|",
104103
Operator::Tilde => b"~",
105-
Operator::Backtick => b"`",
106104
Operator::At => b"@",
107105
Operator::LeftCurlyBrace => b"{",
108106
Operator::RightCurlyBrace => b"}",
@@ -466,10 +464,6 @@ fn obfuscate(input: &[u8]) -> Vec<u8> {
466464
forward(&mut iteration, 1);
467465
Token::Operator(Operator::Pipe)
468466
}
469-
b'`' => {
470-
forward(&mut iteration, 1);
471-
Token::Operator(Operator::Backtick)
472-
}
473467
b'{' => {
474468
forward(&mut iteration, 1);
475469
Token::Operator(Operator::LeftCurlyBrace)
@@ -749,6 +743,10 @@ mod tests {
749743
"DELETE FROM table WHERE id = 1;",
750744
Some("DELETE FROM table WHERE id = ?;"),
751745
),
746+
(
747+
"SELECT `id` FROM `database.table` WHERE id = 1;",
748+
Some("SELECT `id` FROM `database.table` WHERE id = ?;"),
749+
),
752750
(
753751
"UPDATE table SET column1 = value1, column2 = value2, column3 = value3 WHERE id = 1;",
754752
Some("UPDATE table SET column? = ?,column? = ?,column? = ? WHERE id = ?;"),

0 commit comments

Comments
 (0)