Navigation Menu

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

resource ID has an invalid format Dockerfile #1344

Closed
nhalstead opened this issue Jul 27, 2022 · 6 comments
Closed

resource ID has an invalid format Dockerfile #1344

nhalstead opened this issue Jul 27, 2022 · 6 comments
Assignees

Comments

@nhalstead
Copy link

  • terrascan version: v1.15.2 (via Docker Image Tag Latest)
  • Operating System: Docker Container

Description

{"level":"error","time":"2022-07-27T22:40:57.851Z","file":"opa/engine.go:419","msg":"resource ID has an invalid format Dockerfile"}

opa/engine.go:419

What I Did

  • Checked issues in terrascan repo (none)
  • Checked Dockerfiles, all are correct format

Is it possible to have a Flag to skip errors during the engine's FindAllResourcesByID error check?

@gaurav-gogia
Copy link
Contributor

Hi @nhalstead

Could you please share a sample docker file code where you see these errors?

Thanks

@gaurav-gogia gaurav-gogia self-assigned this Aug 25, 2022
@nhalstead
Copy link
Author

Hi @gaurav-gogia I was able to bypass the exit code error BUT the output JSON is messed up with error values when it should come out on Standard Error, not Standard Output.

Command:

terrascan scan --output json --log-type console --use-colors false > report.json 2> error.txt || true

error.txt

Unable to find image 'tenable/terrascan:latest' locally
latest: Pulling from tenable/terrascan
2408cc74d12b: Already exists
...
6eb609282c41: Pull complete
Digest: sha256:e36aed65df132ffb722b6b524f703eb819cbf17efb7ba5a9397a4b908e87e30e
Status: Downloaded newer image for tenable/terrascan:latest
2022-08-29T20:56:55.100Z	�[31merror�[0m	opa/engine.go:419	resource ID has an invalid format Dockerfile

report.json:

ERROR: json: cannot unmarshal number into Go struct field Function_Environment.Properties.Environment.Variables of type string
{
  "results": {
    "scan_errors": [
      {
...

@gaurav-gogia
Copy link
Contributor

@nhalstead

I see. That might be a separate issue. Might require some design changes around how errors are being handled. Currently all logs are written to Standard Output, AFAIK.

Could you please open a separate issue for this?

@nhalstead
Copy link
Author

@gaurav-gogia Openned a new issue for this. If you run the command previously attached, you can see the output does come out of stderr and stdout, as indicated by the contents of the files and bash FD piping.

@gaurav-gogia
Copy link
Contributor

Closed in favour of 1378

@nhalstead
Copy link
Author

Hi @gaurav-gogia are you able to get a release of the changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants