fix: ignore denied-endpoints on non-enterprise tier
The deny list is an enterprise (TLS) tier feature. The non-TLS agent does not understand denied_endpoints, so a config with only denied-endpoints set was treated as block with an empty allow list, blocking all egress for the job. Gate deny-list mode on the TLS check and ignore denied-endpoints with an info message when the org is not on the enterprise tier.
This commit is contained in:
Vendored
+9
-1
@@ -86126,10 +86126,18 @@ function resolveCacheHost() {
|
||||
}
|
||||
// Mirrors the agent's isDenyList() decision: the deny list is enforced
|
||||
// only when there are no allowed endpoints. Allowed endpoints always win.
|
||||
const isDenyListMode = confg.denied_endpoints !== "" && confg.allowed_endpoints === "";
|
||||
let isDenyListMode = confg.denied_endpoints !== "" && confg.allowed_endpoints === "";
|
||||
if (confg.denied_endpoints !== "" && confg.allowed_endpoints !== "") {
|
||||
lib_core.info("Both allowed-endpoints and denied-endpoints are set. Only one of them should be set at a time. allowed-endpoints will be honored and denied-endpoints will be ignored.");
|
||||
}
|
||||
// The deny list is an enterprise (TLS) tier feature. The non-TLS agent
|
||||
// does not understand denied_endpoints and would treat this config as
|
||||
// block with an empty allow list, blocking all egress.
|
||||
if (isDenyListMode && !(yield isTLSEnabled(github.context.repo.owner))) {
|
||||
lib_core.info("denied-endpoints is supported on the enterprise tier only. Ignoring denied-endpoints for this run.");
|
||||
confg.denied_endpoints = "";
|
||||
isDenyListMode = false;
|
||||
}
|
||||
if (confg.egress_policy === "block" &&
|
||||
confg.allowed_endpoints === "" &&
|
||||
!isDenyListMode) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+12
-1
@@ -275,7 +275,7 @@ async function resolveCacheHost(): Promise<string | undefined> {
|
||||
|
||||
// Mirrors the agent's isDenyList() decision: the deny list is enforced
|
||||
// only when there are no allowed endpoints. Allowed endpoints always win.
|
||||
const isDenyListMode =
|
||||
let isDenyListMode =
|
||||
confg.denied_endpoints !== "" && confg.allowed_endpoints === "";
|
||||
|
||||
if (confg.denied_endpoints !== "" && confg.allowed_endpoints !== "") {
|
||||
@@ -284,6 +284,17 @@ async function resolveCacheHost(): Promise<string | undefined> {
|
||||
);
|
||||
}
|
||||
|
||||
// The deny list is an enterprise (TLS) tier feature. The non-TLS agent
|
||||
// does not understand denied_endpoints and would treat this config as
|
||||
// block with an empty allow list, blocking all egress.
|
||||
if (isDenyListMode && !(await isTLSEnabled(context.repo.owner))) {
|
||||
core.info(
|
||||
"denied-endpoints is supported on the enterprise tier only. Ignoring denied-endpoints for this run."
|
||||
);
|
||||
confg.denied_endpoints = "";
|
||||
isDenyListMode = false;
|
||||
}
|
||||
|
||||
if (
|
||||
confg.egress_policy === "block" &&
|
||||
confg.allowed_endpoints === "" &&
|
||||
|
||||
Reference in New Issue
Block a user