To comply with the new data protection act in the EU we need to change webform to only store the IP-address if it is needed (ie. for flood protection).

This is different to the "confidential" setting, because it does not forbid logged-in users to submit the form.

Proposed solution

  1. Use the Drupal core flood protection function that automatically clean-out events when needed.
  2. Add an option to avoid storing the IP-address. (Or maybe to crop it.)

Comments

torotil created an issue. See original summary.

torotil’s picture

StatusFileSize
new8.35 KB

Here is a patch that implements the proposed solution.

torotil’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 2972651-webform-no-ip-addresses-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

torotil’s picture

Status: Needs work » Needs review
StatusFileSize
new8.34 KB
liam morland’s picture

Thanks for the patch. Please check your character encoding. The patch currently has "the user’s IP-address". This should have some tests.

liam morland’s picture

Category: Task » Feature request
torotil’s picture

@Liam thanks for taking a look! The patch uses proper UTF-8 encoding (and the proper single quote character). Your browser or editor is at fault.

liam morland’s picture

The problem is that drupal.org is not sending a charset it just serves it as text/plain.

torotil’s picture

StatusFileSize
new8.38 KB

Tiny update: Replace with the simpler '. Fix 3 coding-style issues.

alexiswatson’s picture

Priority: Normal » Major
Status: Needs review » Needs work
Issue tags: +GDPR

@9 - Drupal, to the best of my recollection, does use UTF-8 for its code files. That said, I agree that it's irritating. This should probably be directed to the Drupal.org Infrastructure queue.

@10 - The approach looks sensible, though it still needs tests. Relatively minor nit: any particular reason the variable isn't a 1/0 flag?

Elevating to Major and tagging GDPR, due to the impending impact of the latter.

torotil’s picture

@11: Yes, there is a reason. It was suggested that a cropped IP-address (ie. the upper 24bit) might be good enough too. I wanted to keep the implementation open for adding this as a third option.

shaneod’s picture

Is there any way to not store enquires on the DB for Drupal 7 Webform? It seems it will be easier as the Data Controller to no longer store enquiries in the database at all so that there's no danger of a data breach. Seems to be no patches available yet for Drupal 7.

Edit: Sorry guys - I have just found this - posting here in case anyone else is looking for it: https://www.drupal.org/project/webform_clear

alexiswatson’s picture

Status: Needs work » Needs review
StatusFileSize
new14.64 KB

@10 - Gotcha. Suppose we could use named constants to lighten the load on the database a little. I leave our peers and the maintainers to decide whether that's desirable or necessary.

Tests added. Review and feedback welcome.

Status: Needs review » Needs work

The last submitted patch, 14: 2972651--webform-no-ip-addresses--14.patch, failed testing. View results

alexiswatson’s picture

StatusFileSize
new13.78 KB

And reroll.

mforbes’s picture

alexiswatson’s picture

Status: Needs work » Needs review
StatusFileSize
new13.7 KB

Once more, with feeling (and fewer trailing whitespace issues).

Status: Needs review » Needs work

The last submitted patch, 18: 2972651--webform-no-ip-addresses--18.patch, failed testing. View results

alexiswatson’s picture

Status: Needs work » Needs review
StatusFileSize
new13.68 KB
ashu1629’s picture

Thanks @davidwatson for your help.

I have applied this patch in webform 4.x module and it is able to hide the anonymous user IP on time of submission.

Patch applied : https://www.drupal.org/files/issues/2018-05-21/2972651--webform-no-ip-ad...

The ip option can be selected on webform global settings page

Status: Needs review » Needs work

The last submitted patch, 20: 2972651--webform-no-ip-addresses--20.patch, failed testing. View results

manali_phadke’s picture

#10 worked for me.

I have applied this patch in webform 4.x module and it is able to hide the user IP on time of submission. The IP hide/show configuration is available on webform global settings page.

Patch applied: https://www.drupal.org/files/issues/2018-05-16/2972651-webform-no-ip-add...

Thanks for your help.

liam morland’s picture

Issue tags: +Needs tests

Can the patch the includes the tests be fixed so it will apply?

torotil’s picture

Status: Needs work » Needs review
StatusFileSize
new16.75 KB

Here is an attempt to re-roll the patch so that it applies against the current 7.x-4.x.

Status: Needs review » Needs work

The last submitted patch, 25: 2972651-webform-no-ip-addresses-25.patch, failed testing. View results

torotil’s picture

Status: Needs work » Needs review
StatusFileSize
new14.83 KB
stijnd’s picture

StatusFileSize
new14.82 KB

The patch added in #27 works as it should be for me but I re-rolled the patch because it had an wrongly escaped translation string.

torotil’s picture

@stijnd It’s the proper UTF-8 quote character instead of the typographically wrong (but more common) '.

torotil’s picture

We use #27 (and earlier patches from this issue) in production since May 2018 btw.

liam morland’s picture

I think the entire Webform module is built around the common single-quote character. In any case, I'd rather used the more formal "Do not", avoiding the problem altogether.

liam morland’s picture

Status: Needs review » Needs work

Thanks very much for the patch. Using core flood protection is a great idea. I would like to see a separate issue to implement that. Once that is committed, this issue will be simpler.

ArniLoftsson’s picture

StatusFileSize
new13.25 KB

This is a rework off 2972651-webform-no-ip-addresses-28.patch so it works with version 7.x-4.24. Mostly fixing different naming off files.

ArniLoftsson’s picture

StatusFileSize
new13.25 KB

This is a rework off 2972651-webform-no-ip-addresses-28.patch so it works with version 7.x-4.24. Mostly fixing different naming off files.

liam morland’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.