snyk 1.809.0 → 1.813.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -168,7 +168,7 @@ snyk --help
168
168
 
169
169
  See the [full Snyk CLI help](./help/cli-commands).
170
170
 
171
- ## Authorization
171
+ ## Authenticating Snyk CLI
172
172
 
173
173
  Snyk CLI depends on [Snyk.io](https://snyk.io) APIs. Connect your Snyk CLI with [Snyk.io](https://snyk.io) by running:
174
174
 
@@ -176,6 +176,12 @@ Snyk CLI depends on [Snyk.io](https://snyk.io) APIs. Connect your Snyk CLI with
176
176
  snyk auth
177
177
  ```
178
178
 
179
+ ## Setting up language support
180
+
181
+ Depending on your project's language, you might need to setup your language environment before using Snyk.
182
+
183
+ See our [Language Support documentation](https://support.snyk.io/hc/en-us/articles/360020352437-Language-support-summary).
184
+
179
185
  ## Scanning your project
180
186
 
181
187
  If you are already in a folder with a supported project, start by running:
@@ -1910,23 +1910,49 @@ function extractReportingDescriptor(results) {
1910
1910
  if (tool[issue.id]) {
1911
1911
  return;
1912
1912
  }
1913
+ // custom rules may not have some of these fields so we check them first
1914
+ const fullDescriptionText = issue.subType
1915
+ ? `${upperFirst(issue.severity)} severity - ${issue.subType}`
1916
+ : `${upperFirst(issue.severity)} severity`;
1917
+ const issueText = issue.iacDescription.issue
1918
+ ? `The issue is... \n${issue.iacDescription.issue}\n\n`
1919
+ : '';
1920
+ const issueMarkdown = issue.iacDescription.issue
1921
+ ? `**The issue is...** \n${issue.iacDescription.issue}\n\n`
1922
+ : '';
1923
+ const impactText = issue.iacDescription.impact
1924
+ ? ` The impact of this is... \n ${issue.iacDescription.impact}\n\n`
1925
+ : '';
1926
+ const impactMarkdown = issue.iacDescription.impact
1927
+ ? ` **The impact of this is...** \n ${issue.iacDescription.impact}\n\n`
1928
+ : '';
1929
+ const resolveText = issue.iacDescription.resolve
1930
+ ? ` You can resolve this by... \n${issue.iacDescription.resolve}`
1931
+ : '';
1932
+ const resolveMarkdown = issue.iacDescription.resolve
1933
+ ? ` **You can resolve this by...** \n${issue.iacDescription.resolve}`
1934
+ : '';
1935
+ const tags = ['security'];
1936
+ if (issue.subType) {
1937
+ tags.push(issue.subType);
1938
+ }
1913
1939
  tool[issue.id] = {
1914
1940
  id: issue.id,
1915
1941
  shortDescription: {
1916
1942
  text: `${upperFirst(issue.severity)} severity - ${issue.title}`,
1917
1943
  },
1918
1944
  fullDescription: {
1919
- text: `${upperFirst(issue.severity)} severity - ${issue.subType}`,
1945
+ text: fullDescriptionText,
1920
1946
  },
1921
1947
  help: {
1922
- text: `The issue is... \n${issue.iacDescription.issue}\n\n The impact of this is... \n ${issue.iacDescription.impact}\n\n You can resolve this by... \n${issue.iacDescription.resolve}`.replace(/^\s+/g, ''),
1923
- markdown: `**The issue is...** \n${issue.iacDescription.issue}\n\n **The impact of this is...** \n ${issue.iacDescription.impact}\n\n **You can resolve this by...** \n${issue.iacDescription.resolve}`.replace(/^\s+/g, ''),
1948
+ text: `${issueText}${impactText}${resolveText}`.replace(/^\s+/g, ''),
1949
+ markdown: `${issueMarkdown}${impactMarkdown}${resolveMarkdown}`.replace(/^\s+/g, ''),
1924
1950
  },
1925
1951
  defaultConfiguration: {
1926
1952
  level: getIssueLevel(issue.severity),
1927
1953
  },
1928
1954
  properties: {
1929
- tags: ['security', `${issue.subType}`],
1955
+ tags,
1930
1956
  documentation: issue.documentation,
1931
1957
  },
1932
1958
  };
@@ -1937,10 +1963,14 @@ exports.extractReportingDescriptor = extractReportingDescriptor;
1937
1963
  function mapIacTestResponseToSarifResults(issues) {
1938
1964
  return issues.map(({ targetPath, issue }) => {
1939
1965
  const hasLineNumber = issue.lineNumber && issue.lineNumber >= 0;
1966
+ // custom rules may not have some of these fields so we check them first
1967
+ const affectingText = issue.subType
1968
+ ? ` affecting the ${issue.subType}`
1969
+ : '';
1940
1970
  return {
1941
1971
  ruleId: issue.id,
1942
1972
  message: {
1943
- text: `This line contains a potential ${issue.severity} severity misconfiguration affecting the ${issue.subType}`,
1973
+ text: `This line contains a potential ${issue.severity} severity misconfiguration${affectingText}`,
1944
1974
  },
1945
1975
  locations: [
1946
1976
  {