-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from cnescatlab/feature/add-hadolint-with-cnes…
…-scan-update Added hadolint + new cnes-scan version
- Loading branch information
Showing
9 changed files
with
251 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
format: sonarqube # Output format (tty | json | checkstyle | codeclimate | gitlab_codeclimate | gnu | codacy) | ||
ignored: # list of rules | ||
- DL3012 | ||
- DL3045 | ||
- DL3047 | ||
- DL3049 | ||
- DL3050 | ||
- DL3051 | ||
- DL3052 | ||
- DL3053 | ||
- DL3054 | ||
- DL3055 | ||
- DL3056 | ||
- DL3057 | ||
- DL3058 | ||
- SC1000 | ||
- SC1001 | ||
- SC1010 | ||
- SC1018 | ||
- SC1045 | ||
- SC1065 | ||
- SC1066 | ||
- SC1077 | ||
- SC1078 | ||
- SC1079 | ||
- SC1081 | ||
- SC1083 | ||
- SC1086 | ||
- SC1087 | ||
- SC1097 | ||
- SC1098 | ||
- SC2002 | ||
- SC2026 | ||
- SC2028 | ||
- SC2035 | ||
- SC2046 | ||
- SC2086 | ||
- SC2140 | ||
- SC2154 | ||
- SC2155 | ||
- SC2164 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
{ | ||
"issues": [ | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "Always tag the version of an image explicitly", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 4, | ||
"startColumn": 0, | ||
"startLine": 4 | ||
} | ||
}, | ||
"ruleId": "DL3006", | ||
"severity": "MAJOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "Avoid additional packages by specifying `--no-install-recommends`", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 6, | ||
"startColumn": 0, | ||
"startLine": 6 | ||
} | ||
}, | ||
"ruleId": "DL3015", | ||
"severity": "MINOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "Delete the apt-get lists after installing something", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 6, | ||
"startColumn": 0, | ||
"startLine": 6 | ||
} | ||
}, | ||
"ruleId": "DL3009", | ||
"severity": "MINOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "node_verion is referenced but not assigned (did you mean 'node_version'?).", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 6, | ||
"startColumn": 0, | ||
"startLine": 6 | ||
} | ||
}, | ||
"ruleId": "SC2154", | ||
"severity": "MAJOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "`COPY` to a relative destination without `WORKDIR` set.", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 9, | ||
"startColumn": 0, | ||
"startLine": 9 | ||
} | ||
}, | ||
"ruleId": "DL3045", | ||
"severity": "MAJOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "Use WORKDIR to switch to a directory", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 11, | ||
"startColumn": 0, | ||
"startLine": 11 | ||
} | ||
}, | ||
"ruleId": "DL3003", | ||
"severity": "MAJOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "Pin versions in npm. Instead of `npm install <package>` use `npm install <package>@<version>`", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 11, | ||
"startColumn": 0, | ||
"startLine": 11 | ||
} | ||
}, | ||
"ruleId": "DL3016", | ||
"severity": "MAJOR", | ||
"type": "CODE_SMELL" | ||
}, | ||
{ | ||
"engineId": "Hadolint", | ||
"primaryLocation": { | ||
"filePath": "src/Dockerfile", | ||
"message": "Valid UNIX ports range from 0 to 65535", | ||
"textRange": { | ||
"endColumn": 1, | ||
"endLine": 14, | ||
"startColumn": 0, | ||
"startLine": 14 | ||
} | ||
}, | ||
"ruleId": "DL3011", | ||
"severity": "CRITICAL", | ||
"type": "BUG" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"issues":[{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"Always tag the version of an image explicitly","textRange":{"endColumn":1,"endLine":4,"startColumn":0,"startLine":4}},"ruleId":"DL3006","severity":"MAJOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"Avoid additional packages by specifying `--no-install-recommends`","textRange":{"endColumn":1,"endLine":6,"startColumn":0,"startLine":6}},"ruleId":"DL3015","severity":"MINOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"Delete the apt-get lists after installing something","textRange":{"endColumn":1,"endLine":6,"startColumn":0,"startLine":6}},"ruleId":"DL3009","severity":"MINOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"node_verion is referenced but not assigned (did you mean 'node_version'?).","textRange":{"endColumn":1,"endLine":6,"startColumn":0,"startLine":6}},"ruleId":"SC2154","severity":"MAJOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"`COPY` to a relative destination without `WORKDIR` set.","textRange":{"endColumn":1,"endLine":9,"startColumn":0,"startLine":9}},"ruleId":"DL3045","severity":"MAJOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"Use WORKDIR to switch to a directory","textRange":{"endColumn":1,"endLine":11,"startColumn":0,"startLine":11}},"ruleId":"DL3003","severity":"MAJOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"Pin versions in npm. Instead of `npm install <package>` use `npm install <package>@<version>`","textRange":{"endColumn":1,"endLine":11,"startColumn":0,"startLine":11}},"ruleId":"DL3016","severity":"MAJOR","type":"CODE_SMELL"},{"engineId":"Hadolint","primaryLocation":{"filePath":"tests/docker/src/Dockerfile","message":"Valid UNIX ports range from 0 to 65535","textRange":{"endColumn":1,"endLine":14,"startColumn":0,"startLine":14}},"ruleId":"DL3011","severity":"CRITICAL","type":"BUG"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#SonarQube Properties | ||
sonar.projectKey=hadolint-dummy-project | ||
sonar.projectName=Hadolint Dummy Project | ||
sonar.projectVersion=1.0 | ||
sonar.sources=src | ||
sonar.externalIssuesReportPaths=hadolint-report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Example from Hadlint website | ||
# https://hadolint.github.io/hadolint/ | ||
|
||
FROM debian | ||
|
||
RUN export node_version="0.10" \ | ||
&& apt-get update && apt-get -y install nodejs="$node_verion" | ||
|
||
COPY package.json usr/src/app | ||
|
||
RUN cd /usr/src/app \ | ||
&& npm install node-static | ||
|
||
EXPOSE 80000 | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters