Commit 2c1b4bb7 authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS
Browse files

Merge branch 'conventions' into 'master'

rename authentication backends sections

See merge request !98
parents 7b2dc921 c2802e48
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ burpui/RELEASE
devel.sh
*.egg*
.tox
.reports
.coverage
.coveragerc
.ropeproject
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ Current

- **BREAKING**: the *single* and *version* options within the ``[Global]`` section have been removed in favor of a new unified *backend* option
- **BREAKING**: a change introduced by `#284 <https://git.ziirish.me/ziirish/burp-ui/issues/284>`_ may return wrong timestamps for backups made with burp-server <= 2.1.10 if your current burp-server is >= 2.1.10
- **BREAKING**: the authentication backends section have been renamed with the ``:AUTH`` suffix
- Add: new `audit logging <https://git.ziirish.me/ziirish/burp-ui/issues/260>`_ system
- Add: new ``bui-monitor`` processes pool + ``async`` backend to parallelize some requests `#278 <https://git.ziirish.me/ziirish/burp-ui/issues/278>`_ 
- Add: new `listen` and `listen_status` options in burp-2.2.10 `#279 <https://git.ziirish.me/ziirish/burp-ui/issues/279>`_ 
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ class BasicLoader(BUIloader):
    """The :class:`burpui.misc.auth.basic.BasicLoader` class loads the *Basic*
    users.
    """
    section = name = 'BASIC'
    section = name = 'BASIC:AUTH'

    def __init__(self, app=None, handler=None):
        """:func:`burpui.misc.auth.basic.BasicLoader.__init__` loads users from
+3 −21
Original line number Diff line number Diff line
@@ -12,25 +12,11 @@ except ImportError:
    raise ImportError('Unable to load \'ldap3\' module')


def get_ssl_version(version):
    SSL_SUPPORTED = ['SSLv2', 'SSLv3', 'SSLv23', 'TLSv1', 'TLSv1_1', 'TLSv1_2']
    if version and version in SSL_SUPPORTED:
        try:
            return getattr(ssl, 'PROTOCOL_{}'.format(version))
        except AttributeError:
            idx = SSL_SUPPORTED.index(version) + 1
            if idx == len(SSL_SUPPORTED):
                return None
            return get_ssl_version(SSL_SUPPORTED[idx])
    else:
        return None


class LdapLoader(BUIloader):
    """The :class:`burpui.misc.auth.ldap.LdapLoader` handles searching for and
    binding as a :class:`burpui.misc.auth.ldap.LdapUser` user.
    """
    section = name = 'LDAP'
    section = name = 'LDAP:AUTH'

    def __init__(self, app=None, handler=None):
        """:func:`burpui.misc.auth.ldap.LdapLoader.__init__` establishes a
@@ -53,7 +39,6 @@ class LdapLoader(BUIloader):
                'base': None,
                'searchattr': 'uid',
                'validate': 'none',
                'version': None,
                'cafile': None,
            }
        }
@@ -67,7 +52,6 @@ class LdapLoader(BUIloader):
            'binddn': 'binddn',
            'bindpw': 'bindpw',
            'validate': 'validate',
            'version': 'version',
            'cafile': 'cafile'
        }
        conf.update_defaults(defaults)
@@ -88,9 +72,7 @@ class LdapLoader(BUIloader):
            self.validate = getattr(ssl, 'CERT_{}'.format(self.validate.upper()))
        else:
            self.validate = None
        self.version = get_ssl_version(self.version)
        if not self.version:
            self.logger.warning('No SSL version chosen')
        self.version = ssl.OP_NO_SSLv3
        self.users = []
        self.tls = None
        self.ssl = False
@@ -170,7 +152,7 @@ class LdapLoader(BUIloader):
                self.ldap.search(self.base, query, attributes=['cn', self.attr])
                r = self.ldap.response
            if not r:
                raise Exception('no results')
                raise ValueError('no results')
        except Exception as e:
            self.logger.error('Ooops, LDAP lookup failed: {0}'.format(str(e)))
            return None
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ class LocalLoader(BUIloader):
    """The :class:`burpui.misc.auth.local.LocalLoader` class loads the *Local*
    users.
    """
    section = name = 'LOCAL'
    section = name = 'LOCAL:AUTH'

    def __init__(self, app=None, handler=None):
        """:func:`burpui.misc.auth.Local.localLoader.__init__` loads users from
Loading