Skip to content

iam: the condition operator families substrate does not implement are discarded, not refused — ...IfExists, ArnNotLike, numeric, date, IpAddress #714

Closed

Description

@scttfrdmn

evaluateConditionKey (emulator/iam_eval.go:606-668) knows nine operators: StringEquals,
StringNotEquals, StringLike, StringNotLike, ArnEquals/ArnLike, ArnNotEquals, Bool
and Null. #690 added the ForAllValues:/ForAnyValue: qualifiers on top of them. Anything
else falls to the function's closing // Unknown operator — deny by default (safe).

That default is the right shape — but it means a policy using a documented operator substrate has
not implemented is discarded entirely, which is a false deny as an Allow and silent
inertness as a Deny. #690's own research established that this is a worse failure than an
unpopulated key, because it cannot be detected from the outside.

Missing, in rough order of how often real policies use them:

  • ...IfExists — a suffix on any operator, and AWS's recommended way to write a condition
    that tolerates a request without the key. Substrate refuses every one of them.
  • ArnNotLike — the negated wildcard ARN form; ArnLike exists, aliased to ArnEquals,
    which is itself worth revisiting since AWS documents the two as distinct.
  • NumericEquals, NumericNotEquals, NumericLessThan, NumericLessThanEquals,
    NumericGreaterThan, NumericGreaterThanEquals
    — needed by, among others,
    s3:max-keys and aws:MultiFactorAuthAge.
  • DateEquals and the five date comparisons — aws:CurrentTime, aws:TokenIssueTime.
  • IpAddress / NotIpAddress — aws:SourceIp, the single most common network guardrail in
    the wild.
  • BinaryEquals, for completeness.

aws:CurrentTime and aws:SourceIp also have to be populated before the date and IP families
can decide anything, and aws:CurrentTime must come from the simulated clock rather than
time.Now(), or every replay diverges.

Acceptance criteria

  • The ...IfExists suffix parsed generically, so it composes with every operator including a
    set qualifier, with AWS's documented semantics ("if the key is present, evaluate; if
    absent, return true").
  • ArnNotLike implemented, and a recorded decision on whether ArnLike should stop being an
    alias for ArnEquals.
  • The numeric, date and IP families implemented, each against its own documented semantics,
    with a malformed value in the policy treated distinctly from a malformed one in the
    request.
  • aws:CurrentTime populated from the simulated clock, and aws:SourceIp from the request,
    or the family documented as parseable-but-unsatisfiable until they are.
  • The unknown-operator deny retained for anything still unimplemented, and docs/services.md
    listing exactly which operators are evaluated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions