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

feat: add cloud custom rules to iac behind feature flag #4431

Merged
merged 3 commits into from
Feb 28, 2023

Conversation

jason-snyk
Copy link
Contributor

@jason-snyk jason-snyk commented Feb 22, 2023

What does this PR do?

This PR adds initial support for Snyk Cloud custom rules to snyk iac test behind a feature flag. I also needed to fix a bug that caused non-fatal parse errors to be treated as fatal, because the most recent policy-engine emits those non-fatal errors in more situations than it used to. After this PR, we'll just debug log those errors until we can design a better way to communicate them.

How should this be manually tested?

Please reach out to me and I can help you get setup to test.

What are the relevant tickets?

CLOUD-1176

Screenshots

A custom rule in the results:
Screenshot 2023-02-22 at 8 31 16 AM

@jason-snyk jason-snyk requested a review from a team as a code owner February 22, 2023 13:33
@jason-snyk jason-snyk marked this pull request as draft February 22, 2023 14:22
@jason-snyk jason-snyk force-pushed the feat/CLOUD-1176/snyk-iac-cloud-custom-rules branch 2 times, most recently from da99480 to d81b486 Compare February 24, 2023 14:55
@jason-snyk jason-snyk marked this pull request as ready for review February 24, 2023 19:58
@@ -54,6 +55,10 @@ async function prepareTestConfig(
const varFile = options['var-file'];
const cloudContext = getFlag(options, 'cloud-context');
const snykCloudEnvironment = getFlag(options, 'snyk-cloud-environment');
const customRulesEnabled = await isFeatureFlagSupportedForOrg(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The CLI is meant to serve solely as the UI for the IaC test, and should not be exposed to implementation details such as engine-related features gating. Could you move the move the feature flag check to snyk/snyk-iac-test please?
  2. Should we also wrap this feature with the experimental CLI flag? Doing so provides us with an additional layer of gating to ensure the feature is not activated for pre-feature-release versions when it's not fully complete and ready for use by customers.

@jason-snyk jason-snyk force-pushed the feat/CLOUD-1176/snyk-iac-cloud-custom-rules branch 2 times, most recently from 23d16fe to 39f4667 Compare February 28, 2023 14:10
We made some improvements to the HCL parser in snyk-iac-test v0.40.0, which
will cause it reject some invalid HCL code that it used to ignore. This
fixture contained an unresolved reference, so I've just added the
referenced resource.

[CLOUD-1176]
@jason-snyk jason-snyk force-pushed the feat/CLOUD-1176/snyk-iac-cloud-custom-rules branch from fc4e3dc to a5ae9e2 Compare February 28, 2023 15:38
@jason-snyk jason-snyk merged commit 7c358d6 into master Feb 28, 2023
@jason-snyk jason-snyk deleted the feat/CLOUD-1176/snyk-iac-cloud-custom-rules branch February 28, 2023 17:19
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

Successfully merging this pull request may close these issues.

3 participants