draft-ietf-ldapbis-filter-05.txt   draft-ietf-ldapbis-filter-06.txt 
Network Working Group M. Smith, Editor Network Working Group M. Smith, Editor
Request for Comments: DRAFT Netscape Communications Corp. Request for Comments: DRAFT Pearl Crescent, LLC
Obsoletes: RFC 2254 T. Howes Obsoletes: RFC 2254 T. Howes
Expires: 25 April 2004 Opsware, Inc. Expires: 13 August 2004 Opsware, Inc.
25 October 2003 13 February 2004
LDAP: String Representation of Search Filters LDAP: String Representation of Search Filters
<draft-ietf-ldapbis-filter-05.txt> <draft-ietf-ldapbis-filter-06.txt>
1. Status of this Memo 1. Status of this Memo
This document is an Internet-Draft and is subject to all provisions This document is an Internet-Draft and is subject to all provisions
of Section 10 of RFC2026. of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
skipping to change at page 1, line 37 skipping to change at page 1, line 37
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/1id-abstracts.html http://www.ietf.org/1id-abstracts.html
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html http://www.ietf.org/shadow.html
Discussion of this document should take place on the LDAP (v3) Discussion of this document should take place on the LDAP (v3)
Revision (ldapbis) Working Group mailing list <ietf- Revision (ldapbis) Working Group mailing list <ietf-
ldapbis@openldap.org>. ldapbis@openldap.org>.
Copyright (C) The Internet Society (2003). All Rights Reserved. Copyright (C) The Internet Society (2004). All Rights Reserved.
2. Abstract 2. Abstract
LDAP search filters are transmitted in the LDAP protocol using a LDAP search filters are transmitted in the LDAP protocol using a
binary representation that is appropriate for use on the network. binary representation that is appropriate for use on the network.
This document defines a human-readable string representation of LDAP This document defines a human-readable string representation of LDAP
search filters that is appropriate for use in LDAP URLs and in other search filters that is appropriate for use in LDAP URLs and in other
applications. applications.
3. Table of Contents 3. Table of Contents
skipping to change at page 2, line 19 skipping to change at page 2, line 19
3. Table of Contents..............................................2 3. Table of Contents..............................................2
4. Introduction...................................................2 4. Introduction...................................................2
5. LDAP Search Filter Definition..................................2 5. LDAP Search Filter Definition..................................2
6. String Search Filter Definition................................4 6. String Search Filter Definition................................4
7. Examples.......................................................5 7. Examples.......................................................5
8. Security Considerations........................................7 8. Security Considerations........................................7
9. Normative References...........................................7 9. Normative References...........................................7
10. Informative References.........................................8 10. Informative References.........................................8
11. Intellectual Property Rights...................................8 11. Intellectual Property Rights...................................8
12. Acknowledgments................................................8 12. Acknowledgments................................................8
13. Authors' Address...............................................8 13. Authors' Addresses.............................................9
14. Full Copyright Statement.......................................9 14. Full Copyright Statement.......................................9
15. Appendix A: Changes Since RFC 2254.............................9 15. Appendix A: Changes Since RFC 2254.............................10
15.1. Technical Changes...........................................10 15.1. Technical Changes...........................................10
15.2. Editorial Changes...........................................10 15.2. Editorial Changes...........................................10
16. Appendix B: Changes Since Previous Document Revision...........11 16. Appendix B: Changes Since Previous Document Revision...........11
16.1. Technical Changes...........................................12 16.1. Technical Changes...........................................12
16.2. Editorial Changes...........................................12 16.2. Editorial Changes...........................................12
4. Introduction 4. Introduction
The Lightweight Directory Access Protocol (LDAP) [Protocol] defines a The Lightweight Directory Access Protocol (LDAP) [Protocol] defines a
network representation of a search filter transmitted to an LDAP network representation of a search filter transmitted to an LDAP
skipping to change at page 3, line 6 skipping to change at page 3, line 6
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in BCP 14 [RFC2119]. document are to be interpreted as described in BCP 14 [RFC2119].
5. LDAP Search Filter Definition 5. LDAP Search Filter Definition
An LDAPv3 search filter is defined in Section 4.5.1 of [Protocol] as An LDAPv3 search filter is defined in Section 4.5.1 of [Protocol] as
follows: follows:
Filter ::= CHOICE { Filter ::= CHOICE {
and [0] SET SIZE (1..MAX) OF Filter, and [0] SET SIZE (1..MAX) OF filter Filter,
or [1] SET SIZE (1..MAX) OF Filter, or [1] SET SIZE (1..MAX) OF filter Filter,
not [2] Filter, not [2] Filter,
equalityMatch [3] AttributeValueAssertion, equalityMatch [3] AttributeValueAssertion,
substrings [4] SubstringFilter, substrings [4] SubstringFilter,
greaterOrEqual [5] AttributeValueAssertion, greaterOrEqual [5] AttributeValueAssertion,
lessOrEqual [6] AttributeValueAssertion, lessOrEqual [6] AttributeValueAssertion,
present [7] AttributeDescription, present [7] AttributeDescription,
approxMatch [8] AttributeValueAssertion, approxMatch [8] AttributeValueAssertion,
extensibleMatch [9] MatchingRuleAssertion } extensibleMatch [9] MatchingRuleAssertion }
SubstringFilter ::= SEQUENCE { SubstringFilter ::= SEQUENCE {
type AttributeDescription, type AttributeDescription,
-- at least one must be present,
-- initial and final can occur at most once -- initial and final can occur at most once
substrings SEQUENCE OF CHOICE { substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE {
initial [0] AssertionValue, initial [0] AssertionValue,
any [1] AssertionValue, any [1] AssertionValue,
final [2] AssertionValue } } final [2] AssertionValue } }
AttributeValueAssertion ::= SEQUENCE { AttributeValueAssertion ::= SEQUENCE {
attributeDesc AttributeDescription, attributeDesc AttributeDescription,
assertionValue AssertionValue } assertionValue AssertionValue }
MatchingRuleAssertion ::= SEQUENCE { MatchingRuleAssertion ::= SEQUENCE {
matchingRule [1] MatchingRuleId OPTIONAL, matchingRule [1] MatchingRuleId OPTIONAL,
type [2] AttributeDescription OPTIONAL, type [2] AttributeDescription OPTIONAL,
matchValue [3] AssertionValue, matchValue [3] AssertionValue,
dnAttributes [4] BOOLEAN DEFAULT FALSE } dnAttributes [4] BOOLEAN DEFAULT FALSE }
AttributeDescription ::= LDAPString AttributeDescription ::= LDAPString
-- Constrained to attributedescription -- Constrained to <attributedescription>
-- [Models] -- [Models]
AttributeValue ::= OCTET STRING AttributeValue ::= OCTET STRING
MatchingRuleId ::= LDAPString MatchingRuleId ::= LDAPString
AssertionValue ::= OCTET STRING AssertionValue ::= OCTET STRING
LDAPString ::= OCTET STRING -- UTF-8 encoded, LDAPString ::= OCTET STRING -- UTF-8 encoded,
-- ISO 10646 characters -- [ISO10646] characters
where the LDAPString above is limited to the UTF-8 encoding [UTF-8] The AttributeDescription is a string representation of the attribute
of the ISO 10646 character set [ISO10646]. The AttributeDescription description and is defined in [Protocol]. The AttributeValue and
is a string representation of the attribute description and is AssertionValue OCTET STRING have the form defined in [Syntaxes]. The
defined in [Protocol]. The AttributeValue and AssertionValue OCTET Filter is encoded for transmission over a network using the Basic
STRING have the form defined in [Syntaxes]. The Filter is encoded Encoding Rules defined in [X.690], with simplifications described in
for transmission over a network using the Basic Encoding Rules [Protocol].
defined in [ASN.1], with simplifications described in [Protocol].
6. String Search Filter Definition 6. String Search Filter Definition
The string representation of an LDAP search filter is a string of The string representation of an LDAP search filter is a string of
UTF-8 encoded ISO 10646-1 characters that is defined by the following UTF-8[RFC3629] encoded ISO 10646-1 characters that is defined by the
grammar, following the ABNF notation defined in [RFC2234]. The following grammar, following the ABNF notation defined in [RFC2234].
productions used that are not defined here are defined in section 1.3 The productions used that are not defined here are defined in section
(Common ABNF Productions) of [Models] unless otherwise noted. The 1.4 (Common ABNF Productions) of [Models] unless otherwise noted.
filter format uses a prefix notation. The filter format uses a prefix notation.
filter = LPAREN filtercomp RPAREN filter = LPAREN filtercomp RPAREN
filtercomp = and / or / not / item filtercomp = and / or / not / item
and = AMPERSAND filterlist and = AMPERSAND filterlist
or = VERTBAR filterlist or = VERTBAR filterlist
not = EXCLAMATION filter not = EXCLAMATION filter
filterlist = 1*filter filterlist = 1*filter
item = simple / present / substring / extensible item = simple / present / substring / extensible
simple = attr filtertype assertionvalue simple = attr filtertype assertionvalue
filtertype = equal / approx / greater / less filtertype = equal / approx / greater / less
skipping to change at page 5, line 40 skipping to change at page 5, line 37
the character to be escaped is replaced by a backslash and two hex the character to be escaped is replaced by a backslash and two hex
digits, which form a single octet in the code of the character. digits, which form a single octet in the code of the character.
For example, the filter checking whether the "cn" attribute contained For example, the filter checking whether the "cn" attribute contained
a value with the character "*" anywhere in it would be represented as a value with the character "*" anywhere in it would be represented as
"(cn=*\2a*)". "(cn=*\2a*)".
As indicated by the valueencoding rule, implementations MUST escape As indicated by the valueencoding rule, implementations MUST escape
all octets greater than 0x7F that are not part of a valid UTF-8 all octets greater than 0x7F that are not part of a valid UTF-8
encoding sequence when they generate a string representation of a encoding sequence when they generate a string representation of a
search filter. Implementations SHOULD accept as input a string that search filter. Implementations SHOULD accept as input strings that
includes invalid UTF-8 octet sequences. This is necessary because RFC are not valid UTF-8 strings. This is necessary because RFC 2254 did
2254 did not clearly define the term "string representation" (and in not clearly define the term "string representation" (and in
particular did not mention that the string representation of an LDAP particular did not mention that the string representation of an LDAP
search filter is a string of UTF-8 encoded ISO 10646-1 characters). search filter is a string of UTF-8 encoded ISO 10646-1 characters).
7. Examples 7. Examples
This section gives a few examples of search filters written using This section gives a few examples of search filters written using
this notation. this notation.
(cn=Babs Jensen) (cn=Babs Jensen)
(!(cn=Tim Howes)) (!(cn=Tim Howes))
skipping to change at page 6, line 23 skipping to change at page 6, line 21
(sn:dn:2.4.6.8.10:=Barney Rubble) (sn:dn:2.4.6.8.10:=Barney Rubble)
(o:dn:=Ace Industry) (o:dn:=Ace Industry)
(:1.2.3:=Wilma Flintstone) (:1.2.3:=Wilma Flintstone)
(:dn:2.4.6.8.10:=Dino) (:dn:2.4.6.8.10:=Dino)
The first example shows use of the matching rule "1.2.3.4.5". The first example shows use of the matching rule "1.2.3.4.5".
The second example demonstrates use of a MatchingRuleAssertion form The second example demonstrates use of a MatchingRuleAssertion form
without a matchingRule. without a matchingRule.
The third example illustrates the use of the ":dn" notation to The third example illustrates the use of the ":oid" notation to
indicate that matching rule "2.4.6.8.10" should be used when making indicate that matching rule "2.4.6.8.10" should be used when making
comparisons, and that the attributes of an entry's distinguished name comparisons, and that the attributes of an entry's distinguished name
should be considered part of the entry when evaluating the match. should be considered part of the entry when evaluating the match
(indicated by the use of ":dn").
The fourth example denotes an equality match, except that DN The fourth example denotes an equality match, except that DN
components should be considered part of the entry when doing the components should be considered part of the entry when doing the
match. match.
The fifth example is a filter that should be applied to any attribute The fifth example is a filter that should be applied to any attribute
supporting the matching rule given (since the attr has been omitted). supporting the matching rule given (since the attr has been omitted).
The sixth and final example is also a filter that should be applied The sixth and final example is also a filter that should be applied
to any attribute supporting the matching rule given. Attributes to any attribute supporting the matching rule given. Attributes
skipping to change at page 7, line 30 skipping to change at page 7, line 29
While the representation itself has no known security implications, While the representation itself has no known security implications,
LDAP search filters do. They are interpreted by LDAP servers to LDAP search filters do. They are interpreted by LDAP servers to
select entries from which data is retrieved. LDAP servers should select entries from which data is retrieved. LDAP servers should
take care to protect the data they maintain from unauthorized access. take care to protect the data they maintain from unauthorized access.
Please refer to the Security Considerations sections of [Protocol] Please refer to the Security Considerations sections of [Protocol]
and [AuthMeth] for more information. and [AuthMeth] for more information.
9. Normative References 9. Normative References
[ASN.1] Specification of ASN.1 encoding rules: Basic, Canonical, and
Distinguished Encoding Rules, ITU-T Recommendation X.690, 1994.
[AuthMeth] Harrison, R. (editor), "LDAP: Authentication Methods and [AuthMeth] Harrison, R. (editor), "LDAP: Authentication Methods and
Connection Level Security Mechanisms", draft-ietf-ldapbis-authmeth- Connection Level Security Mechanisms", draft-ietf-ldapbis-
xx.txt, a work in progress. authmeth-xx.txt, a work in progress.
[ISO10646] Universal Multiple-Octet Coded Character Set (UCS) - [ISO10646] Universal Multiple-Octet Coded Character Set (UCS) -
Architecture and Basic Multilingual Plane, ISO/IEC 10646-1, 1993. Architecture and Basic Multilingual Plane, ISO/IEC 10646-1,
1993.
[Models] Zeilenga, K. (editor), "LDAP: Directory Information Models", [Models] Zeilenga, K. (editor), "LDAP: Directory Information Models",
draft-ietf-ldapbis-models-xx.txt, a work in progress. draft-ietf-ldapbis-models-xx.txt, a work in progress.
[Protocol] Sermersheim, J. (editor), "LDAP: The Protocol", draft- [Protocol] draft-ietf-ldapbis-protocol-xx.txt, a work in progress.
ietf-ldapbis-protocol-xx.txt, a work in progress.
[RFC2119] S. Bradner, "Key words for use in RFCs to Indicate [RFC2119] S. Bradner, "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14 (also RFC 2119), March 1997. Requirement Levels", BCP 14 (also RFC 2119), March 1997.
[RFC2234] Crocker, D., Overell, P., "Augmented BNF for Syntax [RFC2234] Crocker, D., Overell, P., "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997. Specifications: ABNF", RFC 2234, November 1997.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646",
RFC 3629, November 2003.
[Roadmap] Zeilenga, K. (editor), "LDAP: Technical Specification Road [Roadmap] Zeilenga, K. (editor), "LDAP: Technical Specification Road
Map", draft-ietf-ldapbis-roadmap-xx.txt, a work in progress. Map", draft-ietf-ldapbis-roadmap-xx.txt, a work in progress.
[Syntaxes] Dally, K. (editor), "LDAP: Syntaxes", draft-ietf-ldapbis- [Syntaxes] Dally, K. (editor), "LDAP: Syntaxes", draft-ietf-ldapbis-
syntaxes-xx.txt, a work in progress. syntaxes-xx.txt, a work in progress.
[UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO 10646", [X.690] Specification of ASN.1 encoding rules: Basic, Canonical, and
draft-yergeau-rfc2279bis-xx.txt, a work in progress. Distinguished Encoding Rules, ITU-T Recommendation X.690,
1994.
10. Informative References 10. Informative References
None. None.
11. Intellectual Property Rights 11. Intellectual Property Rights
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to intellectual property or other rights that might be claimed to
pertain to the implementation or use of the technology described in pertain to the implementation or use of the technology described in
skipping to change at page 8, line 49 skipping to change at page 9, line 5
12. Acknowledgments 12. Acknowledgments
This document replaces RFC 2254 by Tim Howes. Changes included in This document replaces RFC 2254 by Tim Howes. Changes included in
this revised specification are based upon discussions among the this revised specification are based upon discussions among the
authors, discussions within the LDAP (v3) Revision Working Group authors, discussions within the LDAP (v3) Revision Working Group
(ldapbis), and discussions within other IETF Working Groups. The (ldapbis), and discussions within other IETF Working Groups. The
contributions of individuals in these working groups is gratefully contributions of individuals in these working groups is gratefully
acknowledged. acknowledged.
13. Authors' Address 13. Authors' Addresses
Mark Smith, Editor Mark Smith, Editor
Netscape Communications Corp. Pearl Crescent, LLC
360 W. Caribbean Drive 447 Marlpool Dr.
Sunnyvale, CA 94089 Saline, MI 48176
USA USA
+1 650 937-3477 +1 734 944-2856
MarkCSmithWork@aol.com mcs@pearlcrescent.com
Tim Howes Tim Howes
Opsware, Inc. Opsware, Inc.
599 N. Mathilda Ave. 599 N. Mathilda Ave.
Sunnyvale, CA 94085 Sunnyvale, CA 94085
USA USA
+1 408 744-7509 +1 408 744-7509
howes@opsware.com howes@opsware.com
14. Full Copyright Statement 14. Full Copyright Statement
Copyright (C) The Internet Society (2003). All Rights Reserved. Copyright (C) The Internet Society (2004). All Rights Reserved.
This document and translations of it may be copied and furnished to This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of Internet organizations, except as needed for the purpose of
skipping to change at page 11, line 20 skipping to change at page 11, line 23
Clarified the definition of 'value' (now 'assertionvalue') to take Clarified the definition of 'value' (now 'assertionvalue') to take
into account the fact that it is not precisely an AttributeAssertion into account the fact that it is not precisely an AttributeAssertion
from [Protocol] section 4.1.6 (special handling is required for some from [Protocol] section 4.1.6 (special handling is required for some
characters). Added a note that each octet of a character to be characters). Added a note that each octet of a character to be
escaped is replaced by a backslash and two hex digits, which escaped is replaced by a backslash and two hex digits, which
represent a single octet. represent a single octet.
"Examples" section: added four additional examples: (seeAlso=), "Examples" section: added four additional examples: (seeAlso=),
(cn:=Betty Rubble), (:1.2.3:=Wilma Flintstone), and (cn:=Betty Rubble), (:1.2.3:=Wilma Flintstone), and
(1.3.6.1.4.1.1466.0=\04\02\48\69). Replaced one occurrence of "a (1.3.6.1.4.1.1466.0=\04\02\48\69). Replaced one occurrence of "a
value" with "an assertion value". value" with "an assertion value". Corrected the description of this
example: (sn:dn:2.4.6.8.10:=Barney Rubble).
"Security Considerations" section: added references to [Protocol] and "Security Considerations" section: added references to [Protocol] and
[AuthMeth]. [AuthMeth].
"Normative References" section: renamed from "References" per new RFC "Normative References" section: renamed from "References" per new RFC
guidelines. Changed from [1] style to [Protocol] style throughout the guidelines. Changed from [1] style to [Protocol] style throughout the
document. Added entries for [ISO10646], [RFC2119], [AuthMeth], document. Added entries for [ISO10646], [RFC2119], [AuthMeth],
[Models], and [Roadmap] and updated the UTF-8 reference. Replaced [Models], and [Roadmap] and updated the UTF-8 reference. Replaced
RFC 822 reference with a reference to RFC 2234. RFC 822 reference with a reference to RFC 2234.
skipping to change at page 11, line 43 skipping to change at page 11, line 47
"Acknowledgments" section: added. "Acknowledgments" section: added.
"Appendix A: Changes Since RFC 2254" section: added. "Appendix A: Changes Since RFC 2254" section: added.
"Appendix B: Changes Since Previous Document Revision" section: "Appendix B: Changes Since Previous Document Revision" section:
added. added.
16. Appendix B: Changes Since Previous Document Revision 16. Appendix B: Changes Since Previous Document Revision
This appendix lists all changes relative to the previously published This appendix lists all changes relative to the previously published
revision, draft-ietf-ldapbis-filter-04.txt. Note that when revision, draft-ietf-ldapbis-filter-05.txt. Note that when
appropriate these changes are also included in Appendix A, but are appropriate these changes are also included in Appendix A, but are
also included here for the benefit of the people who have already also included here for the benefit of the people who have already
reviewed draft-ietf-ldapbis-filter-04.txt. This section will be reviewed draft-ietf-ldapbis-filter-05.txt. This section will be
removed before this document is published as an RFC. removed before this document is published as an RFC.
16.1. Technical Changes 16.1. Technical Changes
"Examples" section: Removed the (:=Fred Flintstone) example which is None.
not allowed by the protocol.
16.2. Editorial Changes 16.2. Editorial Changes
"String Search Filter Definition" section: Revised the last two "LDAP Search Filter Definition" section: changed the LDAPv3 search
sentences in this section to improve clarity (the updated text now filter ABNF so it matches that used in the latest revision of
begins with the text "Implementations SHOULD accept as input a string [Protocol] and removed the following redundant descriptive text:
that includes...." "where the LDAPString above is limited to the UTF-8 encoding [UTF-8]
of the ISO 10646 character set [ISO10646]."
Replaced all occurrences of "asterix" with the correctly spelled "String Search Filter Definition" section: Corrected section
"asterisk." reference to [Models] and replaced this sentence: "Implementations
SHOULD accept as input a string that includes invalid UTF-8 octet
sequences." with the following: "Implementations SHOULD accept as
input strings that are not valid UTF-8 strings."
"Normative References" section: changed UTF-8 reference to point to "Examples" section: Corrected the description of this example:
the UTF-8 Internet Draft. (sn:dn:2.4.6.8.10:=Barney Rubble).
"Intellectual Property Rights" section: added. "Normative References" section: changed UTF-8 reference to point to
RFC 3629, replaced [ASN.1] with [X.690] for consistency, and indented
the reference descriptions to enhance readability.
Author's Addresses section: New email address for Mark Smith. Authors' Addresses section: New contact information for Mark Smith.
"Full Copyright Statement" section: updated text to match latest IETF Updated the copyright year to 2004.
guidelines.
This Internet Draft expires on 25 April 2004. This Internet Draft expires on 13 August 2004.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/