sdkagent

checkov API reference

94 public APIs from checkov (bridgecrewio/checkov) — 16 classes, 56 functions, 22 methods. Signatures extracted by static analysis of the actual source.

Repository: bridgecrewio/checkov

KindCount
Classes16
Functions56
Methods22

API list

funccheckov.ansible.utils.get_scannable_file_paths(root_folder:str | Path) -> set[Path]
Finds yaml files
classcheckov.arm.context_parser.ContextParser
ARM template context parser
methodcheckov.arm.context_parser.ContextParser.search_deep_keys(search_text:str, arm_dict:dict[str, Any], path:list[str | int]) -> list[list[Any]]
Search deep for keys and get their values
funccheckov.arm.parser.parser.load(filename:Path | str) -> tuple[dict[str, Any], list[tuple[int, str]]]
Load the given JSON/YAML file
funccheckov.arm.parser.parser.parse(filename:str) -> tuple[dict[str, Any], list[tuple[int, str]]] | tuple[None, None]
Decode filename into an object
methodcheckov.arm.runner.Runner.add_graph_check_results(report:Report, runner_filter:RunnerFilter) -> None
Adds graph check results to given report
methodcheckov.arm.runner.Runner.add_python_check_results(report:Report, runner_filter:RunnerFilter, root_folder:str | None) -> None
Adds Python check results to given report
funccheckov.arm.utils.get_scannable_file_paths(root_folder:str | None=None, excluded_paths:list[str] | None=None) -> set[str]
Finds ARM files
methodcheckov.bicep.runner.Runner.add_graph_check_results(report:Report, runner_filter:RunnerFilter) -> None
Adds YAML check results to given report
methodcheckov.bicep.runner.Runner.add_python_check_results(report:Report, runner_filter:RunnerFilter, root_folder:str | Path | None) -> None
Adds Python check results to given report
funccheckov.bicep.utils.get_scannable_file_paths(root_folder:str | Path | None=None, files:list[str] | None=None, excluded_paths:list[str] | None=None) -> set[Path]
Finds Bicep files
classcheckov.cloudformation.context_parser.ContextParser
CloudFormation template context parser
classcheckov.cloudformation.parser.cfn_yaml.CfnParseError
Error thrown when the template contains Cfn Error
classcheckov.cloudformation.parser.cfn_yaml.MarkedLoader
Class for marked loading YAML
classcheckov.cloudformation.parser.cfn_yaml.NodeConstructor
Node Constructors for loading different types in Yaml
methodcheckov.cloudformation.parser.cfn_yaml.NodeConstructor.construct_yaml_null_error(node:Node) -> NoReturn
Throw a null error
funccheckov.cloudformation.parser.cfn_yaml.construct_getatt(node:ScalarNode) -> ListNode
Reconstruct !GetAtt into a list
funccheckov.cloudformation.parser.cfn_yaml.load(filename:str | Path, content_type:ContentType | None) -> tuple[dict[str, Any], list[tuple[int, str]]]
Load the given YAML file
funccheckov.cloudformation.parser.cfn_yaml.loads(yaml_string:str, fname:str, content_type:ContentType | None=None) -> DictNode | dict[str, Any]
Load the given YAML string
funccheckov.cloudformation.parser.cfn_yaml.multi_constructor(loader:MarkedLoader, tag_suffix:str, node:ScalarNode) -> DictNode
Deal with !Ref style function format
funccheckov.cloudformation.parser.parse(filename:str, out_parsing_errors:Optional[Dict[str, str]]=None) -> tuple[dict[str, Any] | list[dict[str, Any]], list[tuple[int, str]]] | tuple[None, None]
Decode filename into an object
funccheckov.common.external_checks.verification.sources_registry.verify_and_register(dirs:Iterable[str], public_key_paths:List[str]) -> None
No-op when ``public_key_paths`` is empty.
funccheckov.common.external_checks.verification.verified_loader.uninstall_finder(finder:VerifiedSourcesFinder) -> None
Idempotent — second call is a silent no-op.
methodcheckov.common.graph.graph_builder.graph_components.blocks.Block.update_list_attribute(attribute_key:str, attribute_value:Any) -> None
Updates list attributes with their index
classcheckov.common.images.image_referencer.ImageReferencerMixin
Mixin class to simplify image reference search
funccheckov.common.images.image_referencer.fix_related_resource_ids(report:Report | None, tmp_dir:str) -> None
Remove tmp dir prefix from 'relatedResourceId'
funccheckov.common.output.cyclonedx.file_sha1sum(filename:str) -> str
Generate a SHA1 hash of the provided file.
methodcheckov.common.output.report.Report.get_test_suite(properties:Optional[Dict[str, Any]]=None, use_bc_ids:bool=False) -> TestSuite
Creates a test suite for the JUnit XML report
methodcheckov.common.parsers.json.decoder.Decoder.decode(s:str, _w:Callable[..., Any] | None=None) -> Any
Overridden to retrieve indexes
classcheckov.common.parsers.json.decoder.Mark
Mark of line and column
funccheckov.common.parsers.json.decoder.count_occurrences(arr:Sequence[int], key:int) -> int
Binary search indexes to replace str.count
funccheckov.common.parsers.json.decoder.find_indexes(s:str, ch:str='\n') -> list[int]
Finds all instances of given char and returns list of indexes
funccheckov.common.parsers.json.decoder.get_beg_end_mark(s:str, start:int, end:int, indexes:list[int]) -> tuple[Mark, Mark]
Get the Start and End Mark
funccheckov.common.parsers.json.decoder.largest_less_than(indexes:list[int], line_num:int, pos:int) -> int
Replacement func for python str.rfind using indexes
funccheckov.common.parsers.json.decoder.scan_once(string:str, idx:int) -> tuple[Any, int]
Scan Once
classcheckov.common.parsers.json.errors.DuplicateError
Error thrown when the template contains duplicates
classcheckov.common.parsers.json.errors.NullError
Error thrown when the template contains Nulls
funccheckov.common.parsers.json.load(filename:str | Path, allow_nulls:bool=True, content:str | None=None) -> tuple[dict[str, Any], list[tuple[int, str]]]
Load the given JSON file
classcheckov.common.parsers.node.DictNode
Node class created based on the input class
methodcheckov.common.parsers.node.DictNode.get(key:str, default:Any=None) -> Any
Override the default get
methodcheckov.common.parsers.node.DictNode.get_safe(key:str, default:Any=None, path:list[str] | None=None, type_t:Type[tuple[Any, ...]]=tuple) -> list[tuple[tuple[Any, ...], list[str]]]
Get values in format
methodcheckov.common.parsers.node.DictNode.items_safe(path:list[int | str] | None=None, type_t:Type[tuple[Any, ...]]=tuple) -> Generator[tuple[Any, ...], Any, None]
Get items while handling IFs
classcheckov.common.parsers.node.ListNode
Node class created based on the input class
methodcheckov.common.parsers.node.ListNode.items_safe(path:list[int | str] | None=None, type_t:Type[tuple[Any, ...]]=tuple) -> Generator[tuple[Any, ...], Any, None]
Get items while handling IFs
classcheckov.common.parsers.node.StrNode
Node class created based on the input class
classcheckov.common.parsers.node.TemplateAttributeError
Custom error to capture Attribute Errors in the Template
funccheckov.common.parsers.yaml.loader.load(filename:str | Path, content:str | None=None) -> tuple[list[dict[str, Any]], list[tuple[int, str]]]
Load the given YAML file
funccheckov.common.parsers.yaml.loader.loads(content:str) -> list[dict[str, Any]]
Load the given YAML string
funccheckov.common.runners.base_runner.strtobool(val:str) -> int
Convert a string representation of truth to true (1) or false (0).
methodcheckov.common.runners.object_runner.Runner.add_graph_check_results(report:Report, runner_filter:RunnerFilter) -> None
Adds graph check results to given report
methodcheckov.common.runners.object_runner.Runner.add_inline_suppression(check:BaseGraphCheck, entity:dict[str, Any], check_result:_CheckResult) -> None
Adjusts check result, if inline suppressed
funccheckov.common.util.data_structures_utils.merge_dicts(*dicts:dict[_T, Any]) -> dict[_T, Any]
Merges two or more dicts.
funccheckov.common.util.data_structures_utils.pickle_deepcopy(obj:_T) -> _T
More performant version of the built-in deepcopy
funccheckov.common.util.decorators.time_it(func:Callable[P, T]) -> Callable[P, T]
Prints the time it took to execute the function
funccheckov.common.util.deep_merge.overwrite(v1:_T, v2:_T, **kwargs:Any) -> _T
Completely overwrites one value with another.
funccheckov.common.util.file_utils.read_file_with_any_encoding(file_path:str | Path) -> str
Read the file with the system encoding and then try to detect it
funccheckov.common.util.http_utils.valid_url(url:str | None) -> bool
Checks for a valid URL, otherwise returns False
funccheckov.common.util.parser_utils.find_var_blocks(value:str) -> List[VarBlockMatch]
Find and return all the var blocks within a given string.
funccheckov.common.util.parser_utils.split_merge_args(value:str) -> list[str] | None
Split arguments of a merge function.
funccheckov.common.util.secrets.is_hash(s:str) -> bool
Checks whether a string is a MD5 or SHA1 hash :param s: :return:
funccheckov.common.util.stopit.threadstop.async_raise(target_tid:int, exception:type[Exception]) -> None
Raises an asynchronous exception in another thread.
funccheckov.common.util.type_forcers.convert_prisma_policy_filter_to_params(filter_string:str) -> List[Tuple[str, str]]
Converts the filter string to a list of tuples.
funccheckov.common.util.type_forcers.force_dict(obj:Any) -> dict[str, Any] | None
If the specified object is a dict, returns the object.
classcheckov.common.util.update_checker.update_checker.UpdateChecker
A class to check for package updates.
funccheckov.common.util.update_checker.update_checker.parse_version(s:str) -> tuple[str, ...]
Convert a version string to a chronologically-sortable key.
funccheckov.common.util.update_checker.update_checker.pretty_date(the_datetime:datetime) -> str
Attempt to return a human-readable time delta string.
funccheckov.common.util.update_checker.update_checker.wrapped(obj:UpdateChecker, package_name:str, package_version:str, **extra_data:Any) -> UpdateResult | None
Return cached results if available.
methodcheckov.dockerfile.runner.Runner.add_graph_check_results(report:Report, runner_filter:RunnerFilter, root_folder:str | None) -> None
Adds graph check results to given report
methodcheckov.dockerfile.runner.Runner.add_python_check_results(report:Report, runner_filter:RunnerFilter, root_folder:str | None) -> None
Adds Python check results to given report
funccheckov.dockerfile.utils.get_abs_path(root_folder:str | None, file_path:str) -> str
Creates the abs path There are a few cases here.
funccheckov.dockerfile.utils.get_scannable_file_paths(root_folder:str | Path | None=None, excluded_paths:list[str] | None=None) -> set[str]
Finds Dockerfiles
funccheckov.github_actions.utils.get_scannable_file_paths(root_folder:str | Path) -> set[Path]
Finds yaml files
funccheckov.github_actions.utils.get_workflow_dir() -> str
Detects os and uses different dir string
methodcheckov.gitlab.dal.Gitlab.discover() -> None
discover parameters from execution context of checkov.
funccheckov.kubernetes.parser.k8_json.load(filename:Path) -> Tuple[List[Dict[str, Any]], List[Tuple[int, str]]]
Load the given JSON file
funccheckov.kubernetes.parser.k8_json.loads(content:str) -> list[dict[str, Any]]
Load the given JSON string
funccheckov.kubernetes.parser.k8_yaml.load(filename:Path) -> Tuple[List[Dict[str, Any]], List[Tuple[int, str]]]
Load the given YAML file
funccheckov.kubernetes.parser.k8_yaml.loads(content:str) -> List[Dict[str, Any]]
Load the given YAML string
methodcheckov.openapi.runner.Runner.is_valid(conf:dict[str, Any] | list[dict[str, Any]] | None) -> bool
validate openAPI configuration.
methodcheckov.sca_package_2.runner.Runner.upload_package_files(root_path:Path | None, files:list[str] | None, excluded_paths:set[str], excluded_file_names:set[str] | None=None) -> List[FileToPersist] | None
upload package files to s3
methodcheckov.sca_package_2.scanner.Scanner.scan() -> dict[str, Any] | None
run SCA package scan and poll scan results
funccheckov.secrets.git_history_store.get_secret_key(file_name:str, secret_hash:str, secret_type:str) -> str
One way to create a secret key for the secret map
funccheckov.secrets.log_prefix_stripper.strip_log_prefix(line:str) -> str
Strip common build log prefixes from a single line.
funccheckov.secrets.log_prefix_stripper.strip_log_prefixes_from_content(content:str) -> str
Strip log prefixes from all lines in file content.
classcheckov.serverless.parsers.context_parser.ContextParser
serverless functions template context parser
funccheckov.terraform.context_parsers.tf_plan.parse(filename:str, out_parsing_errors:dict[str, str]) -> tuple[dict[str, Any], list[tuple[int, str]]] | tuple[None, None]
Decode filename into an object
funccheckov.terraform.graph_builder.variable_rendering.evaluate_terraform.find_conditional_expression_groups(input_str:str) -> Optional[Tuple[List[str], int, int]]
from condition ?
funccheckov.terraform.graph_builder.variable_rendering.renderer.create_variable_key_path(key_path:list[str]) -> str
Returns the key_path without the var prefix ex.
methodcheckov.terraform.module_loading.loader.ModuleLoader.discover(module_params:ModuleParams) -> None
discover parameters from execution context of checkov.
classcheckov.terraform.module_loading.loaders.versions_parser.VersionConstraint
A class representing a module version.
funccheckov.terraform.module_loading.module_finder.find_tf_managed_modules(path:str) -> List[ModuleDownload]
Leverage modules.json to better inform discovery.
funccheckov.terraform_json.parser.loads(file_path:Path) -> tuple[dict[str, Any], list[tuple[int, str]]]
Loads the given JSON file with line numbers
funccheckov.terraform_json.parser.parse(file_path:Path) -> tuple[dict[str, Any], list[tuple[int, str]]] | tuple[None, None]
Parse file to dict object
funccheckov.terraform_json.utils.get_scannable_file_paths(root_folder:str | Path | None=None, files:list[str] | None=None, excluded_paths:list[str] | None=None) -> set[Path]
Finds Terraform JSON files

About this data

These signatures were extracted from the public source of bridgecrewio/checkov using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries