question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

checkov.cloudformation.parser.node.TemplateAttributeError: list_node.items is invalid

See original GitHub issue

Hi, I’m running Checkov as part of a pipeline using the ubuntu-latest image and install python 3.7 to run Checkov. I’m getting the following error using the example Github action script:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.7.9/x64/bin/checkov", line 5, in <module>
    run()
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/checkov/main.py", line 66, in run
    files=file, guidelines=guidelines)
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/checkov/common/runners/runner_registry.py", line 28, in run
    runner_filter=self.runner_filter, collect_skip_comments=collect_skip_comments)
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/checkov/cloudformation/runner.py", line 57, in run
    for resource_name, resource in definitions[cf_file]['Resources'].items():
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/checkov/cloudformation/parser/node.py", line 202, in __getattr__
    raise TemplateAttributeError('%s.%s is invalid' % (self.__class__.__name__, name))
checkov.cloudformation.parser.node.TemplateAttributeError: list_node.items is invalid
Error: Process completed with exit code 1.

Github actions:

     - name: Set up Python 3.7
        uses: actions/setup-python@v1
        with:
          python-version: 3.7

      - name: Checkov tests
        run: |
          pip install checkov
          checkov -d .

I’ve tried using pip, pip3, upgrading and also installing setup-tools to help install extra deps. Is there anything else I can do?

To Reproduce Steps to reproduce the behavior:

  1. Create a github action with the above script

Expected behavior Checkov runs tests successfully and installs relevant dependencies

Desktop (please complete the following information):

  • OS: ubuntu-latest / Github Action container image.
  • Checkov Version : latest

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dannyburke1commented, Oct 15, 2020

Good morning @metahertz ! Hope you’re keeping safe from Covid in Manchester. 😃

Yeah, sure. I’ll send it over. Just received the Slack invite now. Thanks!

0reactions
dannyburke1commented, Oct 29, 2020

@nimrodkor sorry for the delay. I’ve still not tried this out yet and I’m annual leave next week, we can close this if you want as I have a workaround by ignoring those directories but I’ll be sure to try it without ignoring them and reporting back via Slack or something if I do encounter any issues. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve template validation or template format errors in ... - AWS
This returns the following error: "Template validation error: Invalid template property or properties [Bucket]." This error is caused because ...
Read more >
Receiving a parsing error while using Checkov - Stack Overflow
The parsing error occurs since checkov tries to scan the json plan file assuming it's cloudformation json and fails.
Read more >
checkov/main.py at main · bridgecrewio/checkov - GitHub
Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov ...
Read more >
Cloudformation configuration scanning - checkov
When using checkov to scan a directory that contains a Cloudformation template it will validate if the file is compliant with AWS best...
Read more >
"Failed to run check" on azurerm_kubernetes_cluster issue ...
{name} is invalid') checkov.common.parsers.node.TemplateAttributeError: <function ListNode.__name__ at 0x7f7369c16550>.get is invalid Session terminated, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found