Skip to content
Arthur Poulet edited this page Sep 20, 2017 · 2 revisions
Authentication service over TCP
Network Working Group A. Poulet
Internet-Draft University of Kent
Intended status: Informational August 11, 2017
Expires: February 12, 2018

Authentication service over TCP
auth-service

This standard aims to create a modern, secure and simple user authentication, management, and verification of her permissions on arbitrary resources in an organisation.

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on February 12, 2018.

Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

In this document, the key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” are to be interpreted as described in BCP 14, RFC 2119 [RFC2119].

  • client: A TCP endpoint that MUST connect to the Auth service.
  • server: A TCP endpoint that MUST receive connection from clients.
  • secure client: A client connected using SSL.
  • secure server: A server using SSL.
  • query: Messages sent to the server by the client.
  • reply: Messages returned after a query from the server to the client.

Nowadays, it is very common to require an authentication system to develop a software. It allows the software to identify users, authorize them to do some actions, and log it. It is a critical security issue because any error in the authentication policy or implementation costs money, trust, and privacy. Furthermore, it is very interesting for some parties to have a centralized authentication system shared for several services.

The goal of the Auth service is to provide a clear, secure, and simple authentication interface and authorization manager. It is implemented with a TCP server that SHOULD provide a SSL connection, on which a user must be able to authenticate, and request access to a resource.

The Auth service does not intend to replace security check on the services that use it. It is an annular similar to the LDAP services, but using a much simpler query language and installation.

The Auth service provides two mains features: The authentication of user and the permissions management of the resources, based on the access of a user.

The users SHOULD BE identified using a couple username and password. They MUST also belong to groups. Those groups MUST have a list of permissions. A permission MUST be a couple of resource and right.

Queries MUST follow the grammar defined bellow:

WORD_ANY     = <any alphanumeric ASCII character> / "_" / "-"
WORD         = WORD_ANY WORD_ANY *
ANY          = <any unicode character>
ANY_STR      = ANY ANY *
SPACE        = <ASCII SP, space>

OPTION       = WORD "=" WORD
PARAMETERS   = ( WORD SPACE ) * ( ANY_STR ) ?
QUERY_WORDS  = ( OPTION ) * WORD SPACE ( WORD SPACE / OPTION ) *
QUERY        = QUERY_WORDS ( ":" PARAMETERS ) ?

JSON         = <Json object, defined in RFC7159> / "\"" ANY_STR "\""
SUCCESS      = "success"
FAILURE      = "failure"
SUCCESS_DATA = ( SPACE JSON ) ?
FAILURE_DATA = ( SPACE ANY * ) ?
REPLY        = ( SUCCESS SUCCESS_DATA / FAILURE FAILURE_DATA )

There are some special characters that MUST have a special behaviour in the server:

  • \*: it MUST match with “any string”. It is for the query USER HAS ACCESS TO and USER GET PERM. Example: if a path /public* is defined, USER HAS ACCESS TO : user /public/any must matches.
  • $: it MUST match with “any word”, with the same behaviour than \*
  • ~: it MUST be replaced with the username of the current authenticated user when matching queries. Example: /public/~/\* for the user “root” is equal to /public/root/\*.
  • \a: it SHOULD be replaced with the username of the current authenticated user when writing the query.

There are 3 mains types of query: AUTH, USER, GROUP. They begin with the associated word. Other queries MAY be added to extend the language but they MUST NOT begin with AUTH, USER, or GROUP.

If the query fails, a string that describes the problem MAY also be added. There is 3 reasons of failures:

  1. The client is not connected (no AUTH query has been successful)
  2. The query contains an error (missing : for example)
  3. The query returns a boolean “success” or “failure”

If the query returns a success, it is sometimes followed by a Json object, for the read operations (such as USER LIST, etc.).

In the replies, we only handle success data and boolean replies. Failure MAY occurs in any reply for the same reasons.

There are 3 replies possible:

  1. Boolean: either “success” or “failure”. A failure MAY not be an error of syntax or connection.
  2. None: “success” or “failure”. A failure MUST be an error of syntax or connection.
  3. Specified: other replies MAY be a failure (like None) but the “success” reply is followed by more data.

Query: AUTH

Parameters: <username> <password>

Replies: Boolean

Example: AUTH : root toor

Query: USER HAS ACCESS TO

Parameters: <username> <perm> <resource>

Replies: Boolean

Example: USER HAS ACCESS TO : root write https://url/some/path

Query: GROUP ADD

Parameters: <group> <perm> <resource>

Replies: None

Example: GROUP ADD : guest read /public*

Query: GROUP REMOVE

Parameters: <group>

Replies: None

Example: GROUP REMOVE : guest

Query: GROUP LIST

Replies: an array of groups, quoted success ["root", "admin"]

Example: `GROUP LIST

Query: GROUP LIST PERMS

Parameters: <group>

Replies: an associated array of resources and rights success {"/private" => "write", "/public" => "read"}

Example: GROUP LIST PERMS : guest

Query: GROUP GET PERM

Parameters: <group> <resource>

Reply: a right (permission value) quoted success "write"

Example: GROUP GET PERM : guest /public/some

Example: GROUP GET PERM : guest /private/some

Query: USER LIST

Replies: an array of users, quoted success ["root", "guest"]

Example: USER LIST

Query: USER ADD

Parameters: <username> <password>

Replies: None

Example: USER ADD : guestuser guestpassword

Query: USER REMOVE

Parameters: <username>

Replies: None

Example: USER REMOVE guestuser

Query: USER ADD GROUP

Parameters: <username> <group>

Replies: None

Example: USER ADD GROUP : guestuser guest

Query: USER REMOVE GROUP

Parameters: <username> <group>

Replies: None

Example: USER REMOVE GROUP : guestuser guest

Query: USER LIST GROUP

Parameters: <username>

Replies: an array of groups, quoted success ["root", "admin"]

Example: USER LIST GROUP : guestuser

Query: USER CHANGE PASSWORD

Parameters: <username> <newpassword>

Replies: None

Example: USER CHANGE PASSWORD : guest newguestpassword

Any connected user can send queries to the server, which MUST respond with “success” or “failure”. It might be a “failure” because the user might not have the correct rights on the server.

When the server receive a query from a connected user, it MUST verify if the user has access to this query.

We RECOMMEND to manage the permissions by verifying that the user has access to the resource equal to the query with “write”. Thus the server whould execute a operation very similar to “USER AS ACCESS TO : connected_user_name QUERY”.

4. References

4.1. Normative References

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.

4.2. Informative References

[RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 2014.
Arthur Poulet Poulet University of Kent EMail: [email protected]