2015-12-13 10:46:24 +00:00
|
|
|
# PowerDNS-Admin
|
|
|
|
PowerDNS Web-GUI - Built by Flask
|
2017-11-02 01:41:26 +00:00
|
|
|
[![Build Status](https://travis-ci.org/thomasDOTde/PowerDNS-Admin.svg?branch=master)](https://travis-ci.org/thomasDOTde/PowerDNS-Admin)
|
2015-12-13 10:46:24 +00:00
|
|
|
|
2015-12-13 11:07:10 +00:00
|
|
|
#### Features:
|
2015-12-13 11:07:59 +00:00
|
|
|
- Multiple domain management
|
2015-12-13 11:07:10 +00:00
|
|
|
- Local / LDAP user authentication
|
2016-06-16 09:02:34 +00:00
|
|
|
- Support Two-factor authentication (TOTP)
|
2017-10-31 22:45:24 +00:00
|
|
|
- Support SAML authentication
|
2017-11-01 21:36:42 +00:00
|
|
|
- Google oauth authentication
|
|
|
|
- Github oauth authentication
|
2015-12-13 11:07:10 +00:00
|
|
|
- User management
|
2016-05-27 06:03:59 +00:00
|
|
|
- User access management based on domain
|
2015-12-13 11:07:10 +00:00
|
|
|
- User activity logging
|
|
|
|
- Dashboard and pdns service statistics
|
2016-06-21 22:22:02 +00:00
|
|
|
- DynDNS 2 protocol support
|
2016-08-19 23:28:59 +00:00
|
|
|
- Edit IPv6 PTRs using IPv6 addresses directly (no more editing of literal addresses!)
|
2015-12-13 11:07:10 +00:00
|
|
|
|
2015-12-13 10:46:24 +00:00
|
|
|
## Setup
|
|
|
|
|
2016-05-27 06:03:59 +00:00
|
|
|
### PowerDNS Version Support:
|
2016-06-08 23:49:50 +00:00
|
|
|
PowerDNS-Admin supports PowerDNS autoritative server versions **3.4.2** and higher.
|
2016-05-27 06:03:59 +00:00
|
|
|
|
2015-12-13 10:46:24 +00:00
|
|
|
### pdns Service
|
|
|
|
I assume that you have already installed powerdns service. Make sure that your `/etc/pdns/pdns.conf` has these contents
|
2016-06-08 23:49:50 +00:00
|
|
|
|
|
|
|
PowerDNS 4.0.0 and later
|
|
|
|
```
|
|
|
|
api=yes
|
|
|
|
api-key=your-powerdns-api-key
|
|
|
|
webserver=yes
|
|
|
|
```
|
|
|
|
|
|
|
|
PowerDNS before 4.0.0
|
2015-12-13 10:46:24 +00:00
|
|
|
```
|
|
|
|
experimental-json-interface=yes
|
|
|
|
experimental-api-key=your-powerdns-api-key
|
|
|
|
webserver=yes
|
|
|
|
```
|
2016-06-08 23:49:50 +00:00
|
|
|
|
|
|
|
This will enable API access in PowerDNS so PowerDNS-Admin can intergrate with PowerDNS.
|
2015-12-13 10:46:24 +00:00
|
|
|
|
|
|
|
### Create Database
|
|
|
|
We will create a database which used by this web application. Please note that this database is difference from pdns database itself.
|
2016-08-12 08:15:38 +00:00
|
|
|
|
|
|
|
You could use any database that SQLAlchemy supports. For example MySQL (you will need to `pip install MySQL-python` to use MySQL backend):
|
2015-12-13 10:46:24 +00:00
|
|
|
```
|
|
|
|
MariaDB [(none)]> CREATE DATABASE powerdnsadmin;
|
|
|
|
|
2016-02-14 06:51:42 +00:00
|
|
|
MariaDB [(none)]> GRANT ALL PRIVILEGES ON powerdnsadmin.* TO powerdnsadmin@'%' IDENTIFIED BY 'your-password';
|
2015-12-13 10:46:24 +00:00
|
|
|
```
|
2016-08-12 08:15:38 +00:00
|
|
|
For testing purpose, you could also use SQLite as backend. This way you do not have to install `MySQL-python` dependency.
|
|
|
|
|
2015-12-13 10:46:24 +00:00
|
|
|
|
|
|
|
### PowerDNS-Admin
|
|
|
|
|
2016-05-27 06:03:59 +00:00
|
|
|
In this installation guide, I am using CentOS 7 and run my python stuffs with *virtualenv*. If you don't have it, lets install it:
|
2015-12-13 10:46:24 +00:00
|
|
|
```
|
|
|
|
$ sudo yum install python-pip
|
|
|
|
$ sudo pip install virtualenv
|
|
|
|
```
|
|
|
|
|
|
|
|
In your python web app directory, create a `flask` directory via `virtualenv`
|
|
|
|
```
|
|
|
|
$ virtualenv flask
|
|
|
|
```
|
|
|
|
|
|
|
|
Enable virtualenv and install python 3rd libraries
|
|
|
|
```
|
|
|
|
$ source ./flask/bin/activate
|
|
|
|
(flask)$ pip install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
Web application configuration is stored in `config.py` file. Let's clone it from `config_template.py` file and then edit it
|
|
|
|
```
|
2016-04-13 16:11:10 +00:00
|
|
|
(flask)$ cp config_template.py config.py
|
2015-12-13 10:46:24 +00:00
|
|
|
(flask)$ vim config.py
|
|
|
|
```
|
|
|
|
|
|
|
|
Create database after having proper configs
|
2015-12-13 11:10:10 +00:00
|
|
|
```
|
2016-05-27 06:03:59 +00:00
|
|
|
(flask)% ./create_db.py
|
2015-12-13 11:10:10 +00:00
|
|
|
```
|
2015-12-13 10:46:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
Run the application and enjoy!
|
|
|
|
```
|
|
|
|
(flask)$ ./run.py
|
|
|
|
```
|
2015-12-13 10:58:26 +00:00
|
|
|
|
2017-10-31 22:45:24 +00:00
|
|
|
### SAML Authentication
|
2017-11-01 21:36:42 +00:00
|
|
|
SAML authentication is supported. Setting are retrieved from Metdata-XML.
|
|
|
|
Metadata URL is configured in config.py as well as caching interval.
|
2017-10-31 22:45:24 +00:00
|
|
|
Following Assertions are supported and used by this application:
|
|
|
|
- nameidentifier in form of email address as user login
|
|
|
|
- email used as user email address
|
|
|
|
- givenname used as firstname
|
|
|
|
- surname used as lastname
|
|
|
|
|
|
|
|
### ADFS claim rules as example
|
|
|
|
Microsoft Active Directory Federation Services can be used as Identity Provider for SAML login.
|
|
|
|
The Following rules should be configured to send all attribute information to PowerDNS-Admin.
|
|
|
|
The nameidentifier should be something stable from the idp side. All other attributes are update when singing in.
|
|
|
|
|
|
|
|
#### sending the nameidentifier
|
|
|
|
Name-Identifiers Type is "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
|
|
|
|
```
|
|
|
|
c:[Type == "<here goes your source claim>"]
|
|
|
|
=> issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
|
|
|
|
```
|
|
|
|
|
|
|
|
#### sending the firstname
|
|
|
|
Name-Identifiers Type is "givenname"
|
|
|
|
```
|
|
|
|
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"]
|
|
|
|
=> issue(Type = "givenname", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:transient");
|
|
|
|
```
|
|
|
|
|
|
|
|
#### sending the lastname
|
|
|
|
Name-Identifiers Type is "surname"
|
|
|
|
```
|
|
|
|
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"]
|
|
|
|
=> issue(Type = "surname", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:transient");
|
|
|
|
```
|
|
|
|
|
|
|
|
#### sending the email
|
|
|
|
Name-Identifiers Type is "email"
|
|
|
|
```
|
|
|
|
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
|
|
|
|
=> issue(Type = "email", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
|
|
|
|
```
|
|
|
|
|
2016-05-14 01:42:39 +00:00
|
|
|
### Screenshots
|
|
|
|
![login page](https://github.com/ngoduykhanh/PowerDNS-Admin/wiki/images/readme_screenshots/fullscreen-login.png?raw=true)
|
|
|
|
![dashboard](https://github.com/ngoduykhanh/PowerDNS-Admin/wiki/images/readme_screenshots/fullscreen-dashboard.png?raw=true)
|
|
|
|
![create domain page](https://github.com/ngoduykhanh/PowerDNS-Admin/wiki/images/readme_screenshots/fullscreen-domaincreate.png?raw=true)
|
|
|
|
![manage domain page](https://github.com/ngoduykhanh/PowerDNS-Admin/wiki/images/readme_screenshots/fullscreen-domainmanage.png?raw=true)
|
2016-06-16 09:02:34 +00:00
|
|
|
![two-factor authentication config](https://cloud.githubusercontent.com/assets/6447444/16111111/467f2226-33db-11e6-926a-01b4d15035d2.png)
|
2016-05-14 01:42:39 +00:00
|
|
|
|