-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Checkov (3.2.368) crashes with KeyError: '__startline__'
when scanning restructured serverless YAML file
#7006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm having the same issue (serverless checks fail with the above error). Through trial and error I have found last working version to be 3.2.332. |
I have made this change for another project affected by it. |
@jbabala I tested with 3.2.332 and while it resolves the issue for either resources or functions, it doesn’t work for both at the same time. If I focus on modernizing resources, functions fail, and vice versa. |
This crash no longer happens with |
Hi @tsmithv11 Thanks for the update. I’ve just tested with 3.2.395 version and unfortunately, I’m still encountering the same issue/error as before (modularized Serverless files), hence would like to request to reopen this for further investigation. |
Hi @vish-space, thanks for the update. I'm not able to replicate the crash with the repo you provided. I'll reopen the issue to see if we can get a contribution. |
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
…ions - Improve yaml parsing wrt file() expansion - Add tests for file() expansion - Add a '__file__' marker attribute to yaml nodes - Utilize the '__file__' marker when generating reports for serverless - Raise CfnParseError on circular inclusions - Added a ``logger.error`` that logs specifics on pyyaml parse errors - Updated the serverless graph builder to cope with file() expansion Fixes bridgecrewio#7006
We've been using Checkov for serverless checks in our Bitbucket Pipelines CI/CD, and it has been working fine with our standard serverless configurations, scanning everything properly. However, after recently modularizing our serverless YAML files—splitting them into separate files for functions and resources, and referencing them in the main
serverless.yml
— Checkov started throwing errors during scans. Specifically, it seems unable to process the file references within the main YAML file. Since restructuring, Checkov consistently throws aKeyError: '__startline__'
when scanning. We've validated the YAML files using yamllint, and no syntax errors are present. The issue appears to be related to how Checkov handles modular serverless resources, and it persists even after addressing all reported YAML issues.Examples
checkov -f serverless.yml
Exception Trace
ran
LOG_LEVEL=debug checkov -d .
checkov --version 3.2.368
Desktop (please complete the following information):
Ubuntu 20.04.6
3.2.368
Additional context
The text was updated successfully, but these errors were encountered: