]> git.ipfire.org Git - thirdparty/squid.git/commit
annotate_client and annotate_transaction ACLs must always match (#1820)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Thu, 30 May 2024 15:41:15 +0000 (15:41 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 1 Jun 2024 12:38:48 +0000 (12:38 +0000)
commitcc71dd7cd757c77c6c9df72a4c60b2d6209def96
tree01bb78060b75a206e2ac57bfc0fc48b2801282e8
parent82c51da13d3ed70d6f200857930a01c825c549c7
annotate_client and annotate_transaction ACLs must always match (#1820)

    WARNING: markAsTunneled ACL is used in context without an HTTP
    request. Assuming mismatch.

Our annotate_client and annotate_transaction ACLs are documented as
"always matching", and some existing Squid configurations rely on that
invariant. Both ACLs did not match when they lacked access to the
current transaction information because their requiresRequest() method
returned true; annotate_client ACL also did not match after the
client-to-Squid connection was gone and when the transaction was not
associated with a client-to-Squid connection.

This change makes ACL code conform to documentation. Squid still warns
the admin if an ACL cannot annotate. Such warnings may indicate s Squid
bug or misconfiguration, but mismatching in those cases causes more harm
because it makes it impossible for the admin to rely on the primary
matching invariant. "One reliable invariant plus one unreliable side
effect" is the lesser evil than "two unreliable effects".

    # the following must deny even if it cannot annotate
    http_access deny markAsDenied

    # the following might not log denied traffic (with a prior warning)
    access_log syslog:daemon.err markedAsDenied

Also fixed annotate_client to annotate the current transaction even
after ConnStateData destruction. Such annotations may happen when, for
example, Squid continues a large download after the HTTP client is gone.
src/acl/AnnotateClient.cc
src/acl/AnnotateClient.h
src/acl/AnnotateTransaction.cc
src/acl/AnnotateTransaction.h