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 cfn-lint #8

Merged
merged 27 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ff2612f
feat: add cfn-lint
vishnu-deepsource Oct 27, 2023
eb1baa5
style: format code with Black and isort
deepsource-autofix[bot] Oct 27, 2023
c352169
fix: update issue categories
vishnu-deepsource Oct 27, 2023
a6d0842
Update analyzers/cfn-lint/.deepsource/analyzer/example_config.toml
vishnu-deepsource Oct 31, 2023
53d67a7
chore: move issues to correct directory
vishnu-deepsource Oct 30, 2023
7034f03
fix: improve issue generation script
vishnu-deepsource Oct 31, 2023
27d0838
style: format code with Black and isort
deepsource-autofix[bot] Oct 31, 2023
6afa029
chore: add an end to end parsing test (#10)
srijan-deepsource Nov 6, 2023
fc7f900
fix: don't duplicate issues when same artifact is reported again (#12)
srijan-deepsource Nov 13, 2023
450c8a6
chore: add armory (#13)
srijan-deepsource Nov 14, 2023
d7fc2f1
chore: fail tests if the test sarif reports have unsanitised issue co…
srijan-deepsource Nov 15, 2023
82efbe7
fix: always raise issues in files sent for analysis (#15)
srijan-deepsource Nov 20, 2023
fbdc5c2
feat: add slither (#9)
eshaan-deepsource Nov 22, 2023
ef875ac
feat: Add Github Action
vishnu-deepsource Oct 31, 2023
926b7f2
feat: add tests
vishnu-deepsource Oct 31, 2023
c6e96a2
feat: add tests
vishnu-deepsource Nov 28, 2023
659eec1
feat: add issue_map.json and generator
vishnu-deepsource Nov 29, 2023
1fff4df
style: format code with Black and isort
deepsource-autofix[bot] Nov 29, 2023
2b3da49
fix: minor mistake in toml generation
vishnu-deepsource Nov 29, 2023
bc6e370
fix: deepsource issues
vishnu-deepsource Nov 29, 2023
2df79d5
Merge branch 'master' into cfn-lint
vishnu-deepsource Nov 29, 2023
9ab2665
fix: minor DeepSource issue
vishnu-deepsource Nov 29, 2023
0b90a99
fix: deepsource issues and docstrings
vishnu-deepsource Nov 29, 2023
45dc41e
fix: deepsource issues and docstrings
vishnu-deepsource Nov 29, 2023
a10b6b8
Update analyzers/cfn-lint/CI/github-actions.yaml
vishnu-deepsource Nov 30, 2023
3febdd1
fix: fix capitalization of issue titles
vishnu-deepsource Nov 30, 2023
c3242ea
chore: update README.md
vishnu-deepsource Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
vishnu-deepsource marked this conversation as resolved.
Show resolved Hide resolved
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"
vishnu-deepsource marked this conversation as resolved.
Show resolved Hide resolved
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)
'''
12 changes: 12 additions & 0 deletions analyzers/cfn-lint/.deepsource/issues/CFLIN-E2010.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title = "parameter limit not exceeded"
verbose_name = "E2010"
severity = "major"
category = "antipattern"
weight = 70
tags = ["parameters", "limits"]
description = '''
Check the number of Parameters in the template is less than the upper limit

### References:
[CloudFormation Limits](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html)
'''
Loading