-
Notifications
You must be signed in to change notification settings - Fork 23
SONARKT-656 Implement S6418: Hard-coded secrets are security-sensitive #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2f6d111
to
ba436e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
sonar-kotlin-checks/src/main/java/org/sonarsource/kotlin/checks/AbstractHardcodedVisitor.kt
Outdated
Show resolved
Hide resolved
override fun isSensitiveStringLiteral(value: String): Boolean { | ||
return value.isNotEmpty() | ||
&& value.length >= MINIMUM_CREDENTIAL_LENGTH | ||
&& getEntropyDetector().hasEnoughEntropy(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this condition is always satisfied in the tests. We could optionally add some cases with low-entropy, to increase coverage.
sonar-kotlin-checks/src/main/java/org/sonarsource/kotlin/checks/AbstractHardcodedVisitor.kt
Outdated
Show resolved
Hide resolved
sonar-kotlin-checks/src/main/java/org/sonarsource/kotlin/checks/AbstractHardcodedVisitor.kt
Outdated
Show resolved
Hide resolved
|
RSPEC SonarSource/rspec#5124