Kics fails to scan files with "#" in the filename
When running the following commands
mkdir test
touch "test/my#file.tf"
docker run -t -v $PWD:/path checkmarx/kics scan -p "/path/test/my#file.tf"
Kics output is showing the following error:
Scanning with Keeping Infrastructure as Code Secure v1.7.2
Error: stat /path/test/my: no such file or directory
Usage:
kics scan [flags]
However, when scanning the directory that contains this file the file is included in the scan as expected.
running docker run -t -v $PWD:/path checkmarx/kics scan -p "/path/test"
It looks like the issue is in go-getter
https://github.com/hashicorp/go-getter/blob/c12e42f9c2a92e05cc134fcc24891b3c190826ec/get_file.go#L19
go-getter parses the path to a URL object and then uses the u.Path field. However, u.Path is missing the fragment part of the path. I will open an issue in their repo
Hello @ayala-orca. I appreciate your initiative by opening an issue in go-getter repo.
Best regards
Reference to go getter ticket - https://github.com/hashicorp/go-getter/issues/446