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.
This commit is contained in:
Tom Keller committed 2026-08-31 13:18:21 -07:00
1 parent 378a941623
commit a05dfa82bd
4 files changed
+63 -1

No files matched your search

+2 -1
View File
@@ -4,7 +4,7 @@ import { defaultProvider } from '@aws-sdk/credential-provider-node';
import type { AwsCredentialIdentity } from '@aws-sdk/types';
import { NodeHttpHandler } from '@smithy/node-http-handler';
import { ProxyAgent } from 'proxy-agent';
import { buildCustomUserAgent, errorMessage, getCallerIdentity } from './helpers';
import { buildCustomUserAgent, errorMessage, getCallerIdentity, maskProxyCredentials } from './helpers';
import { ProxyResolver } from './ProxyResolver';
if (!process.env.AWS_EXECUTION_ENV) {
@@ -32,6 +32,7 @@ export class CredentialsClient {
}
if (props.proxyServer) {
info('Configuring proxy handler for STS client');
maskProxyCredentials(props.proxyServer);
const proxyOptions: { httpProxy: string; httpsProxy: string; noProxy?: string } = {
httpProxy: props.proxyServer,
httpsProxy: props.proxyServer,