Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions support/konnectivityproxy/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ func (kh *konnectivityHealth) isHealthy() bool {
// actually end up proxying or not depends on the env for this binary.
// DNS domains. The API list can be found below:
// AWS: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints
// AWS ISO: https://docs.aws.amazon.com/general/latest/gr/aws-iso_region.html
// AZURE: https://docs.microsoft.com/en-us/rest/api/azure/#how-to-call-azure-rest-apis-with-curl
// IBMCLOUD: https://cloud.ibm.com/apidocs/iam-identity-token-api#endpoints
func (p *konnectivityProxy) IsCloudAPI(host string) bool {
Expand All @@ -475,6 +476,9 @@ func (p *konnectivityProxy) IsCloudAPI(host string) bool {
return false
}
if strings.HasSuffix(host, ".amazonaws.com") ||
strings.HasSuffix(host, ".c2s.ic.gov") ||
strings.HasSuffix(host, ".hci.ic.gov") ||
strings.HasSuffix(host, ".sc2s.sgov.gov") ||
strings.HasSuffix(host, ".microsoftonline.com") ||
strings.HasSuffix(host, ".azure.com") ||
strings.HasSuffix(host, ".cloud.ibm.com") {
Expand Down
20 changes: 20 additions & 0 deletions support/konnectivityproxy/dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,26 @@ func TestIsCloudAPI(t *testing.T) {
description: "IBM Cloud API endpoints should be detected",
},

// Valid AWS ISO cloud API hosts
{
name: "When host is valid AWS ISO C2S API it should return true",
host: "s3.c2s.ic.gov",
expected: true,
description: "AWS ISO C2S endpoints should be detected",
},
{
name: "When host is valid AWS ISO HCI API it should return true",
host: "iam.hci.ic.gov",
expected: true,
description: "AWS ISO HCI endpoints should be detected",
},
{
name: "When host is valid AWS ISO-B SC2S API it should return true",
host: "s3.sc2s.sgov.gov",
expected: true,
description: "AWS ISO-B SC2S endpoints should be detected",
},

// False positive scenarios that were fixed
{
name: "When host contains azure.com but is not azure.com it should return false",
Expand Down
Loading