Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 65e8c1c

Browse files
author
Fred Wenzel
committed
Added CEF logging. Bug 709195, issue #20.
1 parent 7a9730c commit 65e8c1c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

bestpractices.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,27 @@ you're doing!), Django's ``csrf_exempt`` decorator still works as expected.
169169

170170
To learn more about this method, refer to the
171171
`django-session-csrf README <https://github.com/mozilla/django-session-csrf#readme>`_.
172+
173+
174+
CEF (Common Event Format) logging
175+
---------------------------------
176+
177+
Playdoh is set up for `Common Event Format (CEF) <http://pypi.python.org/pypi/cef>`_
178+
logging. CEF is a unified logging format for security-relevant events and
179+
can be used by `ArcSight <http://www.arcsight.com/solutions/solutions-cef/>`_
180+
and similar applications.
181+
182+
For example, to log a user resetting their password, you would do something
183+
like this:
184+
185+
.. code-block:: python
186+
187+
import logging
188+
from funfactory.log import log_cef
189+
190+
def pw_reset(request, user):
191+
log_cef('Password Reset', logging.INFO, request, username=user.username,
192+
signature='PASSWORDRESET', msg='User requested password reset')
193+
194+
For more information about logging and suggestions on what kinds of events to
195+
log, refer to the `Mozilla Security Wiki <https://wiki.mozilla.org/Security/Users_and_Logs>`_.

0 commit comments

Comments
 (0)