Use 'silent error' logic for any other rules using ja3 as well.
*
* \retval 0 On success
* \retval -1 On failure
+ * \retval -2 on failure that should be silent after the first
*/
static int DetectTlsJa3HashSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
SSLEnableJA3();
/* Check if JA3 is disabled */
- if (!RunmodeIsUnittests() && Ja3IsDisabled("rule"))
- return -1;
+ if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
+ if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_AL_TLS_JA3_HASH)) {
+ SCLogError(SC_WARN_JA3_DISABLED, "ja3 support is not enabled");
+ }
+ return -2;
+ }
return 0;
}
SSLEnableJA3();
/* Check if JA3 is disabled */
- if (!RunmodeIsUnittests() && Ja3IsDisabled("rule"))
- return -1;
+ if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
+ if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_AL_TLS_JA3_STRING)) {
+ SCLogError(SC_WARN_JA3_DISABLED, "ja3(s) support is not enabled");
+ }
+ return -2;
+ }
return 0;
}
SSLEnableJA3();
/* Check if JA3 is disabled */
- if (!RunmodeIsUnittests() && Ja3IsDisabled("rule"))
- return -1;
+ if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
+ if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_AL_TLS_JA3S_HASH)) {
+ SCLogError(SC_WARN_JA3_DISABLED, "ja3(s) support is not enabled");
+ }
+ return -2;
+ }
return 0;
}
SSLEnableJA3();
/* Check if JA3 is disabled */
- if (!RunmodeIsUnittests() && Ja3IsDisabled("rule"))
- return -1;
+ if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
+ if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_AL_TLS_JA3S_STRING)) {
+ SCLogError(SC_WARN_JA3_DISABLED, "ja3(s) support is not enabled");
+ }
+ return -2;
+ }
return 0;
}
{
bool is_enabled = SSLJA3IsEnabled();
if (is_enabled == 0) {
- SCLogWarning(SC_WARN_JA3_DISABLED, "JA3 is disabled, skipping %s",
- type);
+ if (strcmp(type, "rule") != 0) {
+ SCLogWarning(SC_WARN_JA3_DISABLED, "JA3 is disabled, skipping %s",
+ type);
+ }
return 1;
}
#ifndef HAVE_NSS
else {
- SCLogWarning(SC_WARN_NO_JA3_SUPPORT,
- "no MD5 calculation support built in (LibNSS), skipping %s",
- type);
+ if (strcmp(type, "rule") != 0) {
+ SCLogWarning(SC_WARN_NO_JA3_SUPPORT,
+ "no MD5 calculation support built in (LibNSS), skipping %s",
+ type);
+ }
return 1;
}
#endif /* HAVE_NSS */