iya-sts
    Preparing search index...

    The transport policy of every outbound request to an address somebody else answers: whether it may be plain http, and whether the certificate of whoever answers is verified.

    Each family has three settings (allow http, skip verification, a CA file); product mode refuses plain http and ignores a switch that skips verification.

    Index
    CA_FILE_CODE: "STS-CORE-0104" = CA_FILE_CODE

    The error code of a CA file setting that names an unusable file: STS-CORE-0104.

    • Refuses a named file that may not be read, before a caller reads it. The sentence names the setting and not the path, and is the same whether the file is outside the directories or does not exist.

      A caller that reads the file itself uses readNamedFile() instead (#2247); this stays for one that hands the PATH to a library that opens it (a cloud SDK's key file), where the check is all this process can do.

      Parameters

      • file: string

        the path as configured

      Returns void

      nothing

      when the file may not be read

    • For a dialer whose own CA REPLACES node's store (the kubelet, the Kubernetes API, the external AuthZEN PDP): null where its use case is unassigned, so the dialer keeps its own setting exactly as before; otherwise what the assignment resolves to, as one PEM bundle, or undefined for node's store (#2118).

      Parameters

      • useCaseId: string

        the outbound use case

      Returns any

      null, { ca }, or { problem }

    • Reads the certificates in a PEM file.

      Parameters

      • file: string

        the file's path

      Returns string | string[]

      the PEM certificates, or a sentence saying why there are none

    • Holds a verified peer chain to the path rules without checking the host name, for a request that deliberately names no host (SPIRE's kubelet).

      Parameters

      • host: string

        the host dialled, for the message

      • cert: any

        the peer certificate node verified

      Returns Error

      an Error when the chain breaks the rules, otherwise undefined

    • The host check every verified outbound request makes: the host against the certificate's names, then the verified chain against the path rules.

      Parameters

      • host: string

        the host dialled

      • cert: any

        the peer certificate node verified

      Returns Error

      an Error when either check fails, otherwise undefined

    • Describes a family's three settings as they are in force here, which in product is not what is stored.

      Parameters

      • family: OutboundFamily

        the family's settings

      Returns {
          allowHttp: boolean;
          caFile: string;
          skipTlsVerification: boolean;
          skipTlsVerificationSet: boolean;
      }

      { allowHttp, skipTlsVerification, skipTlsVerificationSet, caFile }

    • The real path of an open descriptor: what the kernel holds for it, from /proc/self/fd/<fd>, where there is such a view. Where there is not (not Linux), the path is resolved again and accepted only when it names the same file the descriptor is open on (device and inode), so a link swapped in between the open and this cannot be mistaken for it.

      Parameters

      • fd: number

        the open descriptor

      • file: string

        the path it was opened by

      • opened: any

        its fstat

      • ffs: any

        the fs-like module it was opened with

      • seams: NamedFileSeams

        the test seams

      Returns string

      the real path, or '' when it cannot be told

    • Checks a host against a certificate's names as RFC 9525 reads them: subjectAltName DNS-IDs and IP-IDs only, a wildcard only as a whole left-most label, never the common name.

      Parameters

      • host: string

        the host name or IP address dialled

      • cert: any

        the peer certificate, as node describes it

      Returns string

      '' when the certificate names the host, otherwise a sentence saying why not

    • Decides whether an http:// URL may be dialled for a family.

      Development allows any host while the family's setting is on; product refuses, except a loopback host for a family that allows one.

      Parameters

      • family: OutboundFamily

        the family's settings and error codes

      • hostname: unknown

        the URL's host

      Returns HttpVerdict

      { ok, why, errorCode }

    • Makes the RFC 9525 host check and the path rules node's default checkServerIdentity for every TLS client in this process. Idempotent.

      Returns void

    • Tells whether a host name is a loopback address: localhost, 127.0.0.0/8 or ::1.

      Parameters

      • hostname: unknown

        the host name, IPv6 brackets allowed

      Returns boolean

      true for a loopback address

    • Says whether a CA file an administrator named may be read (#1481, ASVS 5.0.0 5.3.2). In product its real path, symbolic links followed, must be inside a directory security.fileRoots lists. A path that does not exist answers the same as one outside them, so this says nothing about what is on the disk.

      THIS IS A CHECK OF THE PATH, NOT OF WHAT IS READ (#2247, ASVS 5.0.0 15.4.2): a link swapped in after it answers is followed by whatever opens the path next. A caller that READS the file goes through readNamedFile(), which checks the descriptor it reads through.

      Parameters

      • file: string

        the path as configured

      Returns boolean

      whether it may be read

    • The refusal of a named file, the same Error every reader throws: it names the setting and not the path, and is the same whether the file is outside the directories, does not exist, or was swapped for a link out of them after the check. namedFileRefused tells it from an fs error.

      Returns Error

      the Error, not thrown

    • Builds the options for a verified outbound connection of one outbound use case (#2118): verification on, the RFC 9525 host check, and what the use case's truststores hold as ca — node's store unchanged where the list is system alone.

      Parameters

      • useCaseId: string

        the outbound use case

      • Optionaloptions: { extraPems?: string[] }

        { extraPems }: an entry's own CA certificates (a SCIM client, a secret destination, an attribute source), added

      Returns any

      the TLS options, or { problem } where a store named cannot be used — a legacy CA file that will not read refuses the connection, as it always did

    • READS a file an administrator or a setting named, held to security.fileRoots in product (#1481) WITHOUT a window between the check and the read (#2247, ASVS 5.0.0 15.4.2). The path is checked, then opened ONCE, and what is checked again is the open descriptor: it must be a regular file, and its real path, as the kernel holds it, must lie inside a listed directory. Only then is it read, through that descriptor, and closed. A link swapped in after the path check is followed by the open and refused by the second check, with the same sentence as any other refusal.

      O_NOFOLLOW is NOT used: a link INSIDE the directories to a file inside them is what /etc/ssl/certs and a Kubernetes secret volume (..data) are made of, and it was always followed. O_NONBLOCK is, so a FIFO cannot hold the open; it is then refused as not a regular file.

      Outside product nothing is confined and the file is read as before.

      Parameters

      • file: string

        the path as configured

      • Optionalseams: NamedFileSeams

        optional: the fs-like module, and the test seams

      Returns string

      the file's text (UTF-8)

      namedFileRefusal() when it may not be read, or the fs error (its code kept) when it is permitted and cannot be read

    • Tells whether certificate verification is to be skipped: only when the setting is on and the mode allows it.

      In product a setting that is on is ignored, and said once per process with the code given.

      Parameters

      • settingKey: string

        the setting that asks to skip verification

      • ignoredCode: string

        the error code logged when product ignores it

      • what: string

        what is being sent, for the log line

      Returns boolean

      true when verification is skipped

    • Builds the TLS options for one request of a family: verification skipped, node's store, or node's store plus the family's CA file.

      Never throws; an unusable CA file is ok: false with a sentence.

      Parameters

      • family: OutboundFamily

        the family's settings and error codes

      • origin: string

        where the request goes, for the log line

      Returns TlsVerdict

      { ok, why, errorCode, rejectUnauthorized, skipped }, with ca and checkServerIdentity where verifying

    • Says whether a real path (links already resolved) lies inside a directory security.fileRoots lists. A listed directory is itself resolved, and one this image does not have is compared as written.

      Parameters

      • real: string

        an absolute path with no link left in it

      Returns boolean

      whether it is inside one of the directories

    • Builds the options for a verified outbound connection that is not one of the families: verification on, the RFC 9525 host check, and any CA given beside node's store.

      Parameters

      • Optionalca: string | string[]

        extra CA certificates, as PEM text or a list

      • Optionaloptions: { systemRoots?: boolean }

        systemRoots: false trusts ca ALONE, without node's store (#94: a connection whose operator named its own chain); ignored when no ca is given, which would trust nothing

      Returns {
          ca?: string[];
          checkServerIdentity: (host: string, cert: any) => Error;
          rejectUnauthorized: true;
      }

      the TLS options