Skip to content

Commit

Permalink
feat: add cfn-lint (#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Vishnu Jayadevan <[email protected]>
Signed-off-by: Srijan Saurav <[email protected]>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Srijan Saurav <[email protected]>
Co-authored-by: Eshaan Bansal <[email protected]>
  • Loading branch information
4 people authored Nov 30, 2023
1 parent d169811 commit 553e450
Show file tree
Hide file tree
Showing 169 changed files with 4,601 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Hub of all open-sourced third-party static analyzers supported by DeepSource.

## Supported Analyzers

| Analyzer name | Latest version | Language / Technology |
| :-------------------------------------------------------------- | :------------- | :--------------------- |
| [facebook/infer](https://github.com/facebook/infer) | v1.1.0 | Java, C++, Objective-C |
| [Azure/bicep](https://github.com/Azure/bicep) | v0.20.4 | Azure Resource Manager |
| [stackrox/kube-linter](https://github.com/stackrox/kube-linter) | 0.6.4 | Kubernetes, Helm |
| [crytic/slither](https://github.com/crytic/slither) | 0.10.0 | Solidity, Vyper |
| Analyzer name | Latest version | Language / Technology |
| :------------------------------------------------------------------------------ | :-------------- | :--------------------- |
| [facebook/infer](https://github.com/facebook/infer) | v1.1.0 | Java, C++, Objective-C |
| [Azure/bicep](https://github.com/Azure/bicep) | v0.20.4 | Azure Resource Manager |
| [stackrox/kube-linter](https://github.com/stackrox/kube-linter) | 0.6.4 | Kubernetes, Helm |
| [crytic/slither](https://github.com/crytic/slither) | 0.10.0 | Solidity, Vyper |
| [aws-cloudformation/cfn-lint](https://github.com/aws-cloudformation/cfn-lint) | 0.83.3 | AWS CloudFormation |

---

Expand Down
7 changes: 7 additions & 0 deletions analyzers/cfn-lint/.deepsource/analyzer/analyzer.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Analyzer Profile
category = "conf"
name = "AWS CloudFormation Linter"
shortcode = "cfn-lint"
status = "active"
tool_latest_version = "0.83.0"
description = "AWS Cloudformation Linter validates AWS CloudFormation yaml/json templates against AWS CloudFormation Resource Specification."
5 changes: 5 additions & 0 deletions analyzers/cfn-lint/.deepsource/analyzer/example_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version = 1

[[analyzers]]
name = "cfn-lint"
type = "community"
1,503 changes: 1,503 additions & 0 deletions analyzers/cfn-lint/.deepsource/analyzer/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E0002.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Error processing rule on the template"
verbose_name = "E0002"
severity = "major"
category = "antipattern"
weight = 70
tags = ["base", "rule"]
description = '''
Errors found when processing a rule on the template
### References:
[CloudFormation Python Lint](https://github.com/aws-cloudformation/cfn-python-lint)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1001.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Basic cloudformation template configuration"
verbose_name = "E1001"
severity = "major"
category = "antipattern"
weight = 70
tags = ["base"]
description = '''
Making sure the basic CloudFormation template components are properly configured
### References:
[CloudFormation Python Lint](https://github.com/aws-cloudformation/cfn-python-lint)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1002.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Template size limit"
verbose_name = "E1002"
severity = "major"
category = "antipattern"
weight = 70
tags = ["limits"]
description = '''
Check the size of the template is less than the upper limit
### References:
[CloudFormation Limits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1003.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Template description limit"
verbose_name = "E1003"
severity = "major"
category = "antipattern"
weight = 70
tags = ["description", "limits"]
description = '''
Check if the size of the template description is less than the upper limit
### References:
[CloudFormation Limits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1004.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Template description can only be a string"
verbose_name = "E1004"
severity = "major"
category = "antipattern"
weight = 70
tags = ["description"]
description = '''
Template description can only be a string
### References:
[Template Description Structure](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-description-structure.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1010.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Getatt validation of parameters"
verbose_name = "E1010"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "getatt"]
description = '''
Validates that GetAtt parameters are to valid resources and properties of those resources
### References:
[Intrinsic Function Reference Getatt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1011.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Findinmap validation of configuration"
verbose_name = "E1011"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "findinmap"]
description = '''
Making sure the function is a list of appropriate config
### References:
[Intrinsic Function Reference Findinmap](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1012.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Check if refs exist"
verbose_name = "E1012"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "ref"]
description = '''
Making sure the refs exist
### References:
[Intrinsic Function Reference Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1015.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Getaz validation of parameters"
verbose_name = "E1015"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "getaz"]
description = '''
Making sure the GetAz function is properly configured
### References:
[Intrinsic Function Reference Getavailabilityzones](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getavailabilityzones.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1016.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Importvalue validation of parameters"
verbose_name = "E1016"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "importvalue"]
description = '''
Making sure the ImportValue function is properly configured
### References:
[Intrinsic Function Reference Importvalue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1017.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Select validation of parameters"
verbose_name = "E1017"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "select"]
description = '''
Making sure the Select function is properly configured
### References:
[Intrinsic Function Reference Select](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1018.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Split validation of parameters"
verbose_name = "E1018"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "split"]
description = '''
Making sure the split function is properly configured
### References:
[Intrinsic Function Reference Split](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-split.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1019.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Sub validation of parameters"
verbose_name = "E1019"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "sub"]
description = '''
Making sure the sub function is properly configured
### References:
[Intrinsic Function Reference Sub](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1020.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Ref validation of value"
verbose_name = "E1020"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "ref"]
description = '''
Making sure the Ref has a String value (no other functions are supported)
### References:
[Intrinsic Function Reference Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1021.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Base64 validation of parameters"
verbose_name = "E1021"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "base64"]
description = '''
Making sure the Base64 function is properly configured
### References:
[Intrinsic Function Reference Base64](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-base64.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1022.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Join validation of parameters"
verbose_name = "E1022"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "join"]
description = '''
Making sure the join function is properly configured
### References:
[Intrinsic Function Reference Join](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-join.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1023.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Validation not function configuration"
verbose_name = "E1023"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "not"]
description = '''
Making sure that NOT functions are list
### References:
[Intrinsic Function Reference Conditions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-not)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1024.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Cidr validation of parameters"
verbose_name = "E1024"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "cidr"]
description = '''
Making sure the function CIDR is a list with valid values
### References:
[Intrinsic Function Reference Cidr](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-cidr.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1026.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Cannot reference resources in the conditions block of the template"
verbose_name = "E1026"
severity = "major"
category = "antipattern"
weight = 70
tags = ["conditions", "functions", "ref"]
description = '''
Check that any Refs in the Conditions block uses no resources
### References:
[Intrinsic Function Reference Conditions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#w2ab2c21c28c21c45)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1027.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Check dynamic references secure strings are in supported locations"
verbose_name = "E1027"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "dynamic reference"]
description = '''
Dynamic References Secure Strings are only supported for a small set of resource properties. Validate that they are being used in the correct location when checking values and Fn::Sub in resource properties. Currently doesn't check outputs, maps, conditions, parameters, and descriptions.
### References:
[Dynamic References](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1028.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Check fn::if structure for validity"
verbose_name = "E1028"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "if"]
description = '''
Check Fn::If to make sure its valid. Condition has to be a string.
### References:
[Intrinsic Function Reference Conditions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-if)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1029.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Sub is required if a variable is used in a string"
verbose_name = "E1029"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "sub"]
description = '''
If a substitution variable exists in a string but isn't wrapped with the Fn::Sub function the deployment will fail.
### References:
[Intrinsic Function Reference Sub](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1030.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Length validation of parameters"
verbose_name = "E1030"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "length"]
description = '''
Making sure Fn::Length is configured correctly
### References:
[Intrinsic Function Reference Length](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-length.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1031.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Tojsonstring validation of parameters"
verbose_name = "E1031"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "toJsonString"]
description = '''
Making sure Fn::ToJsonString is configured correctly
### References:
[Intrinsic Function Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E1032.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Validates foreach functions"
verbose_name = "E1032"
severity = "major"
category = "antipattern"
weight = 70
tags = ["functions", "foreach"]
description = '''
Validates that ForEach parameters have a valid configuration
### References:
[Intrinsic Function Reference Getatt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E2001.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Parameters have appropriate properties"
verbose_name = "E2001"
severity = "major"
category = "antipattern"
weight = 70
tags = ["parameters"]
description = '''
Making sure the parameters are properly configured
### References:
[Parameters Section Structure](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E2002.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Parameters have appropriate type"
verbose_name = "E2002"
severity = "major"
category = "antipattern"
weight = 70
tags = ["parameters"]
description = '''
Making sure the parameters have a correct type
### References:
[Best Practices](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html#parmtypes)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E2003.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "Parameters have appropriate names"
verbose_name = "E2003"
severity = "major"
category = "antipattern"
weight = 70
tags = ["parameters"]
description = '''
Check if Parameters are properly named (A-Za-z0-9)
### References:
[Parameters Section Structure](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#parameters-section-structure-requirements)
'''
Loading

0 comments on commit 553e450

Please sign in to comment.