Network Working Group A. Poulet
Internet-Draft University of Kent
Intended status: Informational September 25, 2017
Expires: March 29, 2018

Authentication service over TCP
credid

Abstract

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

Status of This Memo

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 March 29, 2018.

Copyright Notice

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.

1. Introduction

1.1. Terminology

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].

1.2. Goals

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 Credid protocol and services 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 Credid 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.

1.3. Services

The Credid service provides several features:

1.3.1. Authentication

The users MUST BE identified using a couple username and password. The only operation that can be done by an unauthenticated client SHOULD be to authenticate himself to the server as a valid user. Other ways to by identified COULD be added (such as biometrics, etc.) based on the level of security required by the system. Several identification’s ways COULD be combined togethers to improve the level of security.

1.3.2. Group based attributions

Users CAN be affected to one or several groups. An user SHOULD NOT be affected twice to the same group.

1.3.3. Permissions management

The groups MUST have a list of permissions. A permission MUST be a couple of resource (path or command for example) and right (write or read for example).

2. Protocol Overview

2.1. Message exchanges

A client MUST send a query to the server. The server MUST always respond with a reply. The server MUST NOT send messages to the client except to reply. The server CAN use another communication channel to send non-reply messages to the client.

2.2. Syntax of the queries

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 )

2.2.1. Special characters

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

2.2.2. Options

Some queries can be parametrized via OPTIONS. Options are defined by a couple KEY=VALUE. The key defines which option is concerned, and the value which value it must take.

2.2.2.1. COUNT

The option COUNT defines an amount of data to retreive. The value of this option is a unsigned 64 bits number.

Example: USER LIST COUNT=1 to retreive one user maximum.

2.2.2.2. PAGE

The option PAGE defines an offset of data. It is multiplicated with the option COUNT to find the first data to retreive. The value of this operation is a unsigned 64 bits number.

Example: USER LIST PAGE=2 COUNT=10 to retreive maximum 10 users, beginning from the 21th.

2.3. Queries

2.3.1. Type of queries

There are 3 types of query defined in this standard: 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 (they are reserved).

2.3.2. Replies

The replies contain the word “success” or “failure”, and MAY be followed by a json data.

There are 3 types 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.

2.3.3. Failure

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

  1. The client is not connected (no previous AUTH or AUTH TOKEN query has been successful or the user has been disconnected for some reasons).
  2. The query contains an error (missing : for example).
  3. The client does not have the right permissions to execute the query.

2.3.4. Success

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

2.3.5. Queries descriptions

Parameters CAN be optional or mandatory. Optional parameters are written <param>. Mandatory parameters are written [param].

2.3.5.1. AUTH

Query: AUTH

Parameters: <username> <password>

Replies: Boolean

Example: AUTH : root toor

Description: Authenticate the user based on his username and his secret (password).

2.3.5.2. AUTH TOKEN

Query: AUTH TOKEN

Parameters: <username> <token>

Replies: Boolean

Example: AUTH TOKEN : root 0123456789abcdef

Description: Authenticate the user based on his username and a temporary secret generated by the server.

2.3.5.3. GEN TOKEN

Query: GEN TOKEN

Parameters: None

Replies: String

Example: GEN TOKEN

Description: Generate a temporary secret that can be used by the user to authenticate. It erase any older token (that are no longer usable). It doesn’t disconnect the connected users. It is useful to avoid to use a high cost hashing function to protect the password. We RECOMMAND to make it valid for 10 minutes, but it depends on the security level required.

2.3.5.4. USER HAS ACCESS TO

Query: USER HAS ACCESS TO

Parameters: <username> <perm> <resource>

Replies: Boolean

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

2.3.5.5. GROUP ADD

Query: GROUP ADD

Parameters: <group> [perm] [resource]

Replies: None

Description: Create a group, and/or add the resource to an existing group.

Example: GROUP ADD : guest

Example: GROUP ADD : guest read /public*

2.3.5.6. GROUP REMOVE

Query: GROUP REMOVE

Parameters: <group> [resource]

Replies: None

Description: It MUST delete all permissions of a group on a given resource or the one specified. A group with no permissions SHOULD NOT exist (nor any relation with such group).

Example: GROUP REMOVE : guest

Example: GROUP REMOVE : guest *

2.3.5.7. GROUP LIST

Query: GROUP LIST

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

Example: `GROUP LIST

2.3.5.8. GROUP LIST PERMS

Query: GROUP LIST PERMS

Parameters: <group>

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

Example: GROUP LIST PERMS : guest

2.3.5.9. GROUP GET PERM

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

2.3.5.10. USER LIST

Query: USER LIST

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

Example: USER LIST

2.3.5.11. USER ADD

Query: USER ADD

Parameters: <username> <password>

Replies: None

Example: USER ADD : guestuser guestpassword

2.3.5.12. USER REMOVE

Query: USER REMOVE

Parameters: <username>

Replies: None

Description: Removes permanently an user from the server. It MUST disconnect the client using the deleted user for security reason.

Example: USER REMOVE guestuser

2.3.5.13. USER ADD GROUP

Query: USER ADD GROUP

Parameters: <username> <group>

Replies: None

Example: USER ADD GROUP : guestuser guest

2.3.5.14. USER REMOVE GROUP

Query: USER REMOVE GROUP

Parameters: <username> <group>

Replies: None

Example: USER REMOVE GROUP : guestuser guest

2.3.5.15. USER LIST GROUPS

Query: USER LIST GROUPS

Parameters: <username>

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

Example: USER LIST GROUPS : guestuser

2.3.5.16. USER CHANGE PASSWORD

Query: USER CHANGE PASSWORD

Parameters: <username> <newpassword>

Replies: None

Description: Change the password of a user. It SHOULD disconnect the client using the updated user for security reason.

Example: USER CHANGE PASSWORD : guest newguestpassword

3. Permissions

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. Logs

For security reasons, any query/reply status SHOULD BE logged by the server. The format of the logs is not defined in this RFC. A text version of the logs SHOULD BE provided. A binary version of the logs COULD be provided.

5. References

5.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.

5.2. Informative References

[RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 2014.

Author's Address

Arthur Poulet University of Kent EMail: agp8@kent.ac.uk

Table of Contents