Skip to content

Worked example: Cloud API inventory

Scan a real public repository, inspect the JSON, and use the result in a code or IAM review. This example uses AWS Samples' Lambda Extensions repository at commit cfed93e, so the source is fixed even as the upstream project changes.

The output below was verified with CCE 0.0.38. No AWS credentials or deployed application are needed: CCE reads source code and does not execute the repository.

1. Clone and scan

git clone https://github.com/aws-samples/aws-lambda-extensions.git
cd aws-lambda-extensions
git checkout cfed93e212d6415115d6a0a8a10885cded5a2b3b

cce -folder . -language PYTHON -filter cloud \
  -format json -output cce-results.json

The complete report contains every emitted row. This jq command keeps the summary and one complete Secrets Manager call site for a readable excerpt:

jq '{
  files_scanned,
  summary,
  example: (.entitlements[] | select(
    (.file | contains("opensearch")) and
    .operation == "get_secret_value"
  ))
}' cce-results.json

2. Read the output

{
  "files_scanned": 313,
  "summary": {
    "total_entitlements": 10,
    "by_provider": {
      "AWS": 10
    }
  },
  "example": {
    "provider": "AWS",
    "resource": "secretsmanager",
    "operation": "get_secret_value",
    "file": "python-example-telemetry-opensearch-extension/python-example-telemetry-opensearch-extension/telemetry_dispatcher.py",
    "line": 19,
    "column": 19,
    "method": "boto3.client('secretsmanager').get_secret_value",
    "signature": "sm_client.get_secret_value(SecretId=os.getenv('AUTH_SECRET'))",
    "import_path": "boto3.client('secretsmanager')"
  }
}

The excerpt is real output, not a mock report. Download the complete, unabridged JSON report produced by the released CCE 0.0.38 image, or expand the full report below.

The ten rows comprise four API operation rows (two get_secret_value and two put_object), four client-construction rows, and two S3 Bucket accessor rows. Constructors and accessors help explain SDK resolution, but are not cloud operations to request as IAM permissions. Both S3 put_object rows have resource: "s3" and a populated operation; no row uses an argument such as Key=s3_filename as a resource.

Field What it means Why it is useful
files_scanned Number of source files examined for the selected language. Shows the analysis scope; it is not a count of cloud calls.
summary.total_entitlements Number of emitted evidence rows after mapping and filtering. Measures inventory size. Rows are not deduplicated operations or permissions.
summary.by_provider Evidence-row counts grouped by normalized cloud provider. Gives a quick provider breakdown for triage.
provider The normalized provider identified from the SDK and mapping rules. Lets teams aggregate usage across languages and repositories.
resource The normalized cloud service or resource family. Identifies Secrets Manager as the service involved.
operation The recognized SDK operation, when CCE can resolve one. Tells a reviewer which API action to investigate. Construction-only rows can omit this field.
file, line, column Repository-relative source location of the call. Takes a reviewer directly to the evidence and makes base/head comparisons portable.
method The resolved SDK call chain matched by CCE. Explains why this source expression received the mapping.
signature The original call expression at that location. Preserves local context for review without opening the parser output.
import_path The resolved import or client-construction path. Helps distinguish SDKs and diagnose unexpected mappings.

Open the source line at the pinned commit to compare the evidence with the code.

View the complete JSON report (all 10 rows)
{
  "files_scanned": 313,
  "entitlements": [
    {
      "provider": "AWS",
      "resource": "secretsmanager",
      "operation": "get_secret_value",
      "file": "python-example-telemetry-opensearch-extension/python-example-telemetry-opensearch-extension/telemetry_dispatcher.py",
      "line": 19,
      "column": 19,
      "method": "boto3.client('secretsmanager').get_secret_value",
      "signature": "sm_client.get_secret_value(SecretId=os.getenv('AUTH_SECRET'))",
      "import_path": "boto3.client('secretsmanager')"
    },
    {
      "provider": "AWS",
      "resource": "secretsmanager",
      "file": "python-example-telemetry-opensearch-extension/python-example-telemetry-opensearch-extension/telemetry_dispatcher.py",
      "line": 13,
      "column": 13,
      "method": "boto3.client",
      "signature": "boto3.client('secretsmanager')",
      "import_path": "boto3"
    },
    {
      "provider": "AWS",
      "resource": "secretsmanager",
      "operation": "get_secret_value",
      "file": "python-example-telemetry-prometheus-extension/python-example-telemetry-prometheus-extension/telemetry_dispatcher.py",
      "line": 36,
      "column": 19,
      "method": "boto3.client('secretsmanager').get_secret_value",
      "signature": "sm_client.get_secret_value(SecretId=os.getenv('AUTH_SECRET'))",
      "import_path": "boto3.client('secretsmanager')"
    },
    {
      "provider": "AWS",
      "resource": "secretsmanager",
      "file": "python-example-telemetry-prometheus-extension/python-example-telemetry-prometheus-extension/telemetry_dispatcher.py",
      "line": 33,
      "column": 13,
      "method": "boto3.client",
      "signature": "boto3.client('secretsmanager')",
      "import_path": "boto3"
    },
    {
      "provider": "AWS",
      "resource": "s3",
      "operation": "Bucket",
      "file": "s3-logs-extension-demo-container-image/extension/extensionssrc/extensions/logs_api_http_extension.py",
      "line": 91,
      "column": 32,
      "method": "boto3.resource('s3').Bucket",
      "signature": "s3.Bucket(s3_bucket)",
      "parent_function": "LogsAPIHTTPExtension.run_forever",
      "import_path": "boto3.resource('s3')"
    },
    {
      "provider": "AWS",
      "resource": "s3",
      "operation": "put_object",
      "file": "s3-logs-extension-demo-container-image/extension/extensionssrc/extensions/logs_api_http_extension.py",
      "line": 91,
      "column": 32,
      "method": "boto3.resource('s3').Bucket(s3_bucket).put_object",
      "signature": "s3.Bucket(s3_bucket).put_object(Key=s3_filename, Body=str(batch))",
      "parent_function": "LogsAPIHTTPExtension.run_forever",
      "import_path": "boto3.resource('s3').Bucket(s3_bucket)"
    },
    {
      "provider": "AWS",
      "resource": "s3",
      "file": "s3-logs-extension-demo-container-image/extension/extensionssrc/extensions/logs_api_http_extension.py",
      "line": 67,
      "column": 14,
      "method": "boto3.resource",
      "signature": "boto3.resource('s3')",
      "parent_function": "LogsAPIHTTPExtension.run_forever",
      "import_path": "boto3"
    },
    {
      "provider": "AWS",
      "resource": "s3",
      "operation": "put_object",
      "file": "s3-logs-extension-demo-zip-archive/extensionssrc/extensions/logs_api_http_extension.py",
      "line": 91,
      "column": 32,
      "method": "boto3.resource('s3').Bucket(s3_bucket).put_object",
      "signature": "s3.Bucket(s3_bucket).put_object(Key=s3_filename, Body=str(batch))",
      "parent_function": "LogsAPIHTTPExtension.run_forever",
      "import_path": "boto3.resource('s3').Bucket(s3_bucket)"
    },
    {
      "provider": "AWS",
      "resource": "s3",
      "operation": "Bucket",
      "file": "s3-logs-extension-demo-zip-archive/extensionssrc/extensions/logs_api_http_extension.py",
      "line": 91,
      "column": 32,
      "method": "boto3.resource('s3').Bucket",
      "signature": "s3.Bucket(s3_bucket)",
      "parent_function": "LogsAPIHTTPExtension.run_forever",
      "import_path": "boto3.resource('s3')"
    },
    {
      "provider": "AWS",
      "resource": "s3",
      "file": "s3-logs-extension-demo-zip-archive/extensionssrc/extensions/logs_api_http_extension.py",
      "line": 67,
      "column": 14,
      "method": "boto3.resource",
      "signature": "boto3.resource('s3')",
      "parent_function": "LogsAPIHTTPExtension.run_forever",
      "import_path": "boto3"
    }
  ],
  "summary": {
    "total_entitlements": 10,
    "by_provider": {
      "AWS": 10
    }
  }
}

3. Use the evidence

For this row, a reviewer can see that the extension reads a secret whose identifier comes from AUTH_SECRET. The corresponding AWS permission to evaluate is secretsmanager:GetSecretValue. The reviewer still needs to choose the allowed secret ARN, confirm the Lambda execution role, and validate the runtime requirement.

Use the inventory to:

  • answer which cloud services and SDK operations appear in the repository;
  • link an IAM access request back to exact source evidence;
  • compare revisions and review added or removed operations in a pull request;
  • export selected findings as SARIF or feed JSON into your own inventory tooling.

For a deduplicated review artifact, run:

cce access-request . \
  --service lambda-extensions \
  --commit cfed93e212d6415115d6a0a8a10885cded5a2b3b \
  --output cce-access-request.json

Access requests include only complete provider/resource/operation rows and add call-site counts and mapping provenance. That makes them more suitable for IAM review than treating every inventory row as a separate permission.

Run the same repository with GitHub Actions

Add this workflow to any repository where you want to try CCE Action. The explicit checkout selects the public example repository instead of the caller repository:

name: CCE public repository example
on: workflow_dispatch
permissions:
  contents: read
  packages: read
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          repository: aws-samples/aws-lambda-extensions
          ref: cfed93e212d6415115d6a0a8a10885cded5a2b3b
      - uses: stackgenhq/cce-action@v1
        with:
          language: PYTHON
          filter: cloud
          output-dir: cce-results
      - uses: actions/upload-artifact@v4
        with:
          name: cce-public-repo-results
          path: cce-results/*

Run the workflow manually and download cce-public-repo-results. The reusable scan workflow is more convenient when scanning the repository that owns the workflow; this composite-action example deliberately checks out a different public repository.

Copy the workflow from CCE Action

Evidence, not a permission grant

Static analysis does not prove that a call executes, cover dynamic or unrecognized calls, read secret values, or test effective IAM. An empty report does not prove absence. Use the result as review evidence alongside runtime testing and human approval; do not deploy it directly as a least-privilege policy.