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

bug(engine): kics throws an error and closes when scanning a invalid symbolic link directly #6659

Closed
saars-orca opened this issue Aug 20, 2023 · 2 comments
Labels
bug Something isn't working community Community contribution docker Docker query query New query feature

Comments

@saars-orca
Copy link

saars-orca commented Aug 20, 2023

Expected Behavior

KICS should print out a warning and skip the file if it does not exist/points to a non-existing file.

Actual Behavior

When scanning a symbolic link that points to a non-existing file, kics returns an error and closes instead of skipping the file.
folder content:

ls -al
total 0
drwxr-xr-x@  3 user  staff   96 Aug 20 13:16 .
drwxr-xr-x@ 28 user  staff  896 Aug 20 13:10 ..
lrwxr-xr-x@  1 user  staff   17 Aug 20 13:12 test -> doesnotexist/test

scan command used:

docker run -t -v $PWD:/path checkmarx/kics:v1.7.5 scan -p /path/test -v --log-level TRACE                                                                      
10:17AM DBG console.scan()
10:17AM DBG console.scan()
...
Scanning with Keeping Infrastructure as Code Secure v1.7.5
...
10:17AM INF Scanning with Keeping Infrastructure as Code Secure v1.7.5
10:17AM INF Operating system: linux
10:17AM INF Total memory: 7.8G
10:17AM INF CPU: 8.0
10:17AM DBG storage.NewMemoryStorage()
10:17AM DBG Looking for queries in executable path and in current work directory
10:17AM DBG helpers.GetDefaultQueryPath()
10:17AM DBG helpers.GetExecutableDirectory()
10:17AM DBG Queries found in /app/bin/assets/queries
10:17AM ERR stat /path/test: no such file or directory
Error: stat /path/test: no such file or directory
...
10:17AM ERR Failed to run application error="stat /path/test: no such file or directory"

kics_debug.log

Steps to Reproduce the Problem

(Command line arguments and flags used)

  1. Create an invalid symlink: ln -s doesnotexist/test test
  2. Scan the symlink using KICS: docker run -t -v $PWD:/path checkmarx/kics:v1.7.5 scan -p /path/test -v --log-level TRACE

Specifications

(N/A if not applicable)

  • Version: v1.7.5
  • Platform: Linux/Mac
  • Subsystem: N/A
@saars-orca saars-orca added bug Something isn't working community Community contribution labels Aug 20, 2023
@github-actions github-actions bot added query New query feature docker Docker query labels Aug 20, 2023
@saars-orca saars-orca changed the title KICS throws an error and closes when scanning a invalid symbolic link directly bug<engine>: kics throws an error and closes when scanning a invalid symbolic link directly Aug 20, 2023
@saars-orca saars-orca changed the title bug<engine>: kics throws an error and closes when scanning a invalid symbolic link directly bug(<engine>): kics throws an error and closes when scanning a invalid symbolic link directly Aug 20, 2023
@saars-orca saars-orca changed the title bug(<engine>): kics throws an error and closes when scanning a invalid symbolic link directly bug(engine): kics throws an error and closes when scanning a invalid symbolic link directly Aug 20, 2023
@lior-orca
Copy link

@liorj-orca is on it, will send a PR

@gabriel-cx
Copy link
Contributor

closed by #6665

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 docker Docker query query New query feature
Projects
None yet
Development

No branches or pull requests

3 participants