usermapper


Nameusermapper JSON
Version 0.3 PyPI version JSON
download
home_page
SummaryCreate a manual authentication file for the Guacamole remote access gateway from a simple configuration file.
upload_time2023-09-17 22:41:20
maintainer
docs_urlNone
author
requires_python>=3.7
licenseGPLv3
keywords guacamole yaml xml authentication
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Usermapper #

Create a complex Guacamole manual authentication file, saved as */etc/guacamole/user-mapping.xml*, from a simple confuration file. This is an *opinionated* script designed to support training labs. It assumes every user will have access to the same set of devices in the lab.

## Installation ##

This is a Python program. Install from Github:

    $ pip install git+https://github.com/blinklet/usermapper.git@v0.3#egg=usermapper

## Usage ##

Create a configuration file that describes the users and devices in your lab. Then run the usermapper program. To see an example of the configuration file format, look at the *example-config.yaml* file in this repository, or see the next section.

The usermapper program accepts two optional arguments that allow the user to specify the input file and the output file. See the command syntax below:

    $ python3 -m usermapper [-i <input filename>] [-o <output filename>]

For example:

    $ python3 -m usermapper -i test.yaml -o /tmp/guac/map.xml

To use default filenames, where the configuration script is named *config.yaml* and the output file will be named *user-mapping.xml* and both files are in the current directory, run the script without arguments as follows:

    $ python3 -m usermapper

## Configuration file format 

The configuration file is written using the [YAML data file standard](https://rollout.io/blog/yaml-tutorial-everything-you-need-get-started/). The file name must end with the ".yaml" extension. 

The configuration file consists of two main blocks: a *users* block and a *devices* block. You may have one or more types of users and one or more types of devices. 

The <em>username_suffix</em>, device <em>name_suffix</em>, and device <em>hostname_suffix</em> must be a number with or without leading zeros, enclosed in quotes. We generate names by combining the corresponding name prefix and a different name suffix with a length equal to the length of the suffix string and starting at the number specified in the suffix. 

If a user type's <em>password</em> is "random", each user of the same type will be assigned a unique random password. If you specify a specific user password, each user in the same user type will have the same password.

You may also add additional device parameters from the <a href="https://guacamole.apache.org/doc/gug/configuring-guacamole.html" target="_blank">list of Guacamole configuration parameters</a>.

### Example config file

See the example below, which specifies *trainers* and *students* user types, and *servers* and *routers* device types:

```
users:

    trainers:
        quantity: 1
        username_prefix: trainer
        username_suffix: '01'
        password: s7T6yxOC100

    students:
        quantity: 8
        username_prefix: training
        username_suffix: '01'
        password: random

devices:

    servers:
        quantity: 11
        name_prefix: PC
        name_suffix: '09'
        hostname_prefix: '10.0.10.'
        hostname_suffix: '109'
        parameters:
            protocol: ssh
            hostname: ~
            port: 22
            username: root
            password: root
            color-scheme: white-black
            enable-sftp: 'true'
            sftp-root-directory: '/'

    routers:
        quantity: 4
        name_prefix: R
        name_suffix: '01'
        hostname_prefix: '10.0.10.'
        hostname_suffix: '1'
        parameters:
            protocol: ssh
            hostname: ~
            port: 22
            username: admin
            password: admin
            color-scheme: white-black
            enable-sftp: 'true'
            sftp-root-directory: '/files/'
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "usermapper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Guacamole,YAML,XML,authentication",
    "author": "",
    "author_email": "Brian Linkletter <mail@brianlinkletter.ca>",
    "download_url": "https://files.pythonhosted.org/packages/93/d2/97bac5a5c2a42f35a12132ed8eaf886de2c08f3136a049ef19688aaf0ea8/usermapper-0.3.tar.gz",
    "platform": null,
    "description": "# Usermapper #\n\nCreate a complex Guacamole manual authentication file, saved as */etc/guacamole/user-mapping.xml*, from a simple confuration file. This is an *opinionated* script designed to support training labs. It assumes every user will have access to the same set of devices in the lab.\n\n## Installation ##\n\nThis is a Python program. Install from Github:\n\n    $ pip install git+https://github.com/blinklet/usermapper.git@v0.3#egg=usermapper\n\n## Usage ##\n\nCreate a configuration file that describes the users and devices in your lab. Then run the usermapper program. To see an example of the configuration file format, look at the *example-config.yaml* file in this repository, or see the next section.\n\nThe usermapper program accepts two optional arguments that allow the user to specify the input file and the output file. See the command syntax below:\n\n    $ python3 -m usermapper [-i <input filename>] [-o <output filename>]\n\nFor example:\n\n    $ python3 -m usermapper -i test.yaml -o /tmp/guac/map.xml\n\nTo use default filenames, where the configuration script is named *config.yaml* and the output file will be named *user-mapping.xml* and both files are in the current directory, run the script without arguments as follows:\n\n    $ python3 -m usermapper\n\n## Configuration file format \n\nThe configuration file is written using the [YAML data file standard](https://rollout.io/blog/yaml-tutorial-everything-you-need-get-started/). The file name must end with the \".yaml\" extension. \n\nThe configuration file consists of two main blocks: a *users* block and a *devices* block. You may have one or more types of users and one or more types of devices. \n\nThe <em>username_suffix</em>, device <em>name_suffix</em>, and device <em>hostname_suffix</em> must be a number with or without leading zeros, enclosed in quotes. We generate names by combining the corresponding name prefix and a different name suffix with a length equal to the length of the suffix string and starting at the number specified in the suffix. \n\nIf a user type's <em>password</em> is \"random\", each user of the same type will be assigned a unique random password. If you specify a specific user password, each user in the same user type will have the same password.\n\nYou may also add additional device parameters from the <a href=\"https://guacamole.apache.org/doc/gug/configuring-guacamole.html\" target=\"_blank\">list of Guacamole configuration parameters</a>.\n\n### Example config file\n\nSee the example below, which specifies *trainers* and *students* user types, and *servers* and *routers* device types:\n\n```\nusers:\n\n    trainers:\n        quantity: 1\n        username_prefix: trainer\n        username_suffix: '01'\n        password: s7T6yxOC100\n\n    students:\n        quantity: 8\n        username_prefix: training\n        username_suffix: '01'\n        password: random\n\ndevices:\n\n    servers:\n        quantity: 11\n        name_prefix: PC\n        name_suffix: '09'\n        hostname_prefix: '10.0.10.'\n        hostname_suffix: '109'\n        parameters:\n            protocol: ssh\n            hostname: ~\n            port: 22\n            username: root\n            password: root\n            color-scheme: white-black\n            enable-sftp: 'true'\n            sftp-root-directory: '/'\n\n    routers:\n        quantity: 4\n        name_prefix: R\n        name_suffix: '01'\n        hostname_prefix: '10.0.10.'\n        hostname_suffix: '1'\n        parameters:\n            protocol: ssh\n            hostname: ~\n            port: 22\n            username: admin\n            password: admin\n            color-scheme: white-black\n            enable-sftp: 'true'\n            sftp-root-directory: '/files/'\n```\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Create a manual authentication file for the Guacamole remote access gateway from a simple configuration file.",
    "version": "0.3",
    "project_urls": {
        "Blog": "https://learningwithcode.com",
        "Repository": "https://github.com/blinklet/usermapper"
    },
    "split_keywords": [
        "guacamole",
        "yaml",
        "xml",
        "authentication"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "569f2351f4223517b686c0c9d2a75826fdc0f00bfa62d3b8cc35976f1aaea875",
                "md5": "0c5c4c2944ce3975ae5af92c6770e039",
                "sha256": "65fa12c6cac8bcec4135d78722396c5a8fb95646991845b30148d3cc0c4d2358"
            },
            "downloads": -1,
            "filename": "usermapper-0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c5c4c2944ce3975ae5af92c6770e039",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 17607,
            "upload_time": "2023-09-17T22:41:19",
            "upload_time_iso_8601": "2023-09-17T22:41:19.058698Z",
            "url": "https://files.pythonhosted.org/packages/56/9f/2351f4223517b686c0c9d2a75826fdc0f00bfa62d3b8cc35976f1aaea875/usermapper-0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93d297bac5a5c2a42f35a12132ed8eaf886de2c08f3136a049ef19688aaf0ea8",
                "md5": "d8019a583247b5cebe61d7e5c4a2c96c",
                "sha256": "6ee2b32825723faa691f264b040512c661f2009f8d075e9ea92fc0ea4738f0d2"
            },
            "downloads": -1,
            "filename": "usermapper-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "d8019a583247b5cebe61d7e5c4a2c96c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 17194,
            "upload_time": "2023-09-17T22:41:20",
            "upload_time_iso_8601": "2023-09-17T22:41:20.967586Z",
            "url": "https://files.pythonhosted.org/packages/93/d2/97bac5a5c2a42f35a12132ed8eaf886de2c08f3136a049ef19688aaf0ea8/usermapper-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-17 22:41:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "blinklet",
    "github_project": "usermapper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "usermapper"
}
        
Elapsed time: 0.12053s