kestra-io / plugin-fs

https://kestra.io/plugins/plugin-fs/
Apache License 2.0
6 stars 7 forks source link

SMB trigger does not escape symbols & outputs passwords plain text #163

Open qui458 opened 2 weeks ago

qui458 commented 2 weeks ago

Describe the issue

hi! currently I am testing io.kestra.plugin.fs.smb.Trigger and it seems that extra secure passwords do not work with, - it throws Illegal character in authority at index error and outputs a plain text exposed password to logs as well (see in screenshot). seems like the plugin does not escape all the symbols, but only a few (1st in screenshot is why the error comes up, 2nd is being escaped, ie. converted to hex). in my flow config I am using KV store for password, so it should act as a string normally. am I perhaps setting something wrong, or is there a minor issue with the trigger plugin itself?

thanks!

flow:

id: orders_to_coloplast
namespace: aph.demo

triggers:
  - id: rs_order
    type: io.kestra.plugin.fs.smb.Trigger
    host: host_name
    port: "445"
    username: "{{ kv('smb_user') }}"
    password: "{{ kv('smb_passwd') }}"
    from: /Stora_Test/RS/Data/PurchaseOrders/Effectuated Orders/Coloplast/Temp
    regExp: ".*.XML"
    interval: "PT60S"
    action: MOVE
    moveDirectory: /Stora_Test/RS/Data/PurchaseOrders/Effectuated Orders/Coloplast/Sent

tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: Hello World! 🚀 {{ trigger.outputFiles }}

issuing screenshot: image (3)

Environment

Ben8t commented 2 weeks ago

Hello @qui458 , thanks for raising this one. Can you try with a password which doesn't contain this kind of char please ? Just to check if it's a plugin issue or something of a higher order

qui458 commented 1 week ago

hey @Ben8t , thanks for the response! I have tried another user which contains other chars, seems the issue is the same: image

due to client's company user policies, I cannot create or try a user with simpler password, though..

filip-paczynski commented 6 days ago

Hello, I've also experienced this issue. IIRC this is also a problem in case of other SMB Tasks: Move,Upload at least.

Changing password to exclude any special (needing escaping) URI characters helped.