Skip to content

Commit

Permalink
fic(url): supported inspector url
Browse files Browse the repository at this point in the history
  • Loading branch information
maira-samtek committed Jul 17, 2024
1 parent c9853fb commit 4153d69
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/macpro-security-hub-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,19 @@ export class SecurityHubJiraSync {
return Table;
}
createSecurityHubFindingUrlThroughFilters(findingId: string) {
const arnParts = findingId.split(":");
const region = arnParts[3];
const accountId = arnParts[4];
let region, accountId;

if (findingId.startsWith("arn:")) {
// Extract region and account ID from the ARN
const arnParts = findingId.split(":");
region = arnParts[3];
accountId = arnParts[4];
} else {
// Extract region and account ID from the non-ARN format
const parts = findingId.split("/");
region = parts[1];
accountId = parts[2];
}

const baseUrl = `https://${region}.console.aws.amazon.com/securityhub/home?region=${region}`;
const searchParam = `Id%3D%255Coperator%255C%253AEQUALS%255C%253A${findingId}`;
Expand Down

0 comments on commit 4153d69

Please sign in to comment.