All Projects → isometriks → Isometriksspambundle

isometriks / Isometriksspambundle

Licence: mit
Symfony3 Form Spam Protection

Projects that are alternatives of or similar to Isometriksspambundle

Gluggibundle
Modular layout preview system, to be used within a symfony app.
Stars: ✭ 5 (-86.84%)
Mutual labels:  symfony-bundle
Conpot
ICS/SCADA honeypot
Stars: ✭ 853 (+2144.74%)
Mutual labels:  honeypot
Ismaambrosigeneratorbundle
Generates Symfony2 documents, forms and CRUD for MongoDB documents
Stars: ✭ 27 (-28.95%)
Mutual labels:  symfony-bundle
Doctrinetraitbundle
Generate the entities stub methods in a trait
Stars: ✭ 6 (-84.21%)
Mutual labels:  symfony-bundle
Honeytrap
Advanced Honeypot framework.
Stars: ✭ 938 (+2368.42%)
Mutual labels:  honeypot
Jmsserializerbundlebridge
[READ ONLY] Symfony bundle for using JMSSerializer as message serializer for SimpleBus/Asynchronous
Stars: ✭ 10 (-73.68%)
Mutual labels:  symfony-bundle
Alicebundle
A Symfony bundle to manage fixtures with Alice and Faker.
Stars: ✭ 742 (+1852.63%)
Mutual labels:  symfony-bundle
Udpot
Simple UDP honeypot script
Stars: ✭ 35 (-7.89%)
Mutual labels:  honeypot
Symfony Crawler Bundle
Implements the crawler package into Symfony
Stars: ✭ 8 (-78.95%)
Mutual labels:  symfony-bundle
Webfactoryicutranslationbundle
Enables ICU message formatting for translations in Symfony applications.
Stars: ✭ 27 (-28.95%)
Mutual labels:  symfony-bundle
Javersphinxbundle
Symfony bundle which provides integration of Sphinx search engine with Symfony using SphinxQL
Stars: ✭ 18 (-52.63%)
Mutual labels:  symfony-bundle
Asynchronous Bundle
[READ ONLY] Symfony bundle for using SimpleBus/Asynchronous
Stars: ✭ 22 (-42.11%)
Mutual labels:  symfony-bundle
Malware Samples
A collection of malware samples caught by several honeypots i manage
Stars: ✭ 863 (+2171.05%)
Mutual labels:  honeypot
Api Platform
Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Stars: ✭ 7,144 (+18700%)
Mutual labels:  symfony-bundle
Emailobfuscator
Verschlüsselung von E-Mailadressen zum Schutz vor Spam
Stars: ✭ 34 (-10.53%)
Mutual labels:  spam
Sylius
Open Source eCommerce Platform on Symfony
Stars: ✭ 6,598 (+17263.16%)
Mutual labels:  symfony-bundle
Invisible captcha
🍯 Unobtrusive and flexible spam protection for Rails apps
Stars: ✭ 851 (+2139.47%)
Mutual labels:  honeypot
Sncredisbundle
A Redis bundle for Symfony supporting Predis and PhpRedis
Stars: ✭ 980 (+2478.95%)
Mutual labels:  symfony-bundle
Social Post Bundle
Symfony bundle to publish status updates on Facebook, LinkedIn and Twitter.
Stars: ✭ 35 (-7.89%)
Mutual labels:  symfony-bundle
Nginx Cleantalk Service
LUA configuration to filter any POST requests.
Stars: ✭ 13 (-65.79%)
Mutual labels:  spam

Symfony SpamBundle

Please feel free to send pull requests. I would like to incorporate a bunch of spam methods into this project.

Installation

Install via Composer:

$ composer require isometriks/spam-bundle

Use ~0.3.0 for Symfony 2.3-2.7, or ~1.0 for 3+

Add to AppKernel.php (done automatically for Symfony Flex):

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Isometriks\Bundle\SpamBundle\IsometriksSpamBundle(),
            // ...
        ];

        return $bundles;
    }
}

Currently we have:

Timed Spam Prevention

Requires forms to be sent after a certain amount of time. Most bots won't wait to submit your forms, so requiring an amount of time between render and submit can help deter these bots.

A side affect of this spam prevention is that you won't be able to refresh a page to resubmit data UNLESS the view is rendered again $form->createView() This is because the event listener removes the start time of the form and when it can't find it, will cause the form to be invalid. You could set your min time to 0 to just make use of this feature

Also note that this spam protection will also apply this limit to forms that are not filled in correctly and need to be resubmitted. A high minimum time could affect those users who only need to fix one field quickly

Configuration:

# Copying this config is not necessary. These are defaults, only copy 
# what you'd like to change. 
isometriks_spam:
    timed:
        min: 7
        max: 3600
        global: false
        # message also takes translator strings.
        message: You're doing that too quickly.

Usage:

// Only timed_spam = true is required to enable, the rest are to override settings
$this->createForm(MyType:class, null, [
    'timed_spam' => true,
    'timed_spam_min' => 3,
    'timed_spam_max' => 40,
    'timed_spam_message' => 'Please wait 3 seconds before submitting',
]);

Or

public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'timed_spam' => true,
        // ...
    ]);
}

Honeypot Spam Prevention

A honeypot is a way to trick bots into filling out a field that should not be filled out. It is hidden and can be named something usual so that any bots / crawlers will think it is a real field.

If the field is filled out, then the form is invalid. You can optionally choose to use a class name to hide the form element as well in case the bot tries to check the style attribute.

# Copying this config is not necessary. These are defaults, only copy 
# what you'd like to change. 
isometriks_spam:
    honeypot:
        field: email_address
        use_class: false
        hide_class: hidden
        global: false
        message: Form fields are invalid

Usage:

// Only honeypot = true is required to enable, the rest are to override settings
$this->createForm(MyType::class, null, [
    'honeypot' => true,
    'honeypot_field' => 'email_address',
    'honeypot_use_class' => false,
    'honeypot_hide_class' => 'hidden',
    'honeypot_message' => 'Form field are invalid',
]);

Or

public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'honeypot' => true,
        // ...
    ]);
}

Twig Form Error message rendering

Form errors come from the form itself, so if you want to display the errors you'll need to make sure this is in your template.

{% if form.vars.errors is not empty %}
    {{ form_errors(form) }}
{% endif %}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].