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(global): documentation and/or functionality incorrect for YAML frontmatter #6768

Open
andrewvaughan opened this issue Oct 13, 2023 · 1 comment
Labels
bug Something isn't working community Community contribution docker Docker query

Comments

@andrewvaughan
Copy link

Expected Behavior

Ignored YML directives should work like this:

# kics-scan disable=555ab8f9-2001-455e-a077-f2d0f41e2fb9

##
# Some GitHub workflow
#
---
name: Workflow

And like this

##
# Some GitHub workflow
#
---
# kics-scan disable=555ab8f9-2001-455e-a077-f2d0f41e2fb9
name: Workflow

Actual Behavior

The ignore does not occur when the YAML is formatted like this:

##
# Some GitHub workflow
#
---
# kics-scan disable=555ab8f9-2001-455e-a077-f2d0f41e2fb9
name: Workflow

This actually took me some time to debug because the official documentation actually says that KICS will only work when the ignore directive happens after the front-matter block, when the opposite is actually true. Per the documentation:

NOTE: For YAML when trying to ignore the whole resource this file should start with --- and
then the KICS comment command as you can see on the following example:

---
# kics-scan ignore-block
apiVersion: v1
kind: Pod
metadata:
name: memory-demo-1
namespace: mem-example

Steps to Reproduce the Problem

Create a YAML file with an ignore after the front-matter, per the documentation, that breaks a rule.

Specifications

  • Version: 1.4.9
  • Platform: macOS (Docker container linux/amd64)
  • Subsystem: Megalinter
@andrewvaughan andrewvaughan added bug Something isn't working community Community contribution labels Oct 13, 2023
@github-actions github-actions bot added the docker Docker query label Oct 13, 2023
@andrewvaughan andrewvaughan changed the title bug(<scope>): <title starting with lowercase letter> bug: documentation and/or functionality incorrect for YAML frontmatter Oct 13, 2023
@andrewvaughan andrewvaughan changed the title bug: documentation and/or functionality incorrect for YAML frontmatter bug(global): documentation and/or functionality incorrect for YAML frontmatter Oct 13, 2023
@andrewvaughan
Copy link
Author

I have zero clue what scope entails in the directive the bot gave me... better documentation on that would be helpful.

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
Projects
None yet
Development

No branches or pull requests

1 participant