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

KICS exiting with status code 30, 40 #15

Open
jatinmehrotra opened this issue Mar 13, 2024 · 2 comments
Open

KICS exiting with status code 30, 40 #15

jatinmehrotra opened this issue Mar 13, 2024 · 2 comments

Comments

@jatinmehrotra
Copy link
Contributor

jatinmehrotra commented Mar 13, 2024

Exit status code 40

  • After running KICS it simply exits with status 40

  • It also throws status 40 when I try to exclude severties for HIGH categories

const app = new cdk.App({
    policyValidationBeta1: [new KicsValidator({
        excludeSeverities: [Severity.HIGH],
    })],
});

Error Message

Error: Command exited with status 40

Validation Report
-----------------

╔═══════════════════════════════════════╗
║             Plugin Report             ║
║   Plugin: kics-cdk-validator-plugin   ║
║   Version: N/A                        ║
║   Status: failure                     ║
╚═══════════════════════════════════════╝


Policy Validation Report Summary

╔═══════════════════════════╤═════════╗
║ Plugin                    │ Status  ║
╟───────────────────────────┼─────────╢
║ kics-cdk-validator-plugin │ failure ║
╚═══════════════════════════╧═════════╝

Validation failed. See the validation report above for details

Subprocess exited with error 1

CDK stack code

import { Duration, Stack, StackProps } from 'aws-cdk-lib';
import * as sns from 'aws-cdk-lib/aws-sns';
import * as subs from 'aws-cdk-lib/aws-sns-subscriptions';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import { Construct } from 'constructs';

export class CdkLeftShiftStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    new s3.Bucket(this, 'MyFirstBucket'); // had to add as workaround

    const queue = new sqs.Queue(this, 'CdkLeftShiftQueue', {
      visibilityTimeout: Duration.seconds(300)
    });

    const topic = new sns.Topic(this, 'CdkLeftShiftTopic');

    topic.addSubscription(new subs.SqsSubscription(queue));
  }
}

If i add a s3 bucket to the CDK code then it works fine.

Exit status code 30

  • When I use failureSeverities with Severity.LOW it exits with status code 30 and fails
new KicsValidator({
  failureSeverities: [
    Severity.LOW,
  ],
});


Is this behaviour of error status code and error intended?

@jatinmehrotra jatinmehrotra changed the title KICS exiting with status 40 KICS exiting with status code 30, 40 Mar 14, 2024
@gabriel-cx
Copy link
Contributor

Hi @jatinmehrotra,

Kindly check KICS exit codes documentation, hope this clarifies your doubts!

@jatinmehrotra
Copy link
Contributor Author

@gabriel-cx  Thank you for the documentation.

I understood exit code 40,30 is intended but in that case too I was expecting to see failure report to show me MEDIUM/LOW category reports but in my above case, it only shows report status as failure with no reports

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