From b8c3721a3442c3fb309ecbee4a3a706ca17d409e Mon Sep 17 00:00:00 2001 From: girish-cheedala Date: Thu, 12 Mar 2026 23:25:35 +0530 Subject: [PATCH 1/2] docs: expand AWS integration methods to include Workload Identity Federation - Added a new integration method for AWS using Workload Identity Federation (WIF), emphasizing its security benefits and eliminating the need for long-lived credentials. - Updated the documentation to include detailed steps for setting up WIF, including creating an OIDC identity provider and associated roles. - Enhanced the prerequisites and benefits sections to provide clearer guidance for users. --- cloud/integrations.mdx | 295 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 264 insertions(+), 31 deletions(-) diff --git a/cloud/integrations.mdx b/cloud/integrations.mdx index c8576b3..af15bdb 100644 --- a/cloud/integrations.mdx +++ b/cloud/integrations.mdx @@ -784,11 +784,12 @@ By covering these services, ProjectDiscovery can map out a broad range of AWS as **AWS Integration Methods** -ProjectDiscovery supports three methods to connect to AWS, each suited for different use cases and security preferences: +ProjectDiscovery supports four methods to connect to AWS, each suited for different use cases and security preferences: 1. **Single AWS Account (Access Key & Secret)** – Direct credential-based authentication using an IAM User's Access Key ID and Secret Access Key to connect one AWS account. Choose this for quick setups or single-account monitoring. 2. **Multiple AWS Accounts (Assume Role)** – Use one set of credentials to assume roles in multiple accounts. This method is ideal for organizations with multiple AWS accounts (e.g. dev, prod, etc.). You provide one account's credentials and the common role name that exists in all target accounts. -3. **Cross-Account Role (Role ARN)** – Use a dedicated IAM role with an External ID for third-party access. This option lets you create a cross-account IAM role in your AWS account and grant ProjectDiscovery access via that role's Amazon Resource Name (ARN). This is the most secure integration method, as it follows AWS best practices for third-party account access. +3. **Cross-Account Role (Role ARN)** – Use a dedicated IAM role with an External ID for third-party access. This option lets you create a cross-account IAM role in your AWS account and grant ProjectDiscovery access via that role's Amazon Resource Name (ARN). +4. **Workload Identity Federation (Recommended)** – Connect without storing any AWS credentials. ProjectDiscovery's OIDC identity provider exchanges short-lived tokens with AWS for each scan. This is the most secure method — no long-lived keys to manage, rotate, or risk leaking. **Prerequisites** @@ -847,25 +848,117 @@ The most secure method using ProjectDiscovery's service account: - Give the integration a unique name - Select the AWS services you want to monitor -**Required Permissions** +#### 4. Workload Identity Federation (Recommended) -ProjectDiscovery needs read-only access to your AWS assets. The following AWS-managed policies are recommended: + +**Recommended.** Workload Identity Federation (WIF) eliminates long-lived AWS credentials entirely. ProjectDiscovery's OIDC identity provider exchanges short-lived tokens with AWS STS for each scan — no access keys are stored or need rotation. + -- EC2 - AmazonEC2ReadOnlyAccess -- Route53 - AmazonRoute53ReadOnlyAccess -- S3 - AmazonS3ReadOnlyAccess -- Lambda - AWSLambda_ReadOnlyAccess -- ELB - ElasticLoadBalancingReadOnly -- Cloudfront - CloudFrontReadOnlyAccess +**Benefits over credential-based methods:** +- No long-lived access keys to manage or rotate +- Tokens are short-lived and scoped per-scan +- Audit trail in AWS CloudTrail shows federated identity access +- Trust is scoped to your specific ProjectDiscovery workspace ID +- Follows AWS security best practices for third-party integrations -Alternatively, you can use this custom policy for minimal permissions: +**Prerequisites:** +- An AWS account with IAM admin access +- AWS CLI configured (`aws configure`) +- Your ProjectDiscovery **Team ID** (found in the platform sidebar) -```json + +**Finding your Team ID** — In the ProjectDiscovery platform, click on your team name in the left sidebar to reveal your Team ID. Use the copy button to copy it. + +Finding your Team ID in ProjectDiscovery + + +**Step 1: Create the OIDC Identity Provider** + +Register ProjectDiscovery as a trusted OIDC provider in your AWS account. + +```bash +aws iam create-open-id-connect-provider \ + --url "https://oidc.projectdiscovery.io" \ + --client-id-list "sts.amazonaws.com" +``` + +Save the OIDC Provider ARN from the output (e.g., `arn:aws:iam::123456789012:oidc-provider/oidc.projectdiscovery.io`). + +**Step 2: Create the WIF Role** + +Create an IAM role that ProjectDiscovery can assume via OIDC token exchange. The trust policy restricts access to your specific workspace. + +```bash +ACCOUNT_ID="YOUR_AWS_ACCOUNT_ID" +TEAM_ID="YOUR_PROJECTDISCOVERY_TEAM_ID" +OIDC_PROVIDER="oidc.projectdiscovery.io" + +cat > trust-policy.json < scanner-trust-policy.json < scanner-policy.json < +For **multiple accounts**, repeat [Step 3](#step-3-create-a-scanner-role) in each account you want to scan — the role name must be the same (`PDScannerRole`) across all accounts. Use [AWS CloudFormation StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html), Terraform, or similar infrastructure-as-code tools to deploy the scanner role across all accounts at once. + + +**Step 4: Grant the WIF Role AssumeRole Permission** + +Allow the WIF role to assume scanner roles. Use a wildcard to cover all accounts, or list specific account ARNs. + +```bash +cat > assume-scanner-policy.json < +For a single account, enter just that account's ID. For multiple accounts, list all account IDs — the scanner role must exist in each one. + + +--- + +**Optional: Organization Discovery** + +Instead of listing account IDs manually, you can have ProjectDiscovery automatically discover all accounts in your AWS Organization. + +**Step 6: Create an Organization Discovery Role** + + +This role must be created in the **management (root) account** of your AWS Organization — only the management account has permission to call `organizations:ListAccounts`. If the WIF role already lives in the management account, use the same account ID for both variables. + + +```bash +MANAGEMENT_ACCOUNT_ID="YOUR_MANAGEMENT_ACCOUNT_ID" # AWS Organization management account (use the same value as ACCOUNT_ID if WIF is in the management account) +ACCOUNT_ID="YOUR_AWS_ACCOUNT_ID" # Account where WIF role lives + +cat > org-discovery-trust-policy.json < org-policy.json < assume-org-discovery-policy.json < Date: Tue, 9 Jun 2026 12:34:45 +0530 Subject: [PATCH 2/2] docs: add scanner role warning to AWS org discovery section --- cloud/integrations.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cloud/integrations.mdx b/cloud/integrations.mdx index af15bdb..928a6ac 100644 --- a/cloud/integrations.mdx +++ b/cloud/integrations.mdx @@ -1135,6 +1135,12 @@ aws iam put-role-policy \ Leave **Account IDs** empty — accounts are discovered automatically. Click **Verify** to test the connection. + +**Scanner role is still required.** Organization Discovery only automates finding account IDs — the scanner role (`PDScannerRole` from [Step 3](#step-3-create-a-scanner-role)) must still exist in every account you want to scan. Use [AWS CloudFormation StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html), [Terraform](https://developer.hashicorp.com/terraform/tutorials/aws/aws-iam-policy), or [AWS Organizations delegated admin](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_delegate_policies.html) to deploy the scanner role across all accounts automatically. + +Accounts where the scanner role is missing will be silently skipped — no error is shown. To avoid blind spots, ensure the scanner role is deployed to all accounts before enabling org discovery. + + --- #### AWS Troubleshooting