Does the Chef bash resource create history entries?
In this case, the best way would be to use chef data bags which is specifically known for this.
A great documentation is given at https://docs.chef.io/data_bags.html

Also, As Roland pointed above in the comment, make sure to use sensitive true in your bash resource to avoid any such information printed on screen or going to the logs.