Hi Experts,
Looking for a solution for blocking the developers from committing the codes or any files with password or secretes in it.
Regards!!
You will need some code for this, but there's two parts to it.
The easier part is that there are apps that can provide that code, or allow you to write that code inline. I'd use Scriptrunner (because I work for Adaptavist and can ask an expert any time). But the block is an easy thing.
The more difficult part is the human side - you need code that can recognise when something sensitive is being committed. How do you know when the word "penguin" is a password?
Hi NIC,
Thanks for your quick response.but I really wonder that here we don't have proper solution for this as it was very important usecase also
I think there's no "proper solution" because of the second part of my answer.
Blocking a commit given "case X" is not a problem. It's when "case X" is potentially a nightmare to code for that you have a problem.
For this one, think about it - how do you know that any part of a commit is a string representing a password? Humans will often write variants of "username: dave password: penguin" into comments or notes, which aren't too hard to detect, but what happens when they don't flag it so obviously? A lot of passwords have been given to me as simply dave/penguin - a human reading that would take a good guess, but how would a machine know? Your case also has the problem that you want to search the content of a commit (and if it's code relating to user access, it's likely to throw a false positive if you are just looking for "password").
So, there's no easy generic way to do it, as the things you are looking for could be very different. You will need to define a set of rules that define how a machine will recognise passwords and secrets in your commits, and parse for them.
Yes.. you are absolutely right...
Just for reference, have you ever tried a parsing like this for any kind bof blocking.. if yes could you share me for reference
It looks like you're new here. Sign in or register to get started.