Skip to content

bug(linux): nginx.conf file scanning error out for "=" and ":" characters #7474

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

Open
bsangwan opened this issue May 20, 2025 · 0 comments
Open
Labels
ansible Ansible query bug Something isn't working community Community contribution docker Docker query query New query feature

Comments

@bsangwan
Copy link

Found a bug? You're welcome to GitHub Discussions

  • Please make sure to:
    • Describe in details what the problem is
      When I scan nginx.conf file following 2 lines creates parsing error
      add_header X-XSS-Protection "1; mode=block" always; << in Server block
      proxy_pass http://localhost:8080/; << in Location block

    • Attach a log file with relevant data preferably in DEBUG level (--log-level=DEBUG)

7:47PM INF Scanning with Keeping Infrastructure as Code Secure v2.1.7
7:47PM INF Operating system: linux
7:47PM INF Total memory: 1.9G
7:47PM INF CPU: 12.0
7:47PM INF Max file size permitted for scanning: 5 MB
7:47PM INF Max resolver depth permitted for resolving files: 15
7:47PM INF Total files in the project: 1
7:47PM INF Loading queries of type: ansible
7:47PM INF Inspector initialized, number of queries=285
7:47PM INF Query execution timeout=1m0s
Preparing Scan Assets: Done
7:47PM ERR failed to parse file content: /tmp/templates/nginx.conf error="missing section header: 68 proxy_pass http://localhost8080/;"
Executing queries: [---------------------------------------------------] 100.00%

  • Attach the scanned sample files, anonymize the data if the original file cannot be provided
  • When attaching files to the issue make sure they are properly formatted

Expected Behavior

Scan should succeed

(Which results are expected from KICS?)

Actual Behavior

(Formatted logs and samples helps us to better understand the issue)

Err => failed to parse file contents

Steps to Reproduce the Problem

(Command line arguments and flags used)

  1. Scan any nginx conf file by adding
    add_header X-XSS-Protection "1; mode=block" always; << in Server block
    proxy_pass http://localhost:8080/; << in Location block
  2. Kicks will fail to parse.
  3. Remove "=" and ":" characters from these lines. Scanning will succeed.

Specifications

(N/A if not applicable)

  • Version: 2.1.7
  • Platform: Linux
  • Subsystem: Docker image
@bsangwan bsangwan added bug Something isn't working community Community contribution labels May 20, 2025
@github-actions github-actions bot added query New query feature ansible Ansible query docker Docker query labels May 20, 2025
@bsangwan bsangwan changed the title bug: Nginx.conf file scanning error out for "=" and ":" characters bug<linux>: nginx.conf file scanning error out for "=" and ":" characters May 20, 2025
@bsangwan bsangwan changed the title bug<linux>: nginx.conf file scanning error out for "=" and ":" characters bug(linux): nginx.conf file scanning error out for "=" and ":" characters May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible Ansible query bug Something isn't working community Community contribution docker Docker query query New query feature
Projects
None yet
Development

No branches or pull requests

1 participant