Compare commits

..

4 Commits

Author SHA1 Message Date
AWS SDKs and Tools bot cbe3b39273 chore(main): release 6.2.4 (#1942)
Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
2026-08-31 23:17:23 +00:00
dependabot[bot] 58065db07c chore(deps): bump js-yaml (#1944)
Bumps  and [js-yaml](https://github.com/nodeca/js-yaml). These dependencies needed to be updated together.

Updates `js-yaml` from 4.2.0 to 4.3.2
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.2.0...4.3.2)

Updates `js-yaml` from 5.2.1 to 5.2.3
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.2.0...4.3.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.2
  dependency-type: indirect
- dependency-name: js-yaml
  dependency-version: 5.2.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-31 22:25:41 +00:00
GitHub Actions 609df23709 chore: Update dist 2026-08-31 21:48:01 +00:00
Tom Keller aa6526434b fix: account-ids handling, mask proxy as secret in logs (#1943)
* fix: enforce allowed-account-ids when the list contains empty entries

An empty first element previously short-circuited the allowed account
check. Empty entries are now filtered out and validation applies
whenever any non-empty entry exists.

* fix: enforce allowed-account-ids on the use-existing-credentials path

The early return for valid pre-existing credentials skipped the
allowed-account-ids check, now included.

* fix: reject newlines in names and values when writing profile files

If the profile file writing was enabled, we emitted newlines into the
file verbatim, permitting injecting arbitrary profiles into the file.
Writing now fails instead.

* fix: honor configured STS endpoint for "ambient" credentials

Ambient credential resolution built a bare STS client, so a web-identity
token found by the SDK default chain (e.g. AWS_WEB_IDENTITY_TOKEN_FILE on
a self-hosted runner) was exchanged with public STS instead of any
operator-configured sts-endpoint. Resolution now passes the configured
region, endpoint, and proxy handler to the default provider chain.

* fix: mask proxy URL credentials in job logs

Basic-auth userinfo in the http-proxy input or HTTP(S)_PROXY environment
variables was never registered as a secret, so error messages carrying
the proxy URL printed the credentials unmasked in the job log.

* fix: omit account IDs from the allowed-account-ids failure message

The mismatch error is thrown before exportAccountId registers the
account-id mask, so setFailed wrote the raw account ID (and the
configured allow-list) into a public annotation. (C4)

* chore: remove outdated examples

All of the examples were out of date and we do not have a mechanism for
keeping them up to date. Removed the examples.
2026-08-31 14:31:24 -07:00
5 changed files with 69 additions and 38 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
".release-please-manifest.json": "4.0.2", ".release-please-manifest.json": "4.0.2",
"package.json": "6.0.0", "package.json": "6.0.0",
".": "6.2.3" ".": "6.2.4"
} }
+8
View File
@@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [6.2.4](https://github.com/aws-actions/configure-aws-credentials/compare/v6.2.3...v6.2.4) (2026-08-31)
### Bug Fixes
* account-ids handling, mask proxy as secret in logs ([#1943](https://github.com/aws-actions/configure-aws-credentials/issues/1943)) ([aa65264](https://github.com/aws-actions/configure-aws-credentials/commit/aa6526434b08748f8776b29964e3f1f5d90e7b63))
* skip backoff sleep after the final retryAndBackoff attempt ([#1937](https://github.com/aws-actions/configure-aws-credentials/issues/1937)) ([3852440](https://github.com/aws-actions/configure-aws-credentials/commit/3852440c21363386b7b790605685d08a7c1a4876))
## [6.2.3](https://github.com/aws-actions/configure-aws-credentials/compare/v6.2.2...v6.2.3) (2026-07-22) ## [6.2.3](https://github.com/aws-actions/configure-aws-credentials/compare/v6.2.2...v6.2.3) (2026-07-22)
Generated Vendored
+51 -28
View File
@@ -44679,7 +44679,7 @@ var require_dist_cjs15 = __commonJS({
throw lastProviderError; throw lastProviderError;
}; };
var multipleCredentialSourceWarningEmitted = false; var multipleCredentialSourceWarningEmitted = false;
var defaultProvider = (init = {}) => memoizeChain([ var defaultProvider2 = (init = {}) => memoizeChain([
async () => { async () => {
const profile = init.profile ?? process.env[ENV_PROFILE2]; const profile = init.profile ?? process.env[ENV_PROFILE2];
if (profile) { if (profile) {
@@ -44746,7 +44746,7 @@ var require_dist_cjs15 = __commonJS({
var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5; var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5;
exports2.credentialsTreatedAsExpired = credentialsTreatedAsExpired; exports2.credentialsTreatedAsExpired = credentialsTreatedAsExpired;
exports2.credentialsWillNeedRefresh = credentialsWillNeedRefresh; exports2.credentialsWillNeedRefresh = credentialsWillNeedRefresh;
exports2.defaultProvider = defaultProvider; exports2.defaultProvider = defaultProvider2;
} }
}); });
@@ -44766,7 +44766,7 @@ var require_dist_cjs16 = __commonJS({
var { TypeRegistry: TypeRegistry2, getSchemaSerdePlugin: getSchemaSerdePlugin2 } = (init_schema(), __toCommonJS(schema_exports)); var { TypeRegistry: TypeRegistry2, getSchemaSerdePlugin: getSchemaSerdePlugin2 } = (init_schema(), __toCommonJS(schema_exports));
var { resolveAwsSdkSigV4Config: resolveAwsSdkSigV4Config2, resolveAwsSdkSigV4AConfig: resolveAwsSdkSigV4AConfig2, AwsSdkSigV4Signer: AwsSdkSigV4Signer2, AwsSdkSigV4ASigner: AwsSdkSigV4ASigner2, NODE_SIGV4A_CONFIG_OPTIONS: NODE_SIGV4A_CONFIG_OPTIONS2, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: NODE_AUTH_SCHEME_PREFERENCE_OPTIONS2 } = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports)); var { resolveAwsSdkSigV4Config: resolveAwsSdkSigV4Config2, resolveAwsSdkSigV4AConfig: resolveAwsSdkSigV4AConfig2, AwsSdkSigV4Signer: AwsSdkSigV4Signer2, AwsSdkSigV4ASigner: AwsSdkSigV4ASigner2, NODE_SIGV4A_CONFIG_OPTIONS: NODE_SIGV4A_CONFIG_OPTIONS2, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: NODE_AUTH_SCHEME_PREFERENCE_OPTIONS2 } = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports));
var { SignatureV4MultiRegion: SignatureV4MultiRegion3 } = require_dist_cjs3(); var { SignatureV4MultiRegion: SignatureV4MultiRegion3 } = require_dist_cjs3();
var { defaultProvider } = require_dist_cjs15(); var { defaultProvider: defaultProvider2 } = require_dist_cjs15();
var { toUtf8: toUtf83, fromUtf8: fromUtf83, toBase64: toBase643, fromBase64: fromBase642, calculateBodyLength: calculateBodyLength2 } = (init_serde(), __toCommonJS(serde_exports)); var { toUtf8: toUtf83, fromUtf8: fromUtf83, toBase64: toBase643, fromBase64: fromBase642, calculateBodyLength: calculateBodyLength2 } = (init_serde(), __toCommonJS(serde_exports));
var { streamCollector: streamCollector7, NodeHttpHandler: NodeHttpHandler2 } = require_dist_cjs6(); var { streamCollector: streamCollector7, NodeHttpHandler: NodeHttpHandler2 } = require_dist_cjs6();
var { AwsQueryProtocol: AwsQueryProtocol2 } = (init_protocols2(), __toCommonJS(protocols_exports2)); var { AwsQueryProtocol: AwsQueryProtocol2 } = (init_protocols2(), __toCommonJS(protocols_exports2));
@@ -45882,12 +45882,12 @@ var require_dist_cjs16 = __commonJS({
defaultsMode, defaultsMode,
authSchemePreference: config?.authSchemePreference ?? loadConfig2(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS2, loaderConfig), authSchemePreference: config?.authSchemePreference ?? loadConfig2(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS2, loaderConfig),
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength2, bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength2,
credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider, credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider2,
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider2({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider2({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
httpAuthSchemes: config?.httpAuthSchemes ?? [ httpAuthSchemes: config?.httpAuthSchemes ?? [
{ {
schemeId: "aws.auth#sigv4", schemeId: "aws.auth#sigv4",
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await defaultProvider(idProps?.__config || {})()), identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await defaultProvider2(idProps?.__config || {})()),
signer: new AwsSdkSigV4Signer2() signer: new AwsSdkSigV4Signer2()
}, },
{ {
@@ -74785,13 +74785,12 @@ function exportAccountId(identity, maskAccountId) {
return accountId; return accountId;
} }
function validateAccountId(expectedAccountIds, account) { function validateAccountId(expectedAccountIds, account) {
if (!expectedAccountIds || expectedAccountIds.length === 0 || expectedAccountIds[0] === "") { const allowedAccountIds = expectedAccountIds?.filter((id) => id !== "") ?? [];
if (allowedAccountIds.length === 0) {
return; return;
} }
if (!account || !expectedAccountIds.includes(account)) { if (!account || !allowedAccountIds.includes(account)) {
throw new Error( throw new Error("The account ID of the provided credentials does not match any of the allowed account IDs");
`The account ID of the provided credentials (${account ?? "unknown"}) does not match any of the expected account IDs: ${expectedAccountIds.join(", ")}`
);
} }
} }
function toCredentialIdentity(creds) { function toCredentialIdentity(creds) {
@@ -74804,6 +74803,24 @@ function toCredentialIdentity(creds) {
...creds.SessionToken && { sessionToken: creds.SessionToken } ...creds.SessionToken && { sessionToken: creds.SessionToken }
}; };
} }
function maskProxyCredentials(proxyServer) {
setSecret(proxyServer);
let url;
try {
url = new URL(proxyServer);
} catch (_) {
return;
}
for (const part of [url.username, url.password]) {
if (!part) continue;
setSecret(part);
try {
const decoded = decodeURIComponent(part);
if (decoded !== part) setSecret(decoded);
} catch (_) {
}
}
}
function sanitizeGitHubVariables(name) { function sanitizeGitHubVariables(name) {
const nameWithoutSpecialCharacters = name.replace(/[^\p{L}\p{Z}\p{N}_.:/=+\-@]/gu, SANITIZATION_CHARACTER); const nameWithoutSpecialCharacters = name.replace(/[^\p{L}\p{Z}\p{N}_.:/=+\-@]/gu, SANITIZATION_CHARACTER);
const nameTruncated = nameWithoutSpecialCharacters.slice(0, MAX_TAG_VALUE_LENGTH); const nameTruncated = nameWithoutSpecialCharacters.slice(0, MAX_TAG_VALUE_LENGTH);
@@ -74859,18 +74876,6 @@ function errorMessage(error3) {
function isDefined(i5) { function isDefined(i5) {
return i5 !== void 0 && i5 !== null; return i5 !== void 0 && i5 !== null;
} }
async function areCredentialsValid(credentialsClient) {
const client = credentialsClient.stsClient;
try {
const identity = await client.send(new import_client_sts.GetCallerIdentityCommand({}));
if (identity.Account) {
return true;
}
return false;
} catch (_) {
return false;
}
}
function getBooleanInput(name, options) { function getBooleanInput(name, options) {
const trueValue = ["true", "True", "TRUE"]; const trueValue = ["true", "True", "TRUE"];
const falseValue = ["false", "False", "FALSE"]; const falseValue = ["false", "False", "FALSE"];
@@ -75185,6 +75190,7 @@ async function assumeRole(params) {
// src/CredentialsClient.ts // src/CredentialsClient.ts
var import_client_sts3 = __toESM(require_dist_cjs16()); var import_client_sts3 = __toESM(require_dist_cjs16());
var import_credential_provider_node = __toESM(require_dist_cjs15());
var import_node_http_handler5 = __toESM(require_dist_cjs6()); var import_node_http_handler5 = __toESM(require_dist_cjs6());
// node_modules/proxy-agent/dist/index.js // node_modules/proxy-agent/dist/index.js
@@ -76395,6 +76401,7 @@ var CredentialsClient = class {
} }
if (props.proxyServer) { if (props.proxyServer) {
info("Configuring proxy handler for STS client"); info("Configuring proxy handler for STS client");
maskProxyCredentials(props.proxyServer);
const proxyOptions = { const proxyOptions = {
httpProxy: props.proxyServer, httpProxy: props.proxyServer,
httpsProxy: props.proxyServer httpsProxy: props.proxyServer
@@ -76460,10 +76467,13 @@ var CredentialsClient = class {
} }
} }
async loadCredentials() { async loadCredentials() {
const config = {}; return (0, import_credential_provider_node.defaultProvider)({
if (this.requestHandler !== void 0) config.requestHandler = this.requestHandler; clientConfig: {
const client = new import_client_sts3.STSClient(config); ...this.region !== void 0 && { region: this.region },
return client.config.credentials(); ...this.stsEndpoint !== void 0 && { endpoint: this.stsEndpoint },
...this.requestHandler !== void 0 && { requestHandler: this.requestHandler }
}
})();
} }
}; };
@@ -76507,8 +76517,14 @@ function parseIni2(iniData) {
function stringifyIni(data2) { function stringifyIni(data2) {
const sections = []; const sections = [];
for (const [sectionName, sectionData] of Object.entries(data2)) { for (const [sectionName, sectionData] of Object.entries(data2)) {
if (/[\r\n]/.test(sectionName)) {
throw new Error("INI section names must not contain newline characters");
}
const lines = [`[${sectionName}]`]; const lines = [`[${sectionName}]`];
for (const [key, value] of Object.entries(sectionData)) { for (const [key, value] of Object.entries(sectionData)) {
if (/[\r\n]/.test(key) || /[\r\n]/.test(value)) {
throw new Error("INI keys and values must not contain newline characters");
}
lines.push(`${key} = ${value}`); lines.push(`${key} = ${value}`);
} }
sections.push(lines.join("\n")); sections.push(lines.join("\n"));
@@ -76689,8 +76705,15 @@ async function run() {
let sourceAccountId; let sourceAccountId;
let webIdentityToken; let webIdentityToken;
if (useExistingCredentials) { if (useExistingCredentials) {
const validCredentials = await areCredentialsValid(credentialsClient); const identity = await (async () => {
if (validCredentials) { try {
return await getCallerIdentity(credentialsClient.stsClient);
} catch {
return null;
}
})();
if (identity) {
validateAccountId(expectedAccountIds, identity.Account);
notice("Pre-existing credentials are valid. No need to generate new ones."); notice("Pre-existing credentials are valid. No need to generate new ones.");
if (timeoutId) clearTimeout(timeoutId); if (timeoutId) clearTimeout(timeoutId);
return; return;
+8 -8
View File
@@ -1,12 +1,12 @@
{ {
"name": "configure-aws-credentials", "name": "configure-aws-credentials",
"version": "6.2.3", "version": "6.2.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "configure-aws-credentials", "name": "configure-aws-credentials",
"version": "6.2.3", "version": "6.2.4",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^3.0.1", "@actions/core": "^3.0.1",
@@ -5179,9 +5179,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
"version": "4.2.0", "version": "4.3.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
"integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -5919,9 +5919,9 @@
} }
}, },
"node_modules/markdownlint-cli/node_modules/js-yaml": { "node_modules/markdownlint-cli/node_modules/js-yaml": {
"version": "5.2.1", "version": "5.2.3",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.3.tgz",
"integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==", "integrity": "sha512-n+mUVyUX5bVv7G/G2zyIHOhdxfuU1dY2NOFzTQUWiMUbFss8b57NFlgCCaggU78wSw5KVS9cllzeLyzyR+n5nw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "configure-aws-credentials", "name": "configure-aws-credentials",
"description": "A GitHub Action to configure AWS credentials", "description": "A GitHub Action to configure AWS credentials",
"version": "6.2.3", "version": "6.2.4",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"lint": "biome check --error-on-warnings ./src ./test && markdownlint -i node_modules -i CHANGELOG.md '**/*.md'", "lint": "biome check --error-on-warnings ./src ./test && markdownlint -i node_modules -i CHANGELOG.md '**/*.md'",