Articles

ACLs: order, match, action and the implicit deny

The first matching entry decides the packet; everything unmatched hits an implicit deny.

Reading: 5 minNetworking

Article cover: ACLs: order, match, action and the implicit deny

An access control list (ACL) is an ordered list of permit-or-deny statements. A device reads it from the top and stops at the first entry that matches; a packet that matches nothing is dropped by an implicit deny at the end. So the order can change the result, match is set by the fields and wildcard mask in the entry, and the action is whatever the first matched entry carries. The definition is a standards matter; those evaluation rules are platform behaviour.

The term in the standards

RFC 4949 defines an access control list as “A mechanism that implements access control for a system resource by enumerating the system entities that are permitted to access the resource” (rfc4949.txt lines 603–605), and its filtering router applies a policy “implemented by rules (packet filters) loaded into the router” (lines 7188–7189). The standard thus claims rules matched against packet fields; order, a final implicit deny and the wildcard mask belong to the platform. NIST frames the same family: a router with access control lists is “the most common example of a pure packet filtering device” (nist-sp800-41r1.txt lines 420–421).

Order: the first match wins

On Cisco IOS XE — a platform rule, not an RFC one — “the order in which access list conditions or match criteria are configured is important”, because the software “tests the packet against each criteria statement in the order in which these statements are created”, and “after a match is found, no more criteria statements are checked” (Access Control Lists, Cisco IOS XE 16.9.x). The same statements in a different order “can result in a packet being passed under one circumstance and denied in another circumstance”.

packet -> entry 1 match? -> yes -> action of entry 1 (permit/deny) -> done
                | no
                v
          entry 2 match? -> yes -> action of entry 2 -> done
                | no
                v
          entry 3 match? -> yes -> action of entry 3 -> done
                | no
                v
          end of list   -> implicit deny -> dropped

Cisco advises ordering “more specific references in a network or subnet” before “more general ones” (Creating an IP Access List, 16.12.x), because a general entry placed first absorbs the packets a later, more specific entry was meant to decide.

Match: fields and the wildcard mask

A standard list matches only the packet’s source address; an extended list also matches the destination and “other IP packet data, such as protocols, TCP or UDP port numbers” (Cisco, IP Access List Overview). Addresses are compared with a wildcard mask, “sometimes referred to as an inverted mask because a 1 and 0 mean the opposite of what they mean in a subnet (network) mask”: a “wildcard mask bit 0 means check the corresponding bit value”, a “wildcard mask bit 1 means ignore that corresponding bit value”. Unwritten, the mask is 0.0.0.0 — one host; any is shorthand for 0.0.0.0 255.255.255.255. Bits need not be contiguous.

Action and the implicit deny

Each entry carries one action, permit or deny, and the action of the first match is final. When nothing matches, the implicit deny takes the packet, and Cisco advises against leaning on it: “Although all access lists end with an implicit deny statement, we recommend use of an explicit deny statement”. The empty list, by contrast, “permits all traffic into the network”. And a permit-less list admits nothing: “all access lists need at least one permit statement; otherwise, all packets are denied and no traffic passes.”

Stateless: the return path is separate

An access list keeps no memory of connections. NIST calls the family “stateless inspection firewalls” that “do not keep track of the state of each flow of traffic that passes though the firewall”, so they “cannot associate multiple requests within a single session to each other” (nist-sp800-41r1.txt lines 414–416). A reply is judged on its own fields: permitting traffic outbound does not permit the return, so the reverse direction needs its own entry.

Where the list is applied decides what it means

An access list does nothing until it is attached; the attachment fixes interface and direction. Cisco: “applying an access list to an inbound interface controls the traffic that enters the interface”, an outbound list controls what exits it, and only “one access list per interface, per protocol, and per direction” is allowed. Inbound lists “process packets before the packets are routed to an outbound interface”; outbound lists run after. And “an access list can control traffic arriving at a device or leaving a device, but not traffic originating at a device.” RFC 2827 makes the classic use a Best Current Practice: an ingress filter that “restricts traffic to allow only traffic originating from source addresses within” the customer’s own prefix (rfc2827.txt lines 267–273).

Limits and the common error

The common error is trusting the order without reading it: because the first match is final, an early permit ip any any — or a general permit above a specific deny — discards every entry below it. An access list is a stateless field match: it cannot see a session, a user or an application, and stateful judgement about a flow is a firewall’s job. A list is also only as good as its deployment point and direction.

Level and prerequisites

L3 — integration and technical control. The sheet fixes how access lists are evaluated and where they are attached, not how to configure a device. Prerequisites: the L1 addressing vocabulary and the L2 sheets on the routing table and next hop. Firewall policy is a sibling subject.

Where to go next

References

  • Shirey (RFC 4949, Internet Security Glossary, Version 2, August 2007, Informational) — the definitions of access control list, filter and filtering router (rfc4949.txt lines 602–607, 7164–7177, 7179–7190).
  • Ferguson & Senie (RFC 2827 / BCP 38, Network Ingress Filtering, May 2000, Best Current Practice) — ingress filtering as a best current practice and its stated limit (rfc2827.txt lines 30–36, 81–86, 267–273).
  • NIST (SP 800-41 Revision 1, Guidelines on Firewalls and Firewall Policy, September 2009) — packet filtering, the ruleset, sequential matching, the default stance and the stateless description (nist-sp800-41r1.txt lines 239–241, 412–421, 904, 1299–1300).
  • Cisco — Configure IP Access Lists (Document ID 23602) — vendor syntax, the explicit deny example and the UDP note (cisco-acl-23602.md lines 10–17, 22–32, 50).
  • Cisco — Security Configuration Guide: Access Control Lists, Cisco IOS XE 16.9.x (IP Access List Overview) and 16.12.x (Creating an IP Access List and Applying It to an Interface) — the vendor evaluation order, the implicit deny, the wildcard mask, the standard/extended split and the interface-and-direction rules.
  • The register with what each source supports, and how it was read, is in sources.md.
Nodrius Field Kit — cover

Get the Nodrius Field Kit

Enter your email and we'll send you the complete Field Kit: eight technical resources in one download.

Your email address is sent to Nodrius and used to deliver the Field Kit to you by email. Marketing messages are separate and optional: the checkbox does not affect your download, and you are only added to our updates list if you tick it. Privacy Policy.

Privacy & cookies

This site does not use cookies, analytics or tracking, and it does not profile you. There is nothing technical to switch off, so Accept and Reject change nothing about how the site works: either choice lets you browse everything normally.

The only difference is what your browser remembers: two entries in local storage — your choice here, so this notice is not shown again, and a marker that the Field Kit offer has already been made — so the offer is presented once and not on every page. They contain no identifier, they are not shared with anyone, and the site sets no cookie for either.

What we do with your data
How your email address is used when you ask for a Resource, how long it is kept and which rights you have — in the Privacy Policy.
What the site stores in your browser
Two entries in local storage — your choice on this notice and whether the Field Kit offer has been shown — and no cookies, no session storage, no third-party content: in the Cookie Policy.