@hilbras/keystone 1.9.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +459 -0
- package/README.md +163 -32
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/db/migrations/0015_chief_vargas.sql +7 -0
- package/dist/db/migrations/0016_gorgeous_charles_xavier.sql +5 -0
- package/dist/db/migrations/0017_flashy_nekra.sql +1 -0
- package/dist/db/migrations/meta/0015_snapshot.json +4340 -0
- package/dist/db/migrations/meta/0016_snapshot.json +4363 -0
- package/dist/db/migrations/meta/0017_snapshot.json +4370 -0
- package/dist/db/migrations/meta/_journal.json +21 -0
- package/dist/db/schema.d.ts +138 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +39 -1
- package/dist/db/schema.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/auth.d.ts +2 -0
- package/dist/plugins/auth.d.ts.map +1 -1
- package/dist/plugins/auth.js +21 -7
- package/dist/plugins/auth.js.map +1 -1
- package/dist/plugins/headerSanitization.d.ts +15 -0
- package/dist/plugins/headerSanitization.d.ts.map +1 -0
- package/dist/plugins/headerSanitization.js +39 -0
- package/dist/plugins/headerSanitization.js.map +1 -0
- package/dist/plugins/machinePrincipal.d.ts +28 -0
- package/dist/plugins/machinePrincipal.d.ts.map +1 -0
- package/dist/plugins/machinePrincipal.js +45 -0
- package/dist/plugins/machinePrincipal.js.map +1 -0
- package/dist/plugins/mtls.d.ts +21 -2
- package/dist/plugins/mtls.d.ts.map +1 -1
- package/dist/plugins/mtls.js +94 -47
- package/dist/plugins/mtls.js.map +1 -1
- package/dist/plugins/rateLimit.d.ts +5 -4
- package/dist/plugins/rateLimit.d.ts.map +1 -1
- package/dist/plugins/rateLimit.js +11 -8
- package/dist/plugins/rateLimit.js.map +1 -1
- package/dist/repositories/application.d.ts +1 -1
- package/dist/repositories/application.d.ts.map +1 -1
- package/dist/repositories/application.js +8 -2
- package/dist/repositories/application.js.map +1 -1
- package/dist/repositories/session.d.ts +1 -0
- package/dist/repositories/session.d.ts.map +1 -1
- package/dist/repositories/types.d.ts +5 -1
- package/dist/repositories/types.d.ts.map +1 -1
- package/dist/routes/admin/organizations.d.ts.map +1 -1
- package/dist/routes/admin/organizations.js +31 -2
- package/dist/routes/admin/organizations.js.map +1 -1
- package/dist/routes/apiKeys.d.ts.map +1 -1
- package/dist/routes/apiKeys.js +23 -5
- package/dist/routes/apiKeys.js.map +1 -1
- package/dist/routes/federation.d.ts.map +1 -1
- package/dist/routes/federation.js +8 -2
- package/dist/routes/federation.js.map +1 -1
- package/dist/routes/oauth.d.ts.map +1 -1
- package/dist/routes/oauth.js +38 -2
- package/dist/routes/oauth.js.map +1 -1
- package/dist/routes/oauth2.d.ts.map +1 -1
- package/dist/routes/oauth2.js +92 -13
- package/dist/routes/oauth2.js.map +1 -1
- package/dist/routes/profile.js +2 -2
- package/dist/routes/profile.js.map +1 -1
- package/dist/routes/saml.d.ts +24 -0
- package/dist/routes/saml.d.ts.map +1 -1
- package/dist/routes/saml.js +32 -3
- package/dist/routes/saml.js.map +1 -1
- package/dist/routes/serviceAccounts.d.ts.map +1 -1
- package/dist/routes/serviceAccounts.js +78 -2
- package/dist/routes/serviceAccounts.js.map +1 -1
- package/dist/routes/sessions.js +3 -3
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/smsOtp.d.ts.map +1 -1
- package/dist/routes/smsOtp.js +6 -0
- package/dist/routes/smsOtp.js.map +1 -1
- package/dist/routes/totp.d.ts.map +1 -1
- package/dist/routes/totp.js +24 -10
- package/dist/routes/totp.js.map +1 -1
- package/dist/routes/webauthn.d.ts.map +1 -1
- package/dist/routes/webauthn.js +8 -2
- package/dist/routes/webauthn.js.map +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/types.d.ts +4 -1
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/services/application/organization.d.ts +5 -1
- package/dist/services/application/organization.d.ts.map +1 -1
- package/dist/services/application/organization.js.map +1 -1
- package/dist/services/connectors/google.d.ts +18 -1
- package/dist/services/connectors/google.d.ts.map +1 -1
- package/dist/services/connectors/google.js +25 -3
- package/dist/services/connectors/google.js.map +1 -1
- package/dist/services/connectors/oidc.d.ts +14 -2
- package/dist/services/connectors/oidc.d.ts.map +1 -1
- package/dist/services/connectors/oidc.js +29 -3
- package/dist/services/connectors/oidc.js.map +1 -1
- package/dist/services/connectors/types.d.ts +13 -1
- package/dist/services/connectors/types.d.ts.map +1 -1
- package/dist/services/domain/authentication.d.ts.map +1 -1
- package/dist/services/domain/authentication.js +36 -19
- package/dist/services/domain/authentication.js.map +1 -1
- package/dist/services/domain/organization.d.ts +5 -1
- package/dist/services/domain/organization.d.ts.map +1 -1
- package/dist/services/domain/organization.js.map +1 -1
- package/dist/services/events/types.d.ts +1 -1
- package/dist/services/events/types.d.ts.map +1 -1
- package/dist/services/events/validate.d.ts.map +1 -1
- package/dist/services/events/validate.js +6 -0
- package/dist/services/events/validate.js.map +1 -1
- package/dist/services/magicLinks.d.ts.map +1 -1
- package/dist/services/magicLinks.js +13 -9
- package/dist/services/magicLinks.js.map +1 -1
- package/dist/services/oauth2.d.ts +72 -2
- package/dist/services/oauth2.d.ts.map +1 -1
- package/dist/services/oauth2.js +106 -6
- package/dist/services/oauth2.js.map +1 -1
- package/dist/services/redirectUri.d.ts +56 -0
- package/dist/services/redirectUri.d.ts.map +1 -0
- package/dist/services/redirectUri.js +129 -0
- package/dist/services/redirectUri.js.map +1 -0
- package/dist/services/scopes.d.ts +113 -0
- package/dist/services/scopes.d.ts.map +1 -0
- package/dist/services/scopes.js +138 -0
- package/dist/services/scopes.js.map +1 -0
- package/dist/services/serviceAccounts.d.ts +20 -0
- package/dist/services/serviceAccounts.d.ts.map +1 -1
- package/dist/services/serviceAccounts.js +47 -1
- package/dist/services/serviceAccounts.js.map +1 -1
- package/dist/services/sessionRevocation.d.ts +76 -0
- package/dist/services/sessionRevocation.d.ts.map +1 -0
- package/dist/services/sessionRevocation.js +86 -0
- package/dist/services/sessionRevocation.js.map +1 -0
- package/dist/services/singleUse.d.ts +68 -0
- package/dist/services/singleUse.d.ts.map +1 -0
- package/dist/services/singleUse.js +54 -0
- package/dist/services/singleUse.js.map +1 -0
- package/dist/services/smsOtp.d.ts.map +1 -1
- package/dist/services/smsOtp.js +12 -8
- package/dist/services/smsOtp.js.map +1 -1
- package/dist/services/tokens.d.ts +2 -0
- package/dist/services/tokens.d.ts.map +1 -1
- package/dist/services/tokens.js +5 -0
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/trustedProxies.d.ts +90 -0
- package/dist/services/trustedProxies.d.ts.map +1 -0
- package/dist/services/trustedProxies.js +283 -0
- package/dist/services/trustedProxies.js.map +1 -0
- package/dist/setup-server.js +2 -1
- package/dist/setup-server.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +4 -5
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { FastifyRequest } from "fastify";
|
|
2
|
+
/**
|
|
3
|
+
* Trusted-proxy model.
|
|
4
|
+
*
|
|
5
|
+
* ```text
|
|
6
|
+
* Internet → trusted reverse proxy → Keystone
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Two rules follow from that diagram, and everything else in this module exists
|
|
10
|
+
* to enforce them:
|
|
11
|
+
*
|
|
12
|
+
* 1. Only a request whose **peer** address is a configured trusted proxy may
|
|
13
|
+
* have its forwarded headers believed. `request.ip` cannot be used for this
|
|
14
|
+
* decision, because Fastify derives it from `x-forwarded-for` when
|
|
15
|
+
* `trustProxy` is on — which is exactly the attacker-controlled value.
|
|
16
|
+
* 2. The peer address is the only value that cannot be spoofed. Forwarded
|
|
17
|
+
* headers are only consulted when (1) holds.
|
|
18
|
+
*
|
|
19
|
+
* With no trusted proxies configured, nothing is trusted: the peer address is
|
|
20
|
+
* used for rate limiting and client-certificate headers are ignored entirely.
|
|
21
|
+
* The default is therefore fail-closed.
|
|
22
|
+
*/
|
|
23
|
+
/** Headers that carry client identity and must never be believed from an untrusted peer. */
|
|
24
|
+
export declare const IDENTITY_HEADERS: readonly ["x-forwarded-client-cert", "x-client-cert-fingerprint", "x-service-account-id", "x-forwarded-client-cert-chain"];
|
|
25
|
+
/**
|
|
26
|
+
* Normalize an address so every spelling of the same host compares equal.
|
|
27
|
+
*
|
|
28
|
+
* IPv4-mapped IPv6 arrives in two forms — the dotted form `::ffff:127.0.0.1`
|
|
29
|
+
* and the hex form `::ffff:7f00:1`. Both must collapse to `127.0.0.1`,
|
|
30
|
+
* otherwise a mapped address slips past an IPv4 CIDR allowlist.
|
|
31
|
+
*/
|
|
32
|
+
export declare function normalizeAddress(address: string | undefined): string;
|
|
33
|
+
/** Does `address` fall inside `cidr`? Supports IPv4 CIDR and exact IPv6. */
|
|
34
|
+
export declare function addressInCidr(address: string, cidr: string): boolean;
|
|
35
|
+
/** Reset the parse cache. Exists for tests that change configuration. */
|
|
36
|
+
export declare function resetTrustedProxyCache(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Is at least one trusted proxy configured? False means client-identity headers
|
|
39
|
+
* are stripped from every request and rate limits key on the peer address.
|
|
40
|
+
*/
|
|
41
|
+
export declare function hasTrustedProxies(): boolean;
|
|
42
|
+
export declare function isTrustedProxy(address: string | undefined): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The socket's peer address. This is the only value a client cannot forge,
|
|
45
|
+
* because it is established by the TCP connection rather than by a header.
|
|
46
|
+
*/
|
|
47
|
+
export declare function peerAddress(request: FastifyRequest): string;
|
|
48
|
+
/** True when the immediate peer is a configured trusted proxy. */
|
|
49
|
+
export declare function isFromTrustedProxy(request: FastifyRequest): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The client address to use for rate limiting and logging.
|
|
52
|
+
*
|
|
53
|
+
* Behind a trusted proxy this is the left-most forwarded address, because the
|
|
54
|
+
* proxy is the one that appended it. From any other peer the forwarded headers
|
|
55
|
+
* are ignored, so a client cannot rotate `x-forwarded-for` to obtain a fresh
|
|
56
|
+
* rate-limit budget.
|
|
57
|
+
*/
|
|
58
|
+
export declare function clientAddress(request: FastifyRequest): string;
|
|
59
|
+
/**
|
|
60
|
+
* Remove identity and forwarded headers from a request that did not arrive via
|
|
61
|
+
* a trusted proxy. Stripping rather than merely ignoring means no downstream
|
|
62
|
+
* route, plugin, or future feature can accidentally read them.
|
|
63
|
+
*
|
|
64
|
+
* @returns whether the request was trusted (and therefore kept its headers)
|
|
65
|
+
*/
|
|
66
|
+
export declare function stripUntrustedHeaders(request: FastifyRequest): boolean;
|
|
67
|
+
/** The value Fastify's `trustProxy` option should be given. */
|
|
68
|
+
export declare function fastifyTrustProxySetting(): boolean | string[];
|
|
69
|
+
/**
|
|
70
|
+
* Does this address look like infrastructure rather than a public client?
|
|
71
|
+
*
|
|
72
|
+
* Loopback, RFC 1918, link-local, and unique-local ranges are where reverse
|
|
73
|
+
* proxies, load balancers, and service meshes live. A request arriving from one
|
|
74
|
+
* of these while no trusted proxy is configured is the signature of a proxied
|
|
75
|
+
* deployment that forgot `KEYSTONE_TRUSTED_PROXIES` — which fails silently, as
|
|
76
|
+
* every client collapsing into a single rate-limit budget.
|
|
77
|
+
*/
|
|
78
|
+
export declare function isInfrastructureAddress(address: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Why no forwarded headers were believed, or `null` when the peer was trusted.
|
|
81
|
+
*
|
|
82
|
+
* Returned so the caller can log a warning only in the case that indicates a
|
|
83
|
+
* misconfiguration, rather than on every stripped request.
|
|
84
|
+
*/
|
|
85
|
+
export declare function describeUntrustedPeer(address: string): string | null;
|
|
86
|
+
/** A SHA-256 fingerprint, in hex or the colon-separated form AWS ALB emits. */
|
|
87
|
+
export declare function isValidFingerprint(value: string | undefined): value is string;
|
|
88
|
+
/** Canonical fingerprint form used for storage and comparison. */
|
|
89
|
+
export declare function canonicalFingerprint(value: string): string;
|
|
90
|
+
//# sourceMappingURL=trustedProxies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustedProxies.d.ts","sourceRoot":"","sources":["../../src/services/trustedProxies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,YAC3B,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,+BAA+B,CACvB,CAAC;AAKX;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAwBpE;AAeD,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAwCpE;AAoBD,yEAAyE;AACzE,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAMnE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAE3D;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAEnE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAW7D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAMtE;AAED,+DAA+D;AAC/D,wBAAgB,wBAAwB,IAAI,OAAO,GAAG,MAAM,EAAE,CAG7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAmBhE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASpE;AAKD,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,IAAI,MAAM,CAI7E;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { config } from "../config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Trusted-proxy model.
|
|
4
|
+
*
|
|
5
|
+
* ```text
|
|
6
|
+
* Internet → trusted reverse proxy → Keystone
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Two rules follow from that diagram, and everything else in this module exists
|
|
10
|
+
* to enforce them:
|
|
11
|
+
*
|
|
12
|
+
* 1. Only a request whose **peer** address is a configured trusted proxy may
|
|
13
|
+
* have its forwarded headers believed. `request.ip` cannot be used for this
|
|
14
|
+
* decision, because Fastify derives it from `x-forwarded-for` when
|
|
15
|
+
* `trustProxy` is on — which is exactly the attacker-controlled value.
|
|
16
|
+
* 2. The peer address is the only value that cannot be spoofed. Forwarded
|
|
17
|
+
* headers are only consulted when (1) holds.
|
|
18
|
+
*
|
|
19
|
+
* With no trusted proxies configured, nothing is trusted: the peer address is
|
|
20
|
+
* used for rate limiting and client-certificate headers are ignored entirely.
|
|
21
|
+
* The default is therefore fail-closed.
|
|
22
|
+
*/
|
|
23
|
+
/** Headers that carry client identity and must never be believed from an untrusted peer. */
|
|
24
|
+
export const IDENTITY_HEADERS = [
|
|
25
|
+
"x-forwarded-client-cert",
|
|
26
|
+
"x-client-cert-fingerprint",
|
|
27
|
+
"x-service-account-id",
|
|
28
|
+
"x-forwarded-client-cert-chain",
|
|
29
|
+
];
|
|
30
|
+
/** Headers that influence the apparent client address. */
|
|
31
|
+
const FORWARDED_HEADERS = ["x-forwarded-for", "x-real-ip", "forwarded"];
|
|
32
|
+
/**
|
|
33
|
+
* Normalize an address so every spelling of the same host compares equal.
|
|
34
|
+
*
|
|
35
|
+
* IPv4-mapped IPv6 arrives in two forms — the dotted form `::ffff:127.0.0.1`
|
|
36
|
+
* and the hex form `::ffff:7f00:1`. Both must collapse to `127.0.0.1`,
|
|
37
|
+
* otherwise a mapped address slips past an IPv4 CIDR allowlist.
|
|
38
|
+
*/
|
|
39
|
+
export function normalizeAddress(address) {
|
|
40
|
+
if (!address)
|
|
41
|
+
return "";
|
|
42
|
+
let value = address.trim().toLowerCase();
|
|
43
|
+
if (value.startsWith("[") && value.endsWith("]"))
|
|
44
|
+
value = value.slice(1, -1);
|
|
45
|
+
// Strip a zone index and any port suffix on bare IPv6.
|
|
46
|
+
const zone = value.indexOf("%");
|
|
47
|
+
if (zone !== -1)
|
|
48
|
+
value = value.slice(0, zone);
|
|
49
|
+
if (value.startsWith("::ffff:")) {
|
|
50
|
+
const tail = value.slice(7);
|
|
51
|
+
if (tail.includes("."))
|
|
52
|
+
return tail;
|
|
53
|
+
// Hex form: the final two hextets are the IPv4 address.
|
|
54
|
+
const hextets = tail.split(":");
|
|
55
|
+
if (hextets.length === 2 && hextets.every((h) => /^[0-9a-f]{1,4}$/.test(h))) {
|
|
56
|
+
const high = parseInt(hextets[0], 16);
|
|
57
|
+
const low = parseInt(hextets[1], 16);
|
|
58
|
+
if (Number.isInteger(high) && Number.isInteger(low)) {
|
|
59
|
+
return [high >> 8, high & 0xff, low >> 8, low & 0xff].join(".");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return tail;
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
function toIPv4Octets(address) {
|
|
67
|
+
const parts = address.split(".");
|
|
68
|
+
if (parts.length !== 4)
|
|
69
|
+
return null;
|
|
70
|
+
const octets = [];
|
|
71
|
+
for (const part of parts) {
|
|
72
|
+
if (!/^\d{1,3}$/.test(part))
|
|
73
|
+
return null;
|
|
74
|
+
const n = Number(part);
|
|
75
|
+
if (n < 0 || n > 255)
|
|
76
|
+
return null;
|
|
77
|
+
octets.push(n);
|
|
78
|
+
}
|
|
79
|
+
return octets;
|
|
80
|
+
}
|
|
81
|
+
/** Does `address` fall inside `cidr`? Supports IPv4 CIDR and exact IPv6. */
|
|
82
|
+
export function addressInCidr(address, cidr) {
|
|
83
|
+
const target = normalizeAddress(address);
|
|
84
|
+
const range = cidr.trim().toLowerCase();
|
|
85
|
+
if (!target || !range)
|
|
86
|
+
return false;
|
|
87
|
+
if (!range.includes("/"))
|
|
88
|
+
return target === normalizeAddress(range);
|
|
89
|
+
const [network, bitsRaw] = range.split("/");
|
|
90
|
+
const bits = Number(bitsRaw);
|
|
91
|
+
if (!Number.isInteger(bits))
|
|
92
|
+
return false;
|
|
93
|
+
const targetOctets = toIPv4Octets(normalizeAddress(network));
|
|
94
|
+
const boundOctets = toIPv4Octets(normalizeAddress(network));
|
|
95
|
+
if (!targetOctets || !boundOctets) {
|
|
96
|
+
// IPv6: compare the leading `bits` of the hextets. Anything not an exact
|
|
97
|
+
// or prefix match is treated as outside the range.
|
|
98
|
+
if (bits < 0 || bits > 128)
|
|
99
|
+
return false;
|
|
100
|
+
const left = normalizeAddress(network).split(":");
|
|
101
|
+
const right = normalizeAddress(target).split(":");
|
|
102
|
+
if (left.length !== right.length)
|
|
103
|
+
return false;
|
|
104
|
+
const hextets = bits / 16;
|
|
105
|
+
for (let i = 0; i < Math.floor(hextets); i++) {
|
|
106
|
+
if (left[i] !== right[i])
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
if (bits < 0 || bits > 32)
|
|
112
|
+
return false;
|
|
113
|
+
const targetV4 = toIPv4Octets(normalizeAddress(target));
|
|
114
|
+
if (!targetV4)
|
|
115
|
+
return false;
|
|
116
|
+
let remaining = bits;
|
|
117
|
+
for (let i = 0; i < 4; i++) {
|
|
118
|
+
if (remaining <= 0)
|
|
119
|
+
break;
|
|
120
|
+
const take = Math.min(8, remaining);
|
|
121
|
+
const mask = take === 0 ? 0 : (0xff << (8 - take)) & 0xff;
|
|
122
|
+
if ((targetV4[i] & mask) !== (boundOctets[i] & mask))
|
|
123
|
+
return false;
|
|
124
|
+
remaining -= take;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
let cachedConfig = null;
|
|
129
|
+
/**
|
|
130
|
+
* Read the setting at call time rather than from the `config` snapshot, which
|
|
131
|
+
* is built once at import. Cached on the raw string, so this is cheap while
|
|
132
|
+
* still picking up a reload.
|
|
133
|
+
*/
|
|
134
|
+
function trustedEntries() {
|
|
135
|
+
const raw = (process.env.KEYSTONE_TRUSTED_PROXIES ?? config.TRUSTED_PROXIES ?? "").trim();
|
|
136
|
+
if (cachedConfig?.raw === raw)
|
|
137
|
+
return cachedConfig.entries;
|
|
138
|
+
const entries = raw
|
|
139
|
+
.split(",")
|
|
140
|
+
.map((entry) => entry.trim())
|
|
141
|
+
.filter(Boolean);
|
|
142
|
+
cachedConfig = { raw, entries };
|
|
143
|
+
return entries;
|
|
144
|
+
}
|
|
145
|
+
/** Reset the parse cache. Exists for tests that change configuration. */
|
|
146
|
+
export function resetTrustedProxyCache() {
|
|
147
|
+
cachedConfig = null;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Is at least one trusted proxy configured? False means client-identity headers
|
|
151
|
+
* are stripped from every request and rate limits key on the peer address.
|
|
152
|
+
*/
|
|
153
|
+
export function hasTrustedProxies() {
|
|
154
|
+
return trustedEntries().length > 0;
|
|
155
|
+
}
|
|
156
|
+
export function isTrustedProxy(address) {
|
|
157
|
+
const entries = trustedEntries();
|
|
158
|
+
if (entries.length === 0)
|
|
159
|
+
return false;
|
|
160
|
+
const target = normalizeAddress(address);
|
|
161
|
+
if (!target)
|
|
162
|
+
return false;
|
|
163
|
+
return entries.some((entry) => addressInCidr(target, entry));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The socket's peer address. This is the only value a client cannot forge,
|
|
167
|
+
* because it is established by the TCP connection rather than by a header.
|
|
168
|
+
*/
|
|
169
|
+
export function peerAddress(request) {
|
|
170
|
+
return normalizeAddress(request.socket?.remoteAddress ?? request.ip);
|
|
171
|
+
}
|
|
172
|
+
/** True when the immediate peer is a configured trusted proxy. */
|
|
173
|
+
export function isFromTrustedProxy(request) {
|
|
174
|
+
return isTrustedProxy(peerAddress(request));
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The client address to use for rate limiting and logging.
|
|
178
|
+
*
|
|
179
|
+
* Behind a trusted proxy this is the left-most forwarded address, because the
|
|
180
|
+
* proxy is the one that appended it. From any other peer the forwarded headers
|
|
181
|
+
* are ignored, so a client cannot rotate `x-forwarded-for` to obtain a fresh
|
|
182
|
+
* rate-limit budget.
|
|
183
|
+
*/
|
|
184
|
+
export function clientAddress(request) {
|
|
185
|
+
if (!isFromTrustedProxy(request))
|
|
186
|
+
return peerAddress(request);
|
|
187
|
+
const xff = request.headers["x-forwarded-for"];
|
|
188
|
+
if (typeof xff === "string" && xff.trim()) {
|
|
189
|
+
const first = xff.split(",")[0]?.trim();
|
|
190
|
+
if (first)
|
|
191
|
+
return normalizeAddress(first);
|
|
192
|
+
}
|
|
193
|
+
const realIp = request.headers["x-real-ip"];
|
|
194
|
+
if (typeof realIp === "string" && realIp.trim())
|
|
195
|
+
return normalizeAddress(realIp);
|
|
196
|
+
return peerAddress(request);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Remove identity and forwarded headers from a request that did not arrive via
|
|
200
|
+
* a trusted proxy. Stripping rather than merely ignoring means no downstream
|
|
201
|
+
* route, plugin, or future feature can accidentally read them.
|
|
202
|
+
*
|
|
203
|
+
* @returns whether the request was trusted (and therefore kept its headers)
|
|
204
|
+
*/
|
|
205
|
+
export function stripUntrustedHeaders(request) {
|
|
206
|
+
if (isFromTrustedProxy(request))
|
|
207
|
+
return true;
|
|
208
|
+
for (const header of [...IDENTITY_HEADERS, ...FORWARDED_HEADERS]) {
|
|
209
|
+
delete request.headers[header];
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
/** The value Fastify's `trustProxy` option should be given. */
|
|
214
|
+
export function fastifyTrustProxySetting() {
|
|
215
|
+
const entries = trustedEntries();
|
|
216
|
+
return entries.length > 0 ? entries : false;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Does this address look like infrastructure rather than a public client?
|
|
220
|
+
*
|
|
221
|
+
* Loopback, RFC 1918, link-local, and unique-local ranges are where reverse
|
|
222
|
+
* proxies, load balancers, and service meshes live. A request arriving from one
|
|
223
|
+
* of these while no trusted proxy is configured is the signature of a proxied
|
|
224
|
+
* deployment that forgot `KEYSTONE_TRUSTED_PROXIES` — which fails silently, as
|
|
225
|
+
* every client collapsing into a single rate-limit budget.
|
|
226
|
+
*/
|
|
227
|
+
export function isInfrastructureAddress(address) {
|
|
228
|
+
const target = normalizeAddress(address);
|
|
229
|
+
if (!target)
|
|
230
|
+
return false;
|
|
231
|
+
if (target === "127.0.0.1" || target === "::1" || target === "0.0.0.0" || target === "::") {
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
if (target.startsWith("10."))
|
|
235
|
+
return true;
|
|
236
|
+
if (/^172\.(1[6-9]|2\d|3[01])\./.test(target))
|
|
237
|
+
return true;
|
|
238
|
+
if (target.startsWith("192.168."))
|
|
239
|
+
return true;
|
|
240
|
+
if (target.startsWith("169.254."))
|
|
241
|
+
return true;
|
|
242
|
+
// IPv6: fe80::/10 link-local, fc00::/7 unique-local. Compare the first
|
|
243
|
+
// hextet regardless of how many there are, so a fully expanded address
|
|
244
|
+
// (`fe80:0000:...:0001`) is classified the same as the compressed form.
|
|
245
|
+
const first = parseInt(target.split(":")[0] ?? "", 16);
|
|
246
|
+
if (Number.isInteger(first)) {
|
|
247
|
+
if ((first & 0xffc0) === 0xfe80)
|
|
248
|
+
return true;
|
|
249
|
+
if ((first & 0xfe00) === 0xfc00)
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Why no forwarded headers were believed, or `null` when the peer was trusted.
|
|
256
|
+
*
|
|
257
|
+
* Returned so the caller can log a warning only in the case that indicates a
|
|
258
|
+
* misconfiguration, rather than on every stripped request.
|
|
259
|
+
*/
|
|
260
|
+
export function describeUntrustedPeer(address) {
|
|
261
|
+
if (hasTrustedProxies())
|
|
262
|
+
return null;
|
|
263
|
+
if (!isInfrastructureAddress(address))
|
|
264
|
+
return null;
|
|
265
|
+
return ("client-identity headers were stripped from an infrastructure address while " +
|
|
266
|
+
"KEYSTONE_TRUSTED_PROXIES is unset. If Keystone is behind a reverse proxy, " +
|
|
267
|
+
"set it to the proxy's address: until then every client shares one rate-limit " +
|
|
268
|
+
"budget and forwarded client addresses are ignored. See docs/security/proxy-security.md");
|
|
269
|
+
}
|
|
270
|
+
const FINGERPRINT_HEX = /^[0-9a-f]{64}$/i;
|
|
271
|
+
const FINGERPRINT_COLON = /^(?:[0-9a-f]{2}:){31}[0-9a-f]{2}$/i;
|
|
272
|
+
/** A SHA-256 fingerprint, in hex or the colon-separated form AWS ALB emits. */
|
|
273
|
+
export function isValidFingerprint(value) {
|
|
274
|
+
if (!value)
|
|
275
|
+
return false;
|
|
276
|
+
const normalized = value.trim();
|
|
277
|
+
return FINGERPRINT_HEX.test(normalized) || FINGERPRINT_COLON.test(normalized);
|
|
278
|
+
}
|
|
279
|
+
/** Canonical fingerprint form used for storage and comparison. */
|
|
280
|
+
export function canonicalFingerprint(value) {
|
|
281
|
+
return value.trim().replace(/:/g, "").toLowerCase();
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=trustedProxies.js.map
|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;QAC/E,wFAAwF,CACzF,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAE/D,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,KAAyB;IAC1D,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,OAAO,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAChF,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACtD,CAAC"}
|
package/dist/setup-server.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { fastifyTrustProxySetting } from "./services/trustedProxies.js";
|
|
2
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
4
|
import fs from "node:fs/promises";
|
|
4
5
|
import fastify from "fastify";
|
|
@@ -10,7 +11,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
10
11
|
async function buildSetupApp() {
|
|
11
12
|
const app = fastify({
|
|
12
13
|
logger: { level: config.NODE_ENV === "production" ? "info" : "debug" },
|
|
13
|
-
trustProxy:
|
|
14
|
+
trustProxy: fastifyTrustProxySetting(),
|
|
14
15
|
genReqId: () => crypto.randomUUID(),
|
|
15
16
|
});
|
|
16
17
|
await app.register(cors, {
|
package/dist/setup-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-server.js","sourceRoot":"","sources":["../src/setup-server.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAA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a,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAClE,KAAK,EAAE,CAAC;AACV,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -52,9 +52,9 @@ export declare function toPublicSamlConnection(connection: SamlConnection): Publ
|
|
|
52
52
|
export declare function toPublicOidcConnection(connection: OidcConnection): PublicOidcConnection;
|
|
53
53
|
export declare function toPublicApiKey(apiKey: ApiKey): PublicApiKey;
|
|
54
54
|
export declare function toPublicApplication(application: Application | (PublicApplication & {
|
|
55
|
-
clientSecret?: string;
|
|
55
|
+
clientSecret?: string | null;
|
|
56
56
|
})): PublicApplication & {
|
|
57
|
-
clientSecret?: string;
|
|
57
|
+
clientSecret?: string | null;
|
|
58
58
|
};
|
|
59
59
|
export interface PublicUser {
|
|
60
60
|
id: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,cAAc;QACtB,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,gFAAgF;QAChF,UAAU,CAAC,EAAE,WAAW,CAAC;QACzB,KAAK,EAAE;YACL,GAAG,CAAC,EAAE,WAAW,CAAC;YAClB,GAAG,CAAC,EAAE,YAAY,CAAC;YACnB,UAAU,CAAC,EAAE,aAAa,CAAC;YAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,gEAAgE;YAChE,SAAS,CAA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AI,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QAC9C,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;QACjD,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAqB;IAC9C,MAAM,QAAQ,GAAG,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAChE,OAAO;QACL,GAAG,YAAY,CAAC,IAAI,CAAC;QACrB,QAAQ,EAAE,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAE,QAAoC,CAAC,CAAC,CAAC,EAAE;KAChG,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hilbras/keystone",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.6.0",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"description": "Hilbras Keystone — standalone identity platform: authentication, MFA, authorization, enterprise SSO, SCIM, and token issuance.",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
@@ -12,10 +13,7 @@
|
|
|
12
13
|
},
|
|
13
14
|
"type": "module",
|
|
14
15
|
"overrides": {
|
|
15
|
-
"
|
|
16
|
-
"fast-uri@3.0.0 - 3.1.5": "3.1.8",
|
|
17
|
-
"fast-uri@4.0.0 - 4.1.2": "4.2.1",
|
|
18
|
-
"find-my-way": "9.9.0"
|
|
16
|
+
"esbuild": ">=0.25.0"
|
|
19
17
|
},
|
|
20
18
|
"files": [
|
|
21
19
|
"dist",
|
|
@@ -38,6 +36,7 @@
|
|
|
38
36
|
"start:setup": "KEYSTONE_SETUP_MODE=true node dist/setup-server.js",
|
|
39
37
|
"typecheck": "tsc --noEmit",
|
|
40
38
|
"lint": "oxlint src --deny-warnings",
|
|
39
|
+
"verify:release": "node scripts/verify-release-metadata.mjs",
|
|
41
40
|
"typecheck:all": "npm run typecheck && cd frontend && npm run build",
|
|
42
41
|
"db:generate": "drizzle-kit generate",
|
|
43
42
|
"db:migrate": "drizzle-kit migrate",
|