Closed szubersk closed 8 months ago
Can we merge this? Please?
Alternatively ...
Make the comparison a function that looks kinda like this:
def key_size_complies(expected: int, actual: int):
if global_flag_keysize_must_match:
return expected == actual
return expected <= actual
So just in case there are companies that requires exact key size (rather than minimum key size), we can set global_flag_keysize_must_match
to True
(perhaps via an option like --keysize-exact
)
Or alternatively turn the logic around so people relying on prior behavior doesn't get an unexpected suprise, so make the option --keysize-as-minimum
.
@jtesta what do you think about this PR?
@pepoluan , @szubersk : I'll be reviewing this PR soon. I'm planning for a release by the end of this month, and either this PR or something similar will likely be included.
@szubersk : thanks for submitting this PR!
When evaluating policy compliance, use less-than operator so keys bigger than expected (and hence very often better) don't fail policy evaulation. This change reduces the amount of false-positives and allows for more flexibility when hardening SSH installations.