Пример #1
0
YKVAL_SERVERS = [
    'https://api.yubico.com/wsapi/2.0/verify',
    'https://api2.yubico.com/wsapi/2.0/verify',
    'https://api3.yubico.com/wsapi/2.0/verify',
    'https://api4.yubico.com/wsapi/2.0/verify',
    'https://api5.yubico.com/wsapi/2.0/verify'
]
YKVAL_DEFAULT_ID = 11004
YKVAL_DEFAULT_SECRET = '5Vm3Zp2mUTQHMo1DeG9tdojpc1Y='


auth_config = FileConfig(
    AUTH_CONFIG_FILE,
    [
        ('server_list', python_list_handler('YKVAL_SERVERS', YKVAL_SERVERS)),
        ('client_id', python_handler('YKVAL_CLIENT_ID', YKVAL_DEFAULT_ID)),
        ('client_secret', python_handler('YKVAL_CLIENT_SECRET',
                                         YKVAL_DEFAULT_SECRET)),
        ('auto_provision', python_handler('AUTO_PROVISION', True)),
        ('allow_empty', python_handler('ALLOW_EMPTY_PASSWORDS', False)),
        ('security_level', python_handler('SECURITY_LEVEL', 1)),
        ('yubikey_id', python_handler('YUBIKEY_IDENTIFICATION', False)),
        ('use_hsm', python_handler('USE_HSM', False)),
        ('hsm_device', python_handler('YHSM_DEVICE', 'yhsm://localhost:5348')),
        ('db_config', python_handler('DATABASE_CONFIGURATION',
                                     'sqlite:///:memory:')),
        ('user_registration', python_handler('ENABLE_USER_REGISTRATION',
                                             True)),
        ('user_deletion', python_handler('ALLOW_USER_DELETE', False)),
    ]
)
Пример #2
0
YKVAL_SERVERS = [
    'https://api.yubico.com/wsapi/2.0/verify',
    'https://api2.yubico.com/wsapi/2.0/verify',
    'https://api3.yubico.com/wsapi/2.0/verify',
    'https://api4.yubico.com/wsapi/2.0/verify',
    'https://api5.yubico.com/wsapi/2.0/verify'
]
YKVAL_DEFAULT_ID = 11004
YKVAL_DEFAULT_SECRET = '5Vm3Zp2mUTQHMo1DeG9tdojpc1Y='


auth_config = FileConfig(
    AUTH_CONFIG_FILE,
    [
        ('server_list', python_list_handler('YKVAL_SERVERS', YKVAL_SERVERS)),
        ('client_id', python_handler('YKVAL_CLIENT_ID', YKVAL_DEFAULT_ID)),
        ('client_secret', python_handler('YKVAL_CLIENT_SECRET',
                                         YKVAL_DEFAULT_SECRET)),
        ('auto_provision', python_handler('AUTO_PROVISION', True)),
        ('allow_empty', python_handler('ALLOW_EMPTY_PASSWORDS', False)),
        ('security_level', python_handler('SECURITY_LEVEL', 1)),
        ('yubikey_id', python_handler('YUBIKEY_IDENTIFICATION', False)),
        ('use_ldap', python_handler('USE_LDAP', False)),
        ('ldap_server', python_handler('LDAP_SERVER', 'ldap://127.0.0.1')),
        ('ldap_bind_dn', python_handler('LDAP_BIND_DN',
                                        'uid={user.name},ou=People,dc=lan')),
        ('ldap_auto_import', python_handler('LDAP_AUTO_IMPORT', True)),
        ('use_hsm', python_handler('USE_HSM', False)),
        ('hsm_device', python_handler('YHSM_DEVICE', 'yhsm://localhost:5348')),
        ('db_config', python_handler('DATABASE_CONFIGURATION',
                                     'sqlite:///:memory:')),
Пример #3
0
YubiAuth = None

AUTH_CONFIG_FILE = '/etc/yubico/auth/yubiauth.conf'
YKVAL_SERVERS = [
    'https://api.yubico.com/wsapi/2.0/verify',
    'https://api2.yubico.com/wsapi/2.0/verify',
    'https://api3.yubico.com/wsapi/2.0/verify',
    'https://api4.yubico.com/wsapi/2.0/verify',
    'https://api5.yubico.com/wsapi/2.0/verify'
]
YKVAL_DEFAULT_ID = 11004
YKVAL_DEFAULT_SECRET = '5Vm3Zp2mUTQHMo1DeG9tdojpc1Y='

auth_config = FileConfig(AUTH_CONFIG_FILE, [
    ('server_list', python_list_handler('YKVAL_SERVERS', YKVAL_SERVERS)),
    ('client_id', python_handler('YKVAL_CLIENT_ID', YKVAL_DEFAULT_ID)),
    ('client_secret',
     python_handler('YKVAL_CLIENT_SECRET', YKVAL_DEFAULT_SECRET)),
    ('auto_provision', python_handler('AUTO_PROVISION', True)),
    ('allow_empty', python_handler('ALLOW_EMPTY_PASSWORDS', False)),
    ('security_level', python_handler('SECURITY_LEVEL', 1)),
    ('yubikey_id', python_handler('YUBIKEY_IDENTIFICATION', False)),
    ('use_ldap', python_handler('USE_LDAP', False)),
    ('ldap_server', python_handler('LDAP_SERVER', 'ldap://127.0.0.1')),
    ('ldap_bind_dn',
     python_handler('LDAP_BIND_DN', 'uid={user.name},ou=People,dc=lan')),
    ('ldap_auto_import', python_handler('LDAP_AUTO_IMPORT', True)),
    ('use_hsm', python_handler('USE_HSM', False)),
    ('hsm_device', python_handler('YHSM_DEVICE', 'yhsm://localhost:5348')),
    ('db_config', python_handler('DATABASE_CONFIGURATION',
                                 'sqlite:///:memory:')),
Пример #4
0
from wtforms.widgets import PasswordInput
from wtforms.validators import NumberRange, IPAddress
from yubiadmin.util.app import App
from yubiadmin.util.config import python_handler, FileConfig
from yubiadmin.util.form import ConfigForm
from yubiadmin.util.system import invoke_rc_d

__all__ = [
    'app'
]


admin_config = FileConfig(
    '/etc/yubico/admin/yubiadmin.conf',
    [
        ('interface', python_handler('INTERFACE', '127.0.0.1')),
        ('port', python_handler('PORT', 8080)),
        ('username', python_handler('USERNAME', 'yubiadmin')),
        ('password', python_handler('PASSWORD', 'yubiadmin')),
    ]
)


class ConnectionForm(ConfigForm):
    legend = 'Connection'
    description = 'Server network interface settings'
    config = admin_config

    interface = TextField('Listening Interface', [IPAddress()])
    port = IntegerField('Listening Port', [NumberRange(1, 65535)])
Пример #5
0
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from threading import Timer
from wtforms.fields import IntegerField, TextField, PasswordField
from wtforms.widgets import PasswordInput
from wtforms.validators import NumberRange, IPAddress
from yubiadmin.util.app import App
from yubiadmin.util.config import python_handler, FileConfig
from yubiadmin.util.form import ConfigForm
from yubiadmin.util.system import invoke_rc_d

__all__ = ['app']

admin_config = FileConfig('/etc/yubico/admin/yubiadmin.conf', [
    ('interface', python_handler('INTERFACE', '127.0.0.1')),
    ('port', python_handler('PORT', 8080)),
    ('username', python_handler('USERNAME', 'yubiadmin')),
    ('password', python_handler('PASSWORD', 'yubiadmin')),
])


class ConnectionForm(ConfigForm):
    legend = 'Connection'
    description = 'Server network interface settings'
    config = admin_config

    interface = TextField('Listening Interface', [IPAddress()])
    port = IntegerField('Listening Port', [NumberRange(1, 65535)])

Пример #6
0
    YubiAuth = None

__all__ = ['app']

AUTH_CONFIG_FILE = '/etc/yubico/auth/yubiauth.conf'
YKVAL_SERVERS = [
    'https://api.yubico.com/wsapi/2.0/verify',
    'https://api2.yubico.com/wsapi/2.0/verify',
    'https://api3.yubico.com/wsapi/2.0/verify',
    'https://api4.yubico.com/wsapi/2.0/verify',
    'https://api5.yubico.com/wsapi/2.0/verify'
]

auth_config = FileConfig(AUTH_CONFIG_FILE, [
    ('server_list', python_list_handler('YKVAL_SERVERS', YKVAL_SERVERS)),
    ('client_id', python_handler('YKVAL_CLIENT_ID', 11004)),
    ('client_secret',
     python_handler('YKVAL_CLIENT_SECRET', '5Vm3Zp2mUTQHMo1DeG9tdojpc1Y=')),
    ('auto_provision', python_handler('AUTO_PROVISION', True)),
    ('allow_empty', python_handler('ALLOW_EMPTY_PASSWORDS', False)),
    ('security_level', python_handler('SECURITY_LEVEL', 1)),
    ('yubikey_id', python_handler('YUBIKEY_IDENTIFICATION', False)),
    ('use_hsm', python_handler('USE_HSM', False)),
    ('hsm_device', python_handler('YHSM_DEVICE', 'yhsm://localhost:5348')),
    ('db_config', python_handler('DATABASE_CONFIGURATION',
                                 'sqlite:///:memory:')),
    ('user_registration', python_handler('ENABLE_USER_REGISTRATION', True)),
    ('user_deletion', python_handler('ALLOW_USER_DELETE', False)),
])