From b2fa8c98bff679a157073e447c74ec5308c2760c Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Fri, 10 Nov 2023 23:59:46 +0100 Subject: [PATCH 1/5] Add omines/antispam-bundle (cherry picked from commit 79e5603123597bb914876e470ec5ffab1d73c5a9) --- .../0.1/config/packages/antispam.yaml | 37 +++++++++++++++++++ omines/antispam-bundle/0.1/manifest.json | 8 ++++ 2 files changed, 45 insertions(+) create mode 100644 omines/antispam-bundle/0.1/config/packages/antispam.yaml create mode 100644 omines/antispam-bundle/0.1/manifest.json diff --git a/omines/antispam-bundle/0.1/config/packages/antispam.yaml b/omines/antispam-bundle/0.1/config/packages/antispam.yaml new file mode 100644 index 000000000..b2096b626 --- /dev/null +++ b/omines/antispam-bundle/0.1/config/packages/antispam.yaml @@ -0,0 +1,37 @@ +# +# This sample configuration sets up a default anti-spam profile that will already stop a lot of +# form spam with minimal effort and none to minimal user inconvenience. +# +# To get started right away read the Quickstart at https://omines.github.io/antispam-bundle/quickstart/ +# +# For more details on the options available visit https://omines.github.io/antispam-bundle/configuration/ +# +antispam: + profiles: + default: + # Insert a honeypot called "email_address" on all forms to lure bots into filling it in + honeypot: email_address + + # Reject all forms that have been submitted either within 3 seconds, or after more than an hour + timer: + min: 3 + max: 3600 + + # + # The measures above should already have notable effect on the amount of spam that gets through + # your forms. Still getting annoying amounts? Consider uncommenting and modifying some of the + # examples below after careful consideration about their impact + # + + # Reject text fields that contain (lame attempts at) HTML or BBCode +# banned_markup: true + + # Reject text fields that consist for more than 40% of Cyrillic (Russian) characters +# banned_scripts: +# scripts: [ cyrillic ] +# max_percentage: 40 + + # Reject fields that contain more than 3 URLs, or repeat a single URL more than once +# url_count: +# max: 3 +# max_identical: 1 diff --git a/omines/antispam-bundle/0.1/manifest.json b/omines/antispam-bundle/0.1/manifest.json new file mode 100644 index 000000000..640980701 --- /dev/null +++ b/omines/antispam-bundle/0.1/manifest.json @@ -0,0 +1,8 @@ +{ + "bundles": { + "Omines\\AntiSpamBundle\\AntiSpamBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +} From 52fde52a381e7dbcc1524cc053f4f3fcefd61dcb Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Sat, 11 Nov 2023 00:06:03 +0100 Subject: [PATCH 2/5] Clarify comment --- omines/antispam-bundle/0.1/config/packages/antispam.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/omines/antispam-bundle/0.1/config/packages/antispam.yaml b/omines/antispam-bundle/0.1/config/packages/antispam.yaml index b2096b626..5f9a81fa0 100644 --- a/omines/antispam-bundle/0.1/config/packages/antispam.yaml +++ b/omines/antispam-bundle/0.1/config/packages/antispam.yaml @@ -19,8 +19,9 @@ antispam: # # The measures above should already have notable effect on the amount of spam that gets through - # your forms. Still getting annoying amounts? Consider uncommenting and modifying some of the - # examples below after careful consideration about their impact + # your forms. Still getting annoying amounts? Analyze the patterns of uncaught spam, then + # consider uncommenting and modifying some of the examples below after careful consideration + # about their impact. # # Reject text fields that contain (lame attempts at) HTML or BBCode From 46861a9fb7b3229ded9d6df92178a8fa038369f2 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Sat, 11 Nov 2023 00:37:40 +0100 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: Kevin Bond --- omines/antispam-bundle/0.1/config/packages/antispam.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/omines/antispam-bundle/0.1/config/packages/antispam.yaml b/omines/antispam-bundle/0.1/config/packages/antispam.yaml index 5f9a81fa0..49b9e2274 100644 --- a/omines/antispam-bundle/0.1/config/packages/antispam.yaml +++ b/omines/antispam-bundle/0.1/config/packages/antispam.yaml @@ -36,3 +36,8 @@ antispam: # url_count: # max: 3 # max_identical: 1 + +when@test: + antispam: + # disable in tests + passive: true From 2a20fdc1d2d7673a7f9102eecc0360cb3cae7144 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Sat, 11 Nov 2023 00:40:22 +0100 Subject: [PATCH 4/5] Update antispam.yaml --- omines/antispam-bundle/0.1/config/packages/antispam.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/omines/antispam-bundle/0.1/config/packages/antispam.yaml b/omines/antispam-bundle/0.1/config/packages/antispam.yaml index 49b9e2274..1ff3d6dd2 100644 --- a/omines/antispam-bundle/0.1/config/packages/antispam.yaml +++ b/omines/antispam-bundle/0.1/config/packages/antispam.yaml @@ -39,5 +39,7 @@ antispam: when@test: antispam: - # disable in tests + # In automated tests the bundle and included components should by default run in passive mode, + # to ensure your form submissions will not get rejected due to being exactly what they are - + # an automated bot filling in your site forms in a distinctly non-human way. passive: true From 42a3d045089fbbf8f2828e74e60f3e46ef864fb2 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Wed, 15 Nov 2023 23:42:50 +0100 Subject: [PATCH 5/5] Update configuration for current bundle version --- omines/antispam-bundle/0.1/config/packages/antispam.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/omines/antispam-bundle/0.1/config/packages/antispam.yaml b/omines/antispam-bundle/0.1/config/packages/antispam.yaml index 1ff3d6dd2..a0b51e291 100644 --- a/omines/antispam-bundle/0.1/config/packages/antispam.yaml +++ b/omines/antispam-bundle/0.1/config/packages/antispam.yaml @@ -39,7 +39,6 @@ antispam: when@test: antispam: - # In automated tests the bundle and included components should by default run in passive mode, - # to ensure your form submissions will not get rejected due to being exactly what they are - - # an automated bot filling in your site forms in a distinctly non-human way. - passive: true + # In automated tests the bundle and included components are by default disabled. You can still + # enable them for individual test cases via the main AntiSpam service. + enabled: false