Skip to content

Commit

Permalink
Merge branch 'main' into cf-global-support
Browse files Browse the repository at this point in the history
  • Loading branch information
omriyoffe-panw committed Aug 20, 2024
2 parents 07ba599 + ea3ab62 commit 2864c12
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# CHANGELOG

## [Unreleased](https://github.com/bridgecrewio/checkov/compare/3.2.230...HEAD)
## [Unreleased](https://github.com/bridgecrewio/checkov/compare/3.2.232...HEAD)

## [3.2.232](https://github.com/bridgecrewio/checkov/compare/3.2.230...3.2.232) - 2024-08-19

### Bug Fix

- **general:** add try except to loads file - [#6668](https://github.com/bridgecrewio/checkov/pull/6668)
- **secrets:** duplications suppressions for secrets - [#6665](https://github.com/bridgecrewio/checkov/pull/6665)

## [3.2.230](https://github.com/bridgecrewio/checkov/compare/3.2.228...3.2.230) - 2024-08-18

Expand Down
9 changes: 6 additions & 3 deletions checkov/ansible/graph_builder/local_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ def get_files_definitions(root_folder: str | Path) -> dict[str | Path, dict[str,
file_paths = get_scannable_file_paths(root_folder=root_folder)

for file_path in file_paths:
result = parse_file(f=file_path)
if result is not None:
definitions[file_path] = result[0]
try:
result = parse_file(f=file_path)
if result is not None:
definitions[file_path] = result[0]
except Exception as err:
logging.warning(f'fail to pars file {file_path}, {err}')

return definitions
10 changes: 6 additions & 4 deletions checkov/common/parsers/yaml/loader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import logging
from collections.abc import Hashable
from pathlib import Path
from typing import Any, TYPE_CHECKING
Expand All @@ -17,13 +18,14 @@ def loads(content: str) -> list[dict[str, Any]]:
"""
Load the given YAML string
"""

template = list(yaml.load_all(content, Loader=SafeLineLoader))

try:
template = list(yaml.load_all(content, Loader=SafeLineLoader))
except Exception as e:
logging.warning(f'Fail to load yaml content, {e}')
template = [None]
# Convert an empty file to an empty dict
if template is None:
template = {}

return template


Expand Down
2 changes: 1 addition & 1 deletion checkov/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '3.2.230'
version = '3.2.233'
2 changes: 1 addition & 1 deletion kubernetes/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
checkov==3.2.230
checkov==3.2.233

0 comments on commit 2864c12

Please sign in to comment.