Skip to content

Commit

Permalink
more documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed Oct 26, 2018
1 parent 8c6a9e4 commit 4923f00
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -60,6 +60,7 @@ secret.cfg
/.ropeproject/
/.project
/.pydevproject
.mypy_cache/

# Import Data
/*.csv
Expand Down
14 changes: 7 additions & 7 deletions docs/idea.rst
@@ -1,7 +1,7 @@
The Idea behind RestrictedPython
================================

Python is a `Turing complete`_ programming language.
Python is a `Turing complete <https://en.wikipedia.org/wiki/Turing_completeness>` programming language.
To offer a Python interface for users in web context is a potential security risk.
Web frameworks and Content Management Systems (CMS) want to offer their users as much extensibility as possible through the web (TTW).
This also means to have permissions to add functionality via a Python Script.
Expand All @@ -10,9 +10,9 @@ There should be additional preventive measures taken to ensure integrity of the

RestrictedPython defines a safe subset of the Python programming language.
This is a common approach for securing a programming language.
The `Ada Ravenscar profile`_ is another example of such an approach.
The `Ada Ravenscar profile <https://en.wikipedia.org/wiki/Ravenscar_profile>` is another example of such an approach.

Defining a secure subset of the language involves restricting the `EBNF`_ elements and explicitly allowing or disallowing language features.
Defining a secure subset of the language involves restricting the `EBNF <https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form>` elements and explicitly allowing or disallowing language features.
Much of the power of a programming language derives from its standard and contributed libraries, so any calling of these methods must also be checked and potentially restricted.
RestrictedPython generally disallows calls to any library that is not explicit whitelisted.

Expand Down Expand Up @@ -79,8 +79,8 @@ Also RestrictedPython provides three predefined, limited versions of Python's ow
* ``limited_builtins`` (by Limits.py), which provides restricted sequence types
* ``utilities_builtins`` (by Utilities.py), which provides access for standard modules math, random, string and for sets.

Additional there exist guard functions to make attributes of Python objects immutable --> ``full_write_guard`` (write and delete protected)
One special shortcut:

* ``safe_globals`` for ``{'__builtins__': safe_builtins}`` (by Guards.py)

.. _`Turing complete`: https://en.wikipedia.org/wiki/Turing_completeness
.. _Ada Ravenscar Profile: https://en.wikipedia.org/wiki/Ravenscar_profile
.. _EBNF: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form
Additional there exist guard functions to make attributes of Python objects immutable --> ``full_write_guard`` (write and delete protected)
3 changes: 1 addition & 2 deletions docs/usage/basic_usage.rst
Expand Up @@ -92,8 +92,7 @@ So you normally end up using:

One common advanced usage would be to define an own restricted builtin dictionary.

There is a shortcut for ``{'__builtins__': safe_builtins}`` named
``safe_globals`` which can be imported from ``RestrictedPython``.
There is a shortcut for ``{'__builtins__': safe_builtins}`` named ``safe_globals`` which can be imported from ``RestrictedPython``.

Necessary setup
---------------
Expand Down
2 changes: 2 additions & 0 deletions docs/usage/policy.rst
Expand Up @@ -24,6 +24,8 @@ Predefined builtins
* ``limited_builtins`` which provides restricted sequence types,
* ``utility_builtins`` which provides access for standard modules math, random, string and for sets.

* ``safe_globals`` a shortcut for ``glb = {'__builtins__': safe_builtins}``

Guards
......

Expand Down

0 comments on commit 4923f00

Please sign in to comment.