Git Product home page Git Product logo

desec-stack's People

Contributors

akararsse avatar danielquinn avatar dependabot[bot] avatar eisfunke avatar fabricionaweb avatar gustl22 avatar hcc23 avatar i0nas avatar jahway603 avatar jameskimmel avatar jsoref avatar knight1 avatar lukaslihotzki avatar lulis avatar mainboarder avatar nils-wisiol avatar peterthomassen avatar rotzbua avatar unuseless avatar vestingz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desec-stack's Issues

Security Headers (CORS, CSP)

We currently do not allow any cross origin requests on the API, although that may be an important use-case. Implementing such requests however appears to be quite painful, as we must support OPTIONS requests properly to cover CORS preflight requests.

api: implement domain creation policy

  • users who signed up online can create zones under dedyn.io only
  • manually created users can create arbitrary zones

Checklist:

  • implementation
  • unit tests
  • docs

api: lowercase domain names upon creation

Per RFC 4343, Section 4, case can be changed at input, and per Section 6, it is more or less recommended to do so. This allows us to deal with uniqueness constraints more easily.

If possible, allow users to see their preferred spelling.

Captcha

Require solving a captcha to register a new user.

Blacklisting of public and already registered suffixes

Currently, subzone ("more specific zones") can only be created if 1) we do not know the parent zone, or 2) the parent zone is owned by the same user. Otherwise, malicious users could hijack subzones from other users.

This can be improved by

  1. integrating the public suffix list. Currently, if someone creates co.uk, other users cannot create their zone under co.uk.
  2. Allow cross-user delegations by checking the NS records in the parent domain (with proper subdomain) (or by checking some other setting of the parent domain) -- not required for launch

refactor unit tests

As of now, some unit tests in the api depend on the availability of the pdns API. This should not be the case, all requsts should be intercepted and answered independently of pdns.

Update to PowerDNS 4.1

  • MySQL schema migrations, closes #65
  • Use pdns REST API for DNSSEC management and get rid of nslord cronjob

@nils-wisiol How do we best apply schema changes on dblord and dbmaster? This is outside Django's migration framework, and I cannot think of something better than the manual approach right now.

api: improve handling of malformed update IP addresses

Currently, the API accepts malformed strings for IPs in the update request, which causes the pdns API to error, which in turn causes an internal server error.

Input IP addresses should be checked for correct syntax before sending them to pdns, however the API should also be able to deal with error returned from the pdns API.

Create endpoint for atomic multi-updates

The API should have an endpoint that accepts updates to several RR sets that are applied atomic.

After implementation, the existing rrset endpoint and dyndns12 endpoint can be special cases of this new endpoint.

Per discussion with @peterthomassen, this new view shall be responsible for organizing correct order of "select for update", "update or create", and so on, removing this code from the models layer.

add API versioning in REST URLs

currently, the API is available under /api/. It should be available under /api/v1/ to allow for future incompatible changes under v2/.

Improve API error status codes

When an error occurs, the API would ideally return a meaningful status code. However, in many cases the API simply returns 500 (e.g. when the IP address from the query string cannot be processed by pdns, we get 422 from pdns and still return 500 to the client).

double-check pdny.py:zone_exists()

Exception caught when trying to unlock account (reason unknown):

File "./desecapi/views.py" in unlock
316.                 User.objects.get(email=email).unlock()

File "./desecapi/models.py" in unlock
89.             domain.pdns_resync()

File "./desecapi/models.py" in pdns_resync
109.         if not pdns.zone_exists(self.name):

File "./desecapi/pdns.py" in zone_exists
88.     return _pdns_get('/zones/' + normalize_hostname(name)).status_code != 404

File "./desecapi/pdns.py" in _pdns_get
35.         raise Exception(r.text)

Exception Type: Exception at /api/v1/unlock/user/XXXX
Exception Value: {"error": "Could not find domain 'XXXX.dedyn.io.'"}

introduce restart policy

Currently, crashed services won't be restarted. A restart policy should be added to docker-compose.yml.

www: SSL Labs for desec.io at A-

desec.io scores A- in the SSL Labs audit because Forward Secrecy is not supported with some reference browsers. It would be nice to fix this.

Add subdomains with dynamic subnets to *.dedyn.io domains

Currently, users can update there IPv4 and IPv6 addresses for their domain.dedyn.io. IPv6 users, however, often control a dynamic subnet and may want to run services on various IP addresses within this subnet.

It would be nice to allow users to create subdomains with static "local IP bits", only updating the subnet through our update mechanism. The user would have to specify the subnet size (e.g. /80), and upon IP update, only the first 80 bits of the AAAA records would be updated.

dyn update: identifying the domain that needs updating by username is broken

When updating dyn DNS IP addresses, desec does not recognize the domain that needs updating by the provided username. (However, authentication works!)

In most cases this is not a problem, as some other mechanism for identification of the domain kicks in (for most users, their only domain gets updated as last resort).

This bug stops updating of dyn DNS domains if the following conditions are met:

  1. the user as more than one domain
  2. the user uses domainname:authtoken HTTP Basic authentication
  3. the user does not provide the domain name in the query parameters

In this case,

return base64.b64decode(get_authorization_header(request).split(' ')[1]).split(':')[0]
is reached, but the code is broken since the update to python3. Any exception will be caught and the domain name will silently be empty, causing the user to receive 404.

There is no unit test for this scenario; exceptions get caught by the 'catch all' construct. Both should be avoided in the future.

update Dockerfiles to use more recent images

Some of our containers don't use the most up-to-date base images (e.g., the nameserver containers use Debian jessie, not stretch). This is not a problem at the moment, but updating to more recent versions will help avoid running into using eventually unsupported software.

Updating IP Address Immediately After Zone Creation Fails

Setting the arecord field on a domain immediately after it's creation fails and causes a 500 server error.

Steps to reproduce (bash):

export [email protected]
export DESEC_PASSWORD=123password
export DESEC_DOMAIN=baz.dedyn.io

http POST https://desec.nils.dedyn.io/api/v1/auth/register/ email:=\"${DESEC_USERNAME}\" password:=\"${DESEC_PASSWORD}\"
export DESEC_AUTH=$(http POST https://desec.nils.dedyn.io/api/v1/auth/login/ email:=\"${DESEC_USERNAME}\" password:=\"${DESEC_PASSWORD}\" | grep auth_token | egrep -o [a-z0-9]{40})
http POST https://desec.nils.dedyn.io/api/v1/domains/ Authorization:"Token ${DESEC_AUTH}" name:=\"${DESEC_DOMAIN}\"
http PATCH https://desec.nils.dedyn.io/api/v1/domains/${DESEC_DOMAIN}/ Authorization:"Token ${DESEC_AUTH}" arecord:=\"127.1.1.1\"

The reason appears to be that this request is made without pdns already having a SOA record for the domain (pdns reply: {"error": "No SOA found for domain 'baz.dedyn.io.'"}).

I cannot pinpoint where exactly the SOA record is added later (any idea, @peterthomassen?); it appears to have something to do with the cron job.

The error will cause any update to be lost (as would be expected by the client); however with the next non-erroring POST to that domain any previous error will be recovered, so in many cases this is not an urgent problem.

get rid of api-settings.py

Currently, deploying desec-stack requires setting up a customized api-settings.py file. That's unnecessary as all relevant settings can be controlled from the .env file. We therefore should get rid of api-settings.py.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.