Skip to content
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

"WRN Failed to detect line" when scanning an Ansible role #6549

Closed
anappi-wex opened this issue Jul 26, 2023 · 1 comment · Fixed by #6553
Closed

"WRN Failed to detect line" when scanning an Ansible role #6549

anappi-wex opened this issue Jul 26, 2023 · 1 comment · Fixed by #6553
Labels
bug Something isn't working community Community contribution

Comments

@anappi-wex
Copy link

There seems to be an issue with the iam_access_analyzer_not_enabled query in v1.7.4 when scanning an Ansible role.

Expected Behavior

The scan finishes without error.

Actual Behavior

KICS reports errors like WRN Failed to detect line, query response Resources fileName=/workspace/test-role-1/tasks/main.yml queryName=iam_access_analyzer_not_enabled scanID=console.

This happens in v1.7.4 but not in v1.7.3.

Steps to Reproduce the Problem

  1. Clone the repo here or unzip Archive.zip
  2. From the project's root, run ansible-playbook playbook.yml

I included the debug logs in that repo as well in the file playbook.log.

This recreates the problem discussed here.

This seems to be a problem with the variables in vars/main.yml.
This was the minimal set of vars and values that I could narrow it down to:

---
my_var: provider:a
service: foo

As weird as it sounds, if you delete a character from "provider" or "service", it works again.
Same if you delete ":a".

Specifications

  • Version: 1.7.4
  • Platform: N/A
  • Subsystem: N/A
@anappi-wex anappi-wex added bug Something isn't working community Community contribution labels Jul 26, 2023
@pereiramarco011
Copy link
Contributor

Hello @anappi-wex ,

First of all, thank you for bringing this issue to our attention.

After analyzing the situation, the query in question is not working as expected, it assumes that the ''Resources'' property is present in all yaml/json files, which it obviously is not. I will fix it and link your issue to the corresponding PR.

Marco Pereira

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants