jq has a few suitable builtins to help out. You don't need much Bash trickery and it's not very well suited for the problem. Here is a pretty explicit version in jq that you should be able to modify for whatever purpose you need:
jq -r '. as $root |
path(..) | . as $path |
$root | getpath($path) as $value |
select($value | scalars) |
([$path[] | @json] | join(".")) + " = " + ($value | @json)
' < file.json
It uses the variable binding operator ... as $identifier | several times to remember calculated values by name - some of those are unnecessary, but they make it easier to talk about. Each of those lines binds a variable $x for the remainder of the program to the value on the left.
The path/1 function is the key here, and does basically what you want already: path(..) produces an array of all the keys you'd need to traverse to get to every value nested in the object. Each path is in the form
[ "Blueprints", "security", "kerberos_descriptor" ]
and they can be used in the same way as other arrays, as well as with special functions that interpret paths.
path(..) | . as $path |
in particular is sort of defining a loop: for each path in the file, call it $path and run the rest of the program as the loop body. The remainder of the program is selecting and outputting, so for each path, it is checked and an output line possibly generated.
getpath reads one of those path arrays and plucks out the value it identifies. select lets us filter to only values passing a test - here, it selects only values that are scalars (numbers, strings, or booleans, or nulls), so intermediate objects and arrays are left out (as are nulls).
The final line formats the output as
"abc"."def".3."xyz" = true
for every value in the file, one per line, and you can adjust that as you wish. Redirect it into a file and you can grep through it repeatedly.
@json quotes values correctly, and the rest should be easy to change to suit the format you need. It doesn't use square brackets for arrays, because manually replicating the functionality of join to put dots in for the other cases is surprisingly complex. The parentheses are needed on both sides.