Skip to content

KICS exiting with status code 30, 40 #15

@jatinmehrotra

Description

@jatinmehrotra

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions