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): experimental-queries.json: no such file or directory in Kics 1.7.10 #6765

Closed
mymichu opened this issue Oct 11, 2023 · 2 comments
Labels
bug Something isn't working community Community contribution docker Docker query dockerfile query New query feature terraform Terraform query

Comments

@mymichu
Copy link

mymichu commented Oct 11, 2023

Expected Behavior

We'd like to be able to run a Kics analysis with kics 1.7.10 as we do with kics 1.7.8.

Actual Behavior

When we run the following command:

kics scan --config config.yaml 

We are receiving the following issue:

Scanning with Keeping Infrastructure as Code Secure v1.7.10

11:54AM INF Scanning with Keeping Infrastructure as Code Secure v1.7.10
11:54AM INF Operating system: linux
11:54AM INF Total memory: 17.6G
11:54AM INF CPU: 7.0
11:54AM INF Total files in the project: 25
11:54AM INF .gitignore file was found in 'PROJECT_ROOT' and it will be used to automatically exclude paths
11:54AM INF Loading queries of type: dockerfile
Error: stat PROJECT_ROOT/assets/utils/experimental-queries.json: no such file or directory

Here is the log with the debug flag enabled

�[90m12:02PM�[0m �[33mDBG�[0m console.scan()
�[90m12:02PM�[0m �[33mDBG�[0m console.scan()
�[38;2;34;187;51m
                   .0MO.                                    
                   OMMMx                                    
                   ;NMX;                                    
                    ...           ...              ....     
WMMMd     cWMMM0.  KMMMO      ;xKWMMMMNOc.     ,xXMMMMMWXkc.
WMMMd   .0MMMN:    KMMMO    :XMMMMMMMMMMMWl   xMMMMMWMMMMMMl
WMMMd  lWMMMO.     KMMMO   xMMMMKc...'lXMk   ,MMMMx   .;dXx 
WMMMd.0MMMX;       KMMMO  cMMMMd        '    'MMMMNl'       
WMMMNWMMMMl        KMMMO  0MMMN               oMMMMMMMXkl.  
WMMMMMMMMMMo       KMMMO  0MMMX                .ckKWMMMMMM0.
WMMMMWokMMMMk      KMMMO  oMMMMc              .     .:OMMMM0
WMMMK.  dMMMM0.    KMMMO   KMMMMx'    ,kNc   :WOc.    .NMMMX
WMMMd    cWMMMX.   KMMMO    kMMMMMWXNMMMMMd .WMMMMWKO0NMMMMl
WMMMd     ,NMMMN,  KMMMO     'xNMMMMMMMNx,   .l0WMMMMMMMWk, 
xkkk:      ,kkkkx  okkkl        ;xKXKx;          ;dOKKkc    

�[0m
Scanning with Keeping Infrastructure as Code Secure v1.7.10


�[90m12:02PM�[0m �[32mINF�[0m Scanning with Keeping Infrastructure as Code Secure v1.7.10
�[90m12:02PM�[0m �[32mINF�[0m Operating system: linux
�[90m12:02PM�[0m �[32mINF�[0m Total memory: 17.6G
�[90m12:02PM�[0m �[32mINF�[0m CPU: 7.0
�[90m12:02PM�[0m �[33mDBG�[0m storage.NewMemoryStorage()
�[90m12:02PM�[0m �[33mDBG�[0m Trying to load path (--queries-path) from /kics/assets/queries
�[90m12:02PM�[0m �[33mDBG�[0m Trying to load path (--libraries-path) from /kics/assets/libraries
�[90m12:02PM�[0m �[32mINF�[0m Total files in the project: 26
�[90m12:02PM�[0m �[32mINF�[0m .gitignore file was found in 'ROOT_DIR' and it will be used to automatically exclude paths
�[90m12:02PM�[0m �[32mINF�[0m Loading queries of type: dockerfile
�[90m12:02PM�[0m �[33mDBG�[0m helpers.GetDefaultExperimentalPath()
�[90m12:02PM�[0m �[33mDBG�[0m helpers.GetExecutableDirectory()
�[90m12:02PM�[0m �[1m�[31mERR�[0m�[0m Failed to run application �[36merror=�[0m�[31m"stat ROOT_DIR/assets/utils/experimental-queries.json: no such file or directory"�[0m
�[90m12:02PM�[0m �[33mDBG�[0m Error Report: 
{
  "location": "func Execute()",
  "flags": {
    "analyze-path": [],
    "analyze-results": "platforms.json",
    "bom": false,
    "ci": false,
    "cloud-provider": [
      ""
    ],
    "config": "/kics/config/config.yaml",
    "disable-full-descriptions": false,
    "disable-secrets": false,
    "exclude-categories": [],
    "exclude-gitignore": false,
    "exclude-paths": [
      "templates",
      ".git/config"
    ],
    "exclude-queries": [
      "d3499f6d-1651-41bb-a9a7-de925fea487b",
      "02d9c71f-3ee8-4986-9c27-1a20d0d19bfc",
      "b03a748a-542d-44f4-bb86-9199ab4fd2d5"
    ],
    "exclude-results": [],
    "exclude-severities": [],
    "exclude-type": [
      ""
    ],
    "experimental-queries": [],
    "fail-on": [
      "high",
      "medium",
      "low",
      "info"
    ],
    "ignore-on-exit": "none",
    "include-ids": [
      "all"
    ],
    "include-queries": [],
    "input-data": "",
    "libraries-path": "/kics/assets/libraries",
    "log-file": false,
    "log-format": "pretty",
    "log-level": "DEBUG",
    "log-path": "",
    "minimal-ui": true,
    "no-color": false,
    "no-progress": true,
    "output-name": "results",
    "output-path": "reports/lint-docker",
    "path": [
      "."
    ],
    "payload-lines": false,
    "payload-path": "",
    "preview-lines": 3,
    "profiling": "",
    "queries-path": [
      "/kics/assets/queries"
    ],
    "report-formats": [
      "json",
      "glsast"
    ],
    "results": "",
    "secrets-regexes-path": "",
    "silent": false,
    "terraform-vars-path": "",
    "timeout": 3,
    "type": [
      "dockerfile"
    ],
    "verbose": true
  },
  "file_name": "",
  "query_name": "",
  "platform": "",
  "kind": "",
  "query_metadata": null,
  "message": "Failed to run application",
  "error": {
    "Op": "stat",
    "Path": "ROOT_DIR/assets/utils/experimental-queries.json",
    "Err": 2
  },
  "additional_values": null
}

Specifications

Version: 1.7.10
Platform: Run in docker on mac os

@mymichu mymichu added bug Something isn't working community Community contribution labels Oct 11, 2023
@github-actions github-actions bot added query New query feature docker Docker query terraform Terraform query dockerfile labels Oct 11, 2023
@cxMiguelSilva
Copy link
Collaborator

Hi @mymichu,

The problem you are facing is related to #6756.
We are currently working on allowing the same behavior for the file throwing the error as the path for the queries and libraries.

In the meantime try to make the recommendation given here

@mymichu mymichu changed the title bug(engine): experimental-queries.json: no such file or directory bug(engine): experimental-queries.json: no such file or directory in Kics 1.7.10 Oct 11, 2023
@mymichu
Copy link
Author

mymichu commented Oct 11, 2023

Okei thanks I thought it was solved but I didn't see the workaround. My fault.. This workaround works for me.

@mymichu mymichu closed this as completed Oct 11, 2023
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 dockerfile query New query feature terraform Terraform query
Projects
None yet
Development

No branches or pull requests

2 participants