New Zope Dos Protection now available in cookiecutter-zope-instance

With Zope 5.8.4 and later, DOS protection is available.
cookiecutter-zope-instance now supports this settings for zope.conf new section <dos_protection>.
See also GitHub - plone/cookiecutter-zope-instance: It bakes configuration for Zope 5 (scroll down in this section).


In Zope 5.8.4 and later, DOS protection is available. 
For older versions of Zope set this to false.

Default: true

It is better to have it always enabled. For older, it does not change anything. For recent Zope versions, it is already set to a reasonable value (thinking to upgrades).

Probably it want start up with this section in.

and the default are very conservative set, if the section s missing

1 Like

I have an instance that originally started with:
cookiecutter gh:collective/cookiecutter-plone-starter
was created with Plone 6.0.6
Now when I try to do a make install-backend I get an error that is probably related to dos_protection.
What can I do to fix this error?

+ make create-site
make[1]: Entering directory '/home/system/plone6/ecmr2021'
+ dirname /home/system/plone6/ecmr2021/Makefile
+ make -C ./backend/ create-site
make[2]: Entering directory '/home/system/plone6/ecmr2021/backend'
+ which python3
+ python3 -c 'import sys; print((int(sys.version_info[0]), int(sys.version_info[1])) >= tuple(map(int, '\''3.8'\''.split('\''.'\''))))'
+ ./bin/zconsole run instance/etc/zope.conf ./scripts/
Traceback (most recent call last):
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 332, in gettype
    return self._types[n]
KeyError: 'dos_protection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 102, in start_section
    newsect = self.context.startSection(section, type_, name)
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 407, in startSection
    t = self.schema.gettype(type_)
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 334, in gettype
    raise ZConfig.SchemaError("unknown type name: " + repr(name))
ZConfig.SchemaError: unknown type name: 'dos_protection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/system/plone6/ecmr2021/backend/./bin/zconsole", line 8, in <module>
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/Zope2/utilities/", line 50, in main
    runscript(namespace.zopeconf, *namespace.scriptargs)
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/Zope2/utilities/", line 13, in runscript
    make_wsgi_app({}, zopeconf)
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/Zope2/Startup/", line 51, in make_wsgi_app
    opts = ZopeWSGIOptions(configfile=zope_conf)()
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/Zope2/Startup/", line 84, in __call__
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/Zope2/Startup/", line 79, in load_configfile
    self.configroot, self.confighandlers = loader.loadURL(
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 153, in loadURL
    return self.loadResource(r)
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 397, in loadResource
    self._parse_resource(sm, resource)
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 442, in _parse_resource
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 75, in parse
    section = self.start_section(section, line[1:-1])
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 104, in start_section
  File "/home/system/plone6/ecmr2021/backend/lib/python3.9/site-packages/ZConfig/", line 194, in error
    raise ZConfig.ConfigurationSyntaxError(message, self.url, self.lineno)
ZConfig.ConfigurationSyntaxError: unknown type name: 'dos_protection'
(line 18 in file:///home/system/plone6/ecmr2021/backend/instance/etc/zope.conf)
make[2]: *** [Makefile:155: create-site] Error 1
make[2]: Leaving directory '/home/system/plone6/ecmr2021/backend'
make[1]: *** [Makefile:53: create-site] Error 2
make[1]: Leaving directory '/home/system/plone6/ecmr2021'
make: *** [Makefile:44: install-backend] Error 2

The constraints seem to still contain Zope 5.8.3:

And pinning Zope==5.8.4 in the constraints.txt also gives an error

You've to edit backend/instance.yaml and add dos_protection_available: false, I think.


Thank you very much, that worked perfectly