Serverless Security Scanning: A Release Workflow for Functions, Dependencies, and Event Triggers
serverless securityAWS LambdaAzure Functionscloud securitydependency scanningDevSecOps

Serverless Security Scanning: A Release Workflow for Functions, Dependencies, and Event Triggers

SScan Quest Editorial Team
2026-11-17
6 min read

A reusable serverless security scanning checklist for function code, dependencies, permissions, event triggers, APIs, packages, and infrastructure.

Serverless security scanning should cover more than function source code. Use this release workflow to check dependencies, permissions, secrets, event triggers, API exposure, deployment packages, and infrastructure definitions before a function reaches production.

Overview

Serverless applications reduce the operational work of running infrastructure, but they do not remove application security responsibilities. A Lambda function, Azure Function, or comparable cloud function can still contain vulnerable code, excessive permissions, exposed credentials, unsafe event handling, and insecure network or API configuration.

The most useful approach is layered automated security scanning. Run source analysis against the function code, software composition analysis against its dependencies, cloud configuration checks against permissions and settings, and API or dynamic tests against reachable endpoints. Scan infrastructure definitions and deployment artifacts as well, because the function’s behavior depends on how it is provisioned and invoked.

Do not treat every finding as an automatic release blocker. Classify findings by exploitability, exposure, data sensitivity, privilege, and whether the affected function is reachable in the intended environment. A risk-based workflow gives developers actionable results while preserving a clear record of accepted exceptions and remediation ownership.

For broader pipeline design, compare the roles of different scanners in the CI/CD security scanner decision matrix. If functions are packaged into images, apply the same principles in a container image security scanning workflow.

Checklist by scenario

For every new function

  • Inventory the function. Record its runtime, source repository, deployment method, owner, environment, event source, data handled, and public or private exposure.
  • Scan the source code. Use SAST or equivalent automated checks to identify unsafe input handling, injection risks, insecure deserialization, weak cryptographic use, authorization gaps, and error handling that may disclose sensitive details.
  • Scan dependencies. Generate a dependency inventory or SBOM where practical. Check direct and transitive packages, lockfiles, runtime libraries, and vendored code. Confirm that the deployment package contains the versions you reviewed rather than a different build output. See the SBOM vulnerability scanning workflow for a release-to-remediation model.
  • Inspect permissions. Review the function’s execution role or identity. Remove actions and resources that are not required for its task, and check permissions granted through attached policies, resource policies, or inherited roles.
  • Check configuration and secrets. Scan source, templates, build logs, and packaged artifacts for credentials, tokens, private keys, and connection strings. Store secrets in an appropriate managed mechanism and verify that logs do not expose them. The secret scanning remediation playbook covers detection through verified rotation.
  • Review the package. Check included files, native libraries, debug artifacts, test configuration, and generated assets. Remove unnecessary content and confirm that build steps are reproducible enough to explain what was deployed.

When a function handles an API request

  • Define expected authentication and authorization for every route, method, and operation.
  • Test whether a caller can access another user’s or tenant’s records by changing identifiers or request context.
  • Validate types, lengths, formats, and allowed values at the function boundary. Do not rely only on client-side validation.
  • Check rate, payload, timeout, and error behavior. Excessive responses, verbose errors, or unbounded input can create security and availability risk.
  • Run authenticated and unauthenticated DAST or API security tests against a non-production environment that reflects the deployed configuration. Use the API security scanning guide to build a repeatable pre-release set.

When a function is triggered by an event

  • Identify who or what can publish the event. Review queue, topic, storage, scheduler, database, webhook, and stream permissions.
  • Validate event content. Treat event payloads as untrusted input, including events generated by another internal service. Check object names, identifiers, URLs, metadata, and embedded commands.
  • Account for retries and duplicates. Confirm that the handler behaves safely when an event is delivered more than once, arrives late, or is processed after related data has changed.
  • Check failure paths. Review dead-letter destinations, retry policies, poison-message handling, and logs. Ensure failed events cannot expose sensitive payloads to an overly broad audience.
  • Review trigger scope. A storage notification or message subscription should receive only the events it needs. Narrow filters can reduce unintended processing and simplify monitoring.

For infrastructure and cloud configuration changes

  • Scan infrastructure-as-code for public access, broad identity permissions, unencrypted data stores, unrestricted network paths, exposed management interfaces, and missing logging or retention settings.
  • Review API gateways, function URLs, load balancers, storage notifications, queues, topics, and service-to-service trust relationships as one system.
  • Check environment-specific values. A secure test configuration does not prove that production variables, domains, identities, and network rules are equally restricted.
  • Record the deployed commit, template version, package digest, scanner results, and exceptions so that the release can be reconstructed during investigation or audit.

What to double-check

Before approving a release, compare scanner output with the actual deployment plan. A clean source scan cannot identify a public endpoint created by infrastructure code, and a clean configuration scan cannot prove that application authorization works correctly. These controls answer different questions.

Confirm that scanning covers the files and artifacts that will be deployed. Common scope gaps include generated code, optional production dependencies, layer contents, compiled binaries, deployment templates, and configuration injected only during the pipeline. If a scanner cannot inspect an artifact, document the limitation and add a compensating review or test.

Review findings in context. A vulnerable package in an unreachable development-only path may warrant different treatment from the same package in an internet-facing function that handles identity or payment data. Useful prioritization inputs include external exposure, sensitive data, execution privileges, exploit availability as assessed by your security process, reachability, and the presence of a practical mitigation.

Assign each accepted finding an owner, reason, compensating control, expiry or review date, and tracked follow-up. This turns a scan report into a security remediation workflow rather than a collection of unresolved alerts. For service-level guidance, see the risk-based vulnerability management SLA template.

Common mistakes

  • Scanning only source code. Serverless risk also lives in identities, event subscriptions, API gateways, packages, and deployment templates.
  • Trusting internal events. Internal systems can be misconfigured or compromised. Validate event data and enforce authorization at the handler.
  • Ignoring transitive dependencies. A package you did not import directly can still be included in the deployment artifact.
  • Putting secrets in environment variables without controls. Environment variables may be appropriate in some designs, but access, rotation, logging, and exposure paths still require review.
  • Making every finding a hard gate. Unscoped gates encourage bypasses and alert fatigue. Gate on defined high-risk conditions and route lower-risk findings to an owner with a due date.
  • Failing to baseline responsibly. A baseline can help distinguish new findings from accepted existing risk, but it should not hide changed reachability, increased privileges, or newly exposed data. The scan baseline and drift detection guide provides a practical model.
  • Skipping runtime verification. Static and configuration scans should be complemented by tests that exercise authentication, authorization, input validation, and event behavior in an environment close to production.

When to revisit

Run the full checklist for each new function, production release, runtime upgrade, dependency change, permission change, API route, or event-source integration. Recheck it after changing deployment tooling, infrastructure modules, identity patterns, network boundaries, secret-management practices, or scanner configuration.

Schedule a recurring inventory review as well. Compare the functions that exist in the cloud with the repositories and ownership records your team expects. Investigate abandoned functions, unknown triggers, stale roles, untracked endpoints, and drift between infrastructure definitions and deployed resources.

Before seasonal planning cycles, review scan coverage, release-gate exceptions, remediation age, recurring false positives, and functions without clear owners. When workflows or tools change, run a trial against representative functions and confirm that findings, artifacts, evidence, and notifications still reach the right teams.

A practical next step is to select one representative function from each trigger type your team uses. Run source, dependency, secret, infrastructure, permission, API, and artifact checks; document the findings-to-owner path; then define release gates for the risks your organization considers unacceptable. Repeat the exercise after the next meaningful platform or workflow change. For audit evidence and recurring control records, see the compliance-ready vulnerability management workflow.

Related Topics

#serverless security#AWS Lambda#Azure Functions#cloud security#dependency scanning#DevSecOps
S

Scan Quest Editorial Team

Security Engineering Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.