diff --git a/integrations/snyk/CHANGELOG.md b/integrations/snyk/CHANGELOG.md index 4035024092..0282d8f643 100644 --- a/integrations/snyk/CHANGELOG.md +++ b/integrations/snyk/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +# Snyk 0.1.3 (2023-10-16) + +### Improvements + +- Align README with configuration file (#3) + + # Snyk 0.1.2 (2023-10-02) ### Improvements diff --git a/integrations/snyk/README.md b/integrations/snyk/README.md index c4d6605877..80b3a083d7 100644 --- a/integrations/snyk/README.md +++ b/integrations/snyk/README.md @@ -44,78 +44,86 @@ To bring this data the integration is using the Snyk REST API in version 2021-08 blueprint.json ```json - { - "identifier": "snykTarget", - "title": "Snyk Target", - "icon": "Snyk", - "schema": { - "properties": { - "criticalOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open Critical Vulnerabilities" - }, - "highOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open High Vulnerabilities" - }, - "mediumOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open Medium Vulnerabilities" - }, - "lowOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open Low Vulnerabilities" - }, - "origin": { - "title": "Target Origin", - "type": "string", - "enum": [ - "artifactory-cr", - "aws-config", - "aws-lambda", - "azure-functions", - "azure-repos", - "bitbucket-cloud", - "bitbucket-server", - "cli", - "cloud-foundry", - "digitalocean-cr", - "docker-hub", - "ecr", - "gcr", - "github", - "github-cr", - "github-enterprise", - "gitlab", - "gitlab-cr", - "google-artifact-cr", - "harbor-cr", - "heroku", - "ibm-cloud", - "kubernetes", - "nexus-cr", - "pivotal", - "quay-cr", - "terraform-cloud" - ] - } +{ + "identifier":"snykTarget", + "title":"Snyk Target", + "icon":"Snyk", + "schema":{ + "properties":{ + "criticalOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open Critical Vulnerabilities" + }, + "highOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open High Vulnerabilities" + }, + "mediumOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open Medium Vulnerabilities" + }, + "lowOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open Low Vulnerabilities" + }, + "origin":{ + "title":"Target Origin", + "type":"string", + "enum":[ + "artifactory-cr", + "aws-config", + "aws-lambda", + "azure-functions", + "azure-repos", + "bitbucket-cloud", + "bitbucket-server", + "cli", + "cloud-foundry", + "digitalocean-cr", + "docker-hub", + "ecr", + "gcr", + "github", + "github-cr", + "github-enterprise", + "gitlab", + "gitlab-cr", + "google-artifact-cr", + "harbor-cr", + "heroku", + "ibm-cloud", + "kubernetes", + "nexus-cr", + "pivotal", + "quay-cr", + "terraform-cloud" + ] + } }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": {} - } + "required":[] + }, + "mirrorProperties":{}, + "calculationProperties":{}, + "relations":{ + "snykProjects":{ + "title":"Snyk Projects", + "target":"snykProject", + "required":false, + "many":true + } + } +} ```
port-app-config.yaml ```yaml +resources: - kind: target selector: query: 'true' @@ -131,6 +139,8 @@ To bring this data the integration is using the Snyk REST API in version 2021-08 mediumOpenVulnerabilities: '[.__projects[].meta.latest_issue_counts.medium] | add' lowOpenVulnerabilities: '[.__projects[].meta.latest_issue_counts.low] | add' criticalOpenVulnerabilities: '[.__projects[].meta.latest_issue_counts.critical] | add' + relations: + snykProjects: '[.__projects[].id]' ```
@@ -143,107 +153,108 @@ To bring this data the integration is using the Snyk REST API in version 2021-08 ```json { - "identifier": "snykProject", - "description": "This blueprint represents a snyk project in our software catalog", - "title": "Snyk Project", - "icon": "Snyk", - "schema": { - "properties": { - "url": { - "type": "string", - "title": "URL", - "format": "url", - "icon": "Snyk" + "identifier":"snykProject", + "title":"Snyk Project", + "icon":"Snyk", + "schema":{ + "properties":{ + "url":{ + "type":"string", + "title":"URL", + "format":"url", + "icon":"Snyk" }, - "owner": { - "type": "string", - "title": "Owner", - "format": "user", - "icon": "TwoUsers" + "owner":{ + "type":"string", + "title":"Owner", + "format":"user", + "icon":"TwoUsers" }, - "businessCriticality": { - "title": "Business Criticality", - "type": "array", - "items": { - "type": "string", - "enum": [ - "critical", - "high", - "medium", - "low" - ] - }, - "icon": "DefaultProperty" - }, - "environment": { - "items": { - "type": "string", - "enum": [ - "frontend", - "backend", - "internal", - "external", - "mobile", - "saas", - "onprem", - "hosted", - "distributed" - ] - }, - "icon": "Environment", - "title": "Environment", - "type": "array" + "businessCriticality":{ + "title":"Business Criticality", + "type":"array", + "items":{ + "type":"string", + "enum":[ + "critical", + "high", + "medium", + "low" + ] + }, + "icon":"DefaultProperty" }, - "lifeCycle": { - "title": "Life Cycle", - "type": "array", - "items": { - "type": "string", - "enum": [ - "development", - "sandbox", - "production" - ] - }, - "icon": "DefaultProperty" + "environment":{ + "items":{ + "type":"string", + "enum":[ + "frontend", + "backend", + "internal", + "external", + "mobile", + "saas", + "onprem", + "hosted", + "distributed" + ] + }, + "icon":"Environment", + "title":"Environment", + "type":"array" }, - "highOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open High Vulnerabilities" + "lifeCycle":{ + "title":"Life Cycle", + "type":"array", + "items":{ + "type":"string", + "enum":[ + "development", + "sandbox", + "production" + ] + }, + "icon":"DefaultProperty" }, - "mediumOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open Medium Vulnerabilities" + "highOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open High Vulnerabilities" }, - "lowOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open Low Vulnerabilities" + "mediumOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open Medium Vulnerabilities" }, - "criticalOpenVulnerabilities": { - "icon": "Vulnerability", - "type": "number", - "title": "Open Low Vulnerabilities" + "lowOpenVulnerabilities":{ + "icon":"Vulnerability", + "type":"number", + "title":"Open Low Vulnerabilities" }, - "importedBy": { - "icon": "TwoUsers", - "type": "string", - "title": "Imported By", - "format": "user" + "importedBy":{ + "icon":"TwoUsers", + "type":"string", + "title":"Imported By", + "format":"user" }, - "tags": { - "type": "array", - "title": "Tags", - "icon": "DefaultProperty" + "tags":{ + "type":"array", + "title":"Tags", + "icon":"DefaultProperty" } - }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": {} + }, + "required":[] + }, + "mirrorProperties":{}, + "calculationProperties":{}, + "relations":{ + "snykVulnerabilities":{ + "title":"Snyk Vulnerabilities", + "target":"snykVulnerability", + "required":false, + "many":true + } + } } ``` @@ -273,6 +284,8 @@ resources: criticalOpenVulnerabilities: .meta.latest_issue_counts.critical importedBy: .__importer.email tags: .attributes.tags + relations: + snykVulnerabilities: '[.__issues[] | select(.issueType == "vuln").issueData.id]' ``` @@ -285,89 +298,81 @@ To bring this data the integration is using the Snyk v1 API. ```json { - "identifier": "snykVulnerability", - "description": "This blueprint represents a Snyk vulnerability in our software catalog", - "title": "Snyk Vulnerability", - "icon": "Snyk", - "schema": { - "properties": { - "score": { - "icon": "Star", - "type": "number", - "title": "Score" + "identifier":"snykVulnerability", + "title":"Snyk Vulnerability", + "icon":"Snyk", + "schema":{ + "properties":{ + "score":{ + "icon":"Star", + "type":"number", + "title":"Score" }, - "packageName": { - "type": "string", - "title": "Package Name", - "icon": "DefaultProperty" + "packageName":{ + "type":"string", + "title":"Package Name", + "icon":"DefaultProperty" }, - "packageVersions": { - "icon": "Package", - "title": "Package Versions", - "type": "array" + "packageVersions":{ + "icon":"Package", + "title":"Package Versions", + "type":"array" }, - "type": { - "type": "string", - "title": "Type", - "enum": [ - "vuln", - "license", - "configuration" - ], - "icon": "DefaultProperty" + "type":{ + "type":"string", + "title":"Type", + "enum":[ + "vuln", + "license", + "configuration" + ], + "icon":"DefaultProperty" }, - "severity": { - "icon": "Alert", - "title": "Issue Severity", - "type": "string", - "enum": [ - "low", - "medium", - "high", - "critical" - ], - "enumColors": { - "low": "green", - "medium": "yellow", - "high": "red", - "critical": "red" - } + "severity":{ + "icon":"Alert", + "title":"Issue Severity", + "type":"string", + "enum":[ + "low", + "medium", + "high", + "critical" + ], + "enumColors":{ + "low":"green", + "medium":"yellow", + "high":"red", + "critical":"red" + } }, - "url": { - "icon": "Link", - "type": "string", - "title": "Issue URL", - "format": "url" + "url":{ + "icon":"Link", + "type":"string", + "title":"Issue URL", + "format":"url" }, - "language": { - "type": "string", - "title": "Language", - "icon": "DefaultProperty" + "language":{ + "type":"string", + "title":"Language", + "icon":"DefaultProperty" }, - "publicationTime": { - "type": "string", - "format": "date-time", - "title": "Publication Time", - "icon": "DefaultProperty" + "publicationTime":{ + "type":"string", + "format":"date-time", + "title":"Publication Time", + "icon":"DefaultProperty" }, - "isPatched": { - "type": "boolean", - "title": "Is Patched", - "icon": "DefaultProperty" + "isPatched":{ + "type":"boolean", + "title":"Is Patched", + "icon":"DefaultProperty" } - }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": { - "snykProject": { - "title": "Project", - "target": "snykProject", - "required": false, - "many": false - } - } + }, + "required":[] + }, + "mirrorProperties":{}, + "calculationProperties":{}, + "relations":{} } ``` @@ -376,7 +381,7 @@ To bring this data the integration is using the Snyk v1 API. ```yaml resources: - - kind: vulnerability + - kind: issue selector: query: '.issueType == "vuln"' port: @@ -395,8 +400,6 @@ resources: language: .issueData.language // .issueType publicationTime: .issueData.publicationTime isPatched: .isPatched - relations: - snykProject: .__project.id ``` diff --git a/integrations/snyk/pyproject.toml b/integrations/snyk/pyproject.toml index f4ef917d4c..c1fef0dcd7 100644 --- a/integrations/snyk/pyproject.toml +++ b/integrations/snyk/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "snyk" -version = "0.1.2" +version = "0.1.3" description = "Snyk integration powered by Ocean" authors = ["Isaac Coffie "]