From 424af4aeab43b1281936d827a7fb87f932f4a78c Mon Sep 17 00:00:00 2001 From: manukumar6 Date: Thu, 6 Jun 2024 17:55:25 +0530 Subject: [PATCH 1/4] BCE-32715 --- openapi-specs/code/CI-CDRisks.json | 499 ++++++++++++++++++ openapi-specs/code/Repositories.json | 738 ++++++++++++++++++++++++--- openapi-specs/code/Repository.json | 10 +- openapi-specs/code/SBOM.json | 350 +++++++++++++ 4 files changed, 1511 insertions(+), 86 deletions(-) create mode 100644 openapi-specs/code/CI-CDRisks.json create mode 100644 openapi-specs/code/SBOM.json diff --git a/openapi-specs/code/CI-CDRisks.json b/openapi-specs/code/CI-CDRisks.json new file mode 100644 index 000000000..62c37594e --- /dev/null +++ b/openapi-specs/code/CI-CDRisks.json @@ -0,0 +1,499 @@ +{ + "components": { + "examples": {}, + "headers": {}, + "parameters": {}, + "requestBodies": {}, + "responses": {}, + "securitySchemes": { + "CustomAuthorizer": { + "in": "header", + "name": "authorization", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "authorizerResultTtlInSeconds": 0, + "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-v2-authorizer-{UniqueTag}{Alias}/invocations", + "identitySource": "method.request.header.authorization", + "type": "request" + }, + "x-amazon-apigateway-authtype": "custom" + } + }, + "schemas": { + "AlertData": { + "additionalProperties": false, + "properties": { + "details": { + "description": "CI/CD Risk event details", + "type": "string" + }, + "detectedOn": { "type": "string" }, + "id": { "description": "CI/CD Risk event ID", "type": "string" }, + "instanceId": { + "description": "CI/CD Risk instance ID", + "type": "string" + }, + "lastCalculatedOn": { + "description": "Last calculation time", + "type": "string" + }, + "repositoryId": { + "description": "VCS repository ID", + "type": "string" + }, + "title": { "description": "CI/CD Risk event title", "type": "string" } + }, + "required": [ + "id", + "title", + "details", + "detectedOn", + "lastCalculatedOn" + ], + "type": "object" + }, + "GetAlertsDataResponse": { + "additionalProperties": false, + "properties": { + "data": { + "items": { "$ref": "#/components/schemas/AlertData" }, + "type": "array" + }, + "hasNext": { "type": "boolean" } + }, + "required": ["data", "hasNext"], + "type": "object" + }, + "GetRiskDetailsDataResponse": { + "additionalProperties": false, + "properties": { + "data": { "$ref": "#/components/schemas/RiskDetails" } + }, + "required": ["data"], + "type": "object" + }, + "GetRisksDataResponse": { + "additionalProperties": false, + "properties": { + "data": { + "items": { "$ref": "#/components/schemas/RiskData" }, + "type": "array" + }, + "hasNext": { "type": "boolean" } + }, + "required": ["data", "hasNext"], + "type": "object" + }, + "RiskData": { + "additionalProperties": false, + "properties": { + "category": { + "description": "CI/CD Risk category", + "type": "string" + }, + "fixedAlerts": { + "description": "Number of fixed events", + "format": "double", + "type": "number" + }, + "lastAlertOn": { + "description": "Date and time of last alert", + "type": "string" + }, + "name": { "description": "CI/CD Risk name", "type": "string" }, + "openAlerts": { + "description": "Number of opened events", + "format": "double", + "type": "number" + }, + "policyId": { + "description": "CI/CD Risk policy ID", + "type": "string" + }, + "severity": { + "description": "CI/CD Risk severity", + "type": "string" + }, + "status": { "description": "CI/CD Risk status", "type": "string" }, + "system": { "description": "CI/CD Risk system", "type": "string" }, + "totalAlerts": { + "description": "Number of total events", + "format": "double", + "type": "number" + } + }, + "required": [ + "policyId", + "name", + "status", + "category", + "severity", + "system", + "openAlerts", + "fixedAlerts", + "totalAlerts", + "lastAlertOn" + ], + "type": "object" + }, + "RiskDetails": { + "additionalProperties": false, + "properties": { + "category": { + "description": "CI/CD Risk category", + "type": "string" + }, + "description": { + "description": "CI/CD Risk description", + "type": "string" + }, + "fixedAlerts": { + "description": "Number of fixed events", + "format": "double", + "type": "number" + }, + "lastCalculatedOn": { + "description": "Last calculation time", + "type": "string" + }, + "locationInDeliveryChain": { + "description": "Location in delivery chain", + "type": "string" + }, + "name": { "description": "CI/CD Risk name", "type": "string" }, + "openAlerts": { + "description": "Number of open events", + "format": "double", + "type": "number" + }, + "policyId": { + "description": "CI/CD Risk policy ID", + "type": "string" + }, + "severity": { + "description": "CI/CD Risk severity", + "type": "string" + }, + "stepsToSolve": { + "description": "Description of steps to solve the risk", + "type": "string" + }, + "suppressedAlerts": { + "description": "Number of suppressed events", + "format": "double", + "type": "number" + }, + "system": { "description": "CI/CD Risk system", "type": "string" } + }, + "required": [ + "policyId", + "name", + "description", + "stepsToSolve", + "category", + "severity", + "system", + "openAlerts", + "suppressedAlerts", + "fixedAlerts", + "locationInDeliveryChain", + "lastCalculatedOn" + ], + "type": "object" + } + } + }, + "info": { + "contact": {}, + "description": "The CI/CD endpoints are listed below.", + "title": "Prisma Cloud CI/CD API Overview", + "version": "Latest" + }, + "openapi": "3.0.0", + "paths": { + "/code/code/api/v1/pipeline-risks": { + "post": { + "operationId": "pipelineRisksGetAll", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "categories": { + "description": "CI/CD Risks categories: [`ppe`, `identifyAccessManagement`, `thirdPartyServices`, `dependencyChains`, `credentialHygiene`, `pipelineBasedAccessControls`, `artifactIntegrityValidation`, `dataProtection`, `flowControlMechanism`, `systemConfiguration`, `loggingAndVisibility`]", + "items": { "type": "string" }, + "type": "array" + }, + "endDate": { "type": "string" }, + "levels": { + "description": "CI/CD Risk priority level: [`1`, `2`, `3`, `4`]", + "items": { "type": "string" }, + "type": "array" + }, + "names": { + "description": "CI/CD Risk name", + "items": { "type": "string" }, + "type": "array" + }, + "repositoryIds": { + "items": { "type": "string" }, + "type": "array" + }, + "severities": { + "description": "CI/CD Risk severity: [`info`, `low`, `medium`, `high`, `critical`]", + "items": { "type": "string" }, + "type": "array" + }, + "startDate": { "type": "string" }, + "status": { "type": "string" }, + "systems": { + "description": "CI/CD Systems [`crosssystem`, `github`, `gitlab`, `githubActions`, `gitlabCICD`, `bitbucket`, `jenkins`, `circleCI`]", + "items": { "type": "string" }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRisksDataResponse" + } + } + }, + "description": "Get pipeline risks" + }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get All CI/CD Risks Summary", + "tags": ["CI-CD Risks"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/pipeline-risks\"\n\npayload = {\n \"categories\": [\"string\"],\n \"endDate\": \"string\",\n \"levels\": [\"string\"],\n \"names\": [\"string\"],\n \"repositoryIds\": [\"string\"],\n \"severities\": [\"string\"],\n \"startDate\": \"string\",\n \"status\": \"string\",\n \"systems\": [\"string\"]\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request POST \\\n --url http://undefinedundefined/code/code/api/v1/pipeline-risks \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"categories\":[\"string\"],\"endDate\":\"string\",\"levels\":[\"string\"],\"names\":[\"string\"],\"repositoryIds\":[\"string\"],\"severities\":[\"string\"],\"startDate\":\"string\",\"status\":\"string\",\"systems\":[\"string\"]}'" + } + ] + } + }, + "/code/code/api/v1/pipeline-risks/{policyId}/alerts": { + "post": { + "description": "Get CI/CD risk events by status (open, suppressed, fixed)", + "operationId": "pipelineRisksGetAlertsByPolicy", + "parameters": [ + { + "description": "- CI/CD Risk policy ID", + "in": "path", + "name": "policyId", + "required": true, + "schema": { "type": "string" } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "format": "int32", + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { "format": "int32", "minimum": 0, "type": "integer" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "endDate": { "type": "string" }, + "repositoryIds": { + "items": { "type": "string" }, + "type": "array" + }, + "startDate": { "type": "string" }, + "status": { + "description": "CI/CD Riks status: [`open`, `suppressed`, `fixed`]", + "type": "string" + } + }, + "required": ["status"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAlertsDataResponse" + } + } + }, + "description": "Ok" + }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get CI/CD Risk Events", + "tags": ["CI-CD Risks"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/pipeline-risks/{policyId}/alerts\"\n\nquerystring = {\"limit\":\"SOME_INTEGER_VALUE\",\"offset\":\"SOME_INTEGER_VALUE\"}\n\npayload = {\n \"endDate\": \"string\",\n \"repositoryIds\": [\"string\"],\n \"startDate\": \"string\",\n \"status\": \"string\"\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request POST \\\n --url 'http://undefinedundefined/code/code/api/v1/pipeline-risks/{policyId}/alerts?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"endDate\":\"string\",\"repositoryIds\":[\"string\"],\"startDate\":\"string\",\"status\":\"string\"}'" + } + ] + } + }, + "/code/code/api/v1/pipeline-risks/{policyId}/details": { + "get": { + "description": "Get CI/CD risk details by policy ID", + "operationId": "pipelineRisksGetDetailsByPolicyGet", + "parameters": [ + { + "description": "- CI/CD Risk policy ID", + "in": "path", + "name": "policyId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRiskDetailsDataResponse" + } + } + }, + "description": "Ok" + }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get CI/CD Risk Details", + "tags": ["CI-CD Risks"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/pipeline-risks/{policyId}/details\"\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url http://undefinedundefined/code/code/api/v1/pipeline-risks/{policyId}/details \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/code/api/v1/pipeline-risks/suppress": { + "put": { + "description": "Suppress CI/CD risk events by event ID", + "operationId": "pipelineRisksSuppressEvents", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "description": "CI/CD risk event ID", + "items": { "type": "string" }, + "type": "array" + } + }, + "required": ["ids"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "204": { "description": "No content" }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Suppress CI/CD Risk Events", + "tags": ["CI-CD Risks"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/pipeline-risks/suppress\"\n\npayload = {\"ids\": [\"string\"]}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request PUT \\\n --url http://undefinedundefined/code/code/api/v1/pipeline-risks/suppress \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"ids\":[\"string\"]}'" + } + ] + } + }, + "/code/code/api/v1/pipeline-risks/unsuppress": { + "put": { + "description": "Unsuppress CI/CD risk events by event ID", + "operationId": "pipelineRisksUnsuppressEvents", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "description": "CI/CD risk event ID", + "items": { "type": "string" }, + "type": "array" + } + }, + "required": ["ids"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "204": { "description": "No content" }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Unsuppress CI/CD Risk Events", + "tags": ["CI-CD Risks"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/pipeline-risks/unsuppress\"\n\npayload = {\"ids\": [\"string\"]}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request PUT \\\n --url http://undefinedundefined/code/code/api/v1/pipeline-risks/unsuppress \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"ids\":[\"string\"]}'" + } + ] + } + } + }, + "servers": null, + "tags": [{ "name": "CI-CD Risks" }] +} diff --git a/openapi-specs/code/Repositories.json b/openapi-specs/code/Repositories.json index f5ae3490b..620144935 100644 --- a/openapi-specs/code/Repositories.json +++ b/openapi-specs/code/Repositories.json @@ -12,7 +12,7 @@ "type": "apiKey", "x-amazon-apigateway-authorizer": { "authorizerResultTtlInSeconds": 0, - "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-authorizer-{UniqueTag}{Alias}/invocations", + "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-v2-authorizer-{UniqueTag}{Alias}/invocations", "identitySource": "method.request.header.authorization", "type": "request" }, @@ -42,6 +42,43 @@ "required": ["source", "branches"], "type": "object" }, + "CIType": { + "enum": ["githubActions", "circleci", "codebuild", "jenkins"], + "type": "string" + }, + "CiInstancesHash": { + "additionalProperties": { + "$ref": "#/components/schemas/ICiInstanceInfo" + }, + "properties": {}, + "type": "object" + }, + "Contributor": { + "properties": { + "contributionsCounts": { + "description": "Number of contributions", + "format": "double", + "type": "number" + }, + "id": { "type": "string" }, + "lastPush": { "format": "double", "type": "number" }, + "name": { "description": "Contributor name", "type": "string" }, + "permission": { + "description": "Contributor permission", + "type": "string" + } + }, + "required": ["contributionsCounts", "name", "id"], + "type": "object" + }, + "DockerImage": { + "properties": { + "imageName": { "type": "string" }, + "repoName": { "type": "string" } + }, + "required": ["repoName", "imageName"], + "type": "object" + }, "GetRepositorySearchResponse": { "additionalProperties": false, "properties": { @@ -54,6 +91,222 @@ "required": ["data", "hasNext"], "type": "object" }, + "ICiInstanceInfo": { + "additionalProperties": false, + "properties": { + "ciType": { + "$ref": "#/components/schemas/CIType", + "description": "CI pipeline type" + }, + "customerName": { + "description": "Customer Prisma ID", + "type": "string" + }, + "id": { "type": "string" }, + "name": { "description": "CI pipeline name", "type": "string" }, + "pipelines": { + "items": { "$ref": "#/components/schemas/PipelineInfo" }, + "type": "array" + } + }, + "required": ["ciType", "customerName", "id", "name", "pipelines"], + "type": "object" + }, + "IVCSRepository": { + "additionalProperties": false, + "properties": { + "casId": { "type": "string" }, + "ciFiles": { + "description": "CI files path", + "items": { "type": "string" }, + "type": "array" + }, + "customerName": { + "description": "Customer Prisma ID", + "type": "string" + }, + "defaultBranch": { + "description": "Default branch", + "type": "string" + }, + "defaultGithubActionsWorkflowPermission": { + "enum": ["read", "write"], + "type": "string" + }, + "failedCustomerPRs": { "format": "double", "type": "number" }, + "fullName": { + "description": "Repository full name", + "type": "string" + }, + "hasCoderOwner": { + "description": "Repository contains code owner file (True/False)", + "type": "boolean" + }, + "id": { "description": "VCS repository ID", "type": "string" }, + "isAllGithubActionsAllowed": { "type": "boolean" }, + "isArchived": { + "description": "Archived repository (True/False)", + "type": "boolean" + }, + "isForkingAllowed": { + "description": "Is forking allowed in the repository", + "type": "boolean" + }, + "isGithubActionsEnabled": { + "description": "Is Github Actions enabled in the repository", + "type": "boolean" + }, + "isRequiresCommitSignatures": { "type": "boolean" }, + "isRequiresStatusChecks": { "type": "boolean" }, + "isRestrictsPushes": { "type": "boolean" }, + "lastUpdated": { + "description": "VCS Repository last update time", + "type": "string" + }, + "name": { + "description": "VCS Repository short name", + "type": "string" + }, + "openFixPRs": { "format": "double", "type": "number" }, + "originId": { "type": "string" }, + "privacyLevel": { + "$ref": "#/components/schemas/RepositoryPrivacyLabel" + }, + "provider": { "$ref": "#/components/schemas/RepositoryProvider" }, + "repositorySize": { + "description": "VCS Repository size", + "format": "double", + "type": "number" + }, + "sessionId": { "type": "string" }, + "totalCommitsCount": { + "description": "Total commits count", + "format": "double", + "type": "number" + }, + "totalContributorsCount": { + "description": "Total contributors count", + "format": "double", + "type": "number" + }, + "totalCustomerPRs": { "format": "double", "type": "number" }, + "type": { + "enum": ["VCSRepository"], + "nullable": false, + "type": "string" + }, + "url": { "description": "VCS Repository URL", "type": "string" }, + "workspaceId": { + "description": "VCS workspace/integration ID", + "type": "string" + }, + "workspaceName": { + "description": "VCS workspace/integration name", + "type": "string" + } + }, + "required": [ + "id", + "customerName", + "type", + "failedCustomerPRs", + "totalCustomerPRs", + "ciFiles", + "url", + "casId" + ], + "type": "object" + }, + "Issues": { + "allOf": [ + { "$ref": "#/components/schemas/SeverityIssues" }, + { + "properties": { + "moduleName": { "$ref": "#/components/schemas/SecurityModule" } + }, + "type": "object" + } + ] + }, + "ModuleIssues": { + "properties": { + "CICD": { + "allOf": [ + { "$ref": "#/components/schemas/SeverityIssues" }, + { + "properties": { + "TOTAL": { "format": "double", "type": "number" } + }, + "required": ["TOTAL"], + "type": "object" + } + ] + }, + "IAC": { + "allOf": [ + { "$ref": "#/components/schemas/SeverityIssues" }, + { + "properties": { + "TOTAL": { "format": "double", "type": "number" } + }, + "required": ["TOTAL"], + "type": "object" + } + ] + }, + "SCA": { + "allOf": [ + { "$ref": "#/components/schemas/SeverityIssues" }, + { + "properties": { + "TOTAL": { "format": "double", "type": "number" } + }, + "required": ["TOTAL"], + "type": "object" + } + ] + }, + "SECRETS": { + "allOf": [ + { "$ref": "#/components/schemas/SeverityIssues" }, + { + "properties": { + "TOTAL": { "format": "double", "type": "number" } + }, + "required": ["TOTAL"], + "type": "object" + } + ] + } + }, + "type": "object" + }, + "OrderBy": { + "properties": { + "fieldName": { "type": "string" }, + "isAsc": { "type": "boolean" }, + "type": { "type": "string" } + }, + "required": ["isAsc", "type", "fieldName"], + "type": "object" + }, + "Pagination": { + "properties": { + "page": { "format": "double", "type": "number" }, + "pageSize": { "format": "double", "type": "number" } + }, + "required": ["pageSize", "page"], + "type": "object" + }, + "PipelineInfo": { + "properties": { + "instance": { "type": "string" }, + "pipeline": { "type": "string" }, + "system": { "type": "string" } + }, + "required": ["pipeline", "system", "instance"], + "type": "object" + }, "QueryRepositoriesRequest": { "additionalProperties": false, "properties": { @@ -62,6 +315,87 @@ "required": ["repositoriesIds"], "type": "object" }, + "RdsRepoInfo": { + "properties": { + "casId": { "type": "string" }, + "categorizedTechnologies": { + "$ref": "#/components/schemas/Technologies" + }, + "ciFiles": { "items": { "type": "string" }, "type": "array" }, + "ciInstances": { "$ref": "#/components/schemas/CiInstancesHash" }, + "contributors": { + "items": { "$ref": "#/components/schemas/Contributor" }, + "type": "array" + }, + "contributorsCount": { "format": "double", "type": "number" }, + "customerName": { "type": "string" }, + "defaultBranch": { "type": "string" }, + "fullName": { "type": "string" }, + "hasCoderOwner": { "type": "boolean" }, + "id": { "type": "string" }, + "images": { "items": { "type": "string" }, "type": "array" }, + "integrationId": { "type": "string" }, + "isArchived": { "type": "boolean" }, + "issues": { "$ref": "#/components/schemas/ModuleIssues" }, + "lastCommitTimestamp": { "format": "double", "type": "number" }, + "lastUpdated": { "type": "string" }, + "metadata": { + "properties": { + "runtimeImagesMetadata": { + "items": { + "additionalProperties": { + "anyOf": [{ "type": "string" }, { "type": "boolean" }] + }, + "properties": {}, + "type": "object" + }, + "type": "array" + }, + "scansMetadata": { + "additionalProperties": { + "anyOf": [{ "type": "string" }, { "type": "boolean" }] + }, + "properties": {}, + "type": "object" + } + }, + "required": ["runtimeImagesMetadata", "scansMetadata"], + "type": "object" + }, + "name": { "type": "string" }, + "privacyLevel": { + "$ref": "#/components/schemas/RepositoryPrivacyLabel" + }, + "provider": { "$ref": "#/components/schemas/RepositoryProvider" }, + "repositorySize": { "format": "double", "type": "number" }, + "riskFactors": { "$ref": "#/components/schemas/RiskFactors" }, + "source": { "$ref": "#/components/schemas/SourceTypes" }, + "totalCommitsCount": { "format": "double", "type": "number" }, + "url": { "type": "string" }, + "weeklyCommitOnPrs": { + "items": { "$ref": "#/components/schemas/WeeklyCommitOnPrs" }, + "type": "array" + }, + "workspaceId": { "type": "string" }, + "workspaceName": { "type": "string" } + }, + "required": [ + "metadata", + "images", + "integrationId", + "source", + "customerName", + "url", + "provider", + "fullName", + "name", + "isArchived", + "defaultBranch", + "casId", + "id" + ], + "type": "object" + }, "RepoIdToRepoName": { "additionalProperties": false, "properties": { @@ -71,6 +405,109 @@ "required": ["id", "repository"], "type": "object" }, + "RepoInfo": { + "allOf": [ + { "$ref": "#/components/schemas/IVCSRepository" }, + { + "properties": { + "categorizedTechnologies": { + "$ref": "#/components/schemas/Technologies" + }, + "ciInstances": { + "additionalProperties": { + "$ref": "#/components/schemas/ICiInstanceInfo" + }, + "properties": {}, + "type": "object" + }, + "contributors": { + "items": { "$ref": "#/components/schemas/Contributor" }, + "type": "array" + }, + "contributorsCount": { "format": "double", "type": "number" }, + "dockerImages": { + "items": { "$ref": "#/components/schemas/DockerImage" }, + "type": "array" + }, + "issues": { "$ref": "#/components/schemas/Issues" }, + "weeklyCommitOnPrs": { + "items": { "$ref": "#/components/schemas/WeeklyCommitOnPR" }, + "type": "array" + } + }, + "required": ["weeklyCommitOnPrs", "issues"], + "type": "object" + } + ] + }, + "RepoRequestBody": { + "properties": { + "filters": { "$ref": "#/components/schemas/RepoRequestFilters" }, + "orderBy": { "$ref": "#/components/schemas/OrderBy" }, + "pageConfig": { "$ref": "#/components/schemas/Pagination" } + }, + "type": "object" + }, + "RepoRequestFilters": { + "properties": { + "archived": { + "description": "An array with length of 1 containing either ‘true’ or ‘false’, filter between archived and not archived repositories", + "items": { "type": "string" }, + "type": "array" + }, + "casIds": { "items": { "type": "string" }, "type": "array" }, + "ciFiles": { + "description": "CI files path", + "items": { "type": "string" }, + "type": "array" + }, + "customerName": { "type": "string" }, + "ids": { + "description": "VCS repository IDs", + "items": { "type": "string" }, + "type": "array" + }, + "images": { "items": { "type": "string" }, "type": "array" }, + "issues": { + "description": "Issues enum: [`IAC`, `SCA`, `SECRETS`, `CICD`, `SAST`]\nFilter repositories containing issues of the requested type", + "items": { "type": "string" }, + "type": "array" + }, + "lastUpdated": { "format": "date-time", "type": "string" }, + "name": { + "description": "Search repositories by free text", + "type": "string" + }, + "pipelines": { + "description": "Get all repositories linked to the specified pipelines", + "items": { "type": "string" }, + "type": "array" + }, + "privacyLevels": { + "items": { "$ref": "#/components/schemas/RepositoryPrivacyLabel" }, + "type": "array" + }, + "providers": { + "items": { "$ref": "#/components/schemas/RepositoryProvider" }, + "type": "array" + }, + "riskFactors": { + "items": { "$ref": "#/components/schemas/RiskFactorsType" }, + "type": "array" + }, + "technologies": { + "description": "Get repositories that make use of the specified technologies", + "items": { "type": "string" }, + "type": "array" + }, + "workspaceIds": { + "description": "Array of repository owners, filter all repositories owned by specified owners", + "items": { "type": "string" }, + "type": "array" + } + }, + "type": "object" + }, "RepositoriesResponse": { "additionalProperties": false, "properties": { @@ -101,7 +538,7 @@ "lastScanDate": { "type": "string" }, "owner": { "type": "string" }, "repository": { "type": "string" }, - "selected": { "enum": [true], "nullable": false, "type": "boolean" }, + "selected": { "type": "boolean" }, "source": { "type": "string" }, "url": { "type": "string" } }, @@ -115,6 +552,139 @@ ], "type": "object" }, + "RepositoryPrivacyLabel": { + "enum": ["public", "private", "internal"], + "nullable": true, + "type": "string" + }, + "RepositoryProvider": { "type": "string" }, + "RiskFactors": { + "properties": { + "isInternetExpose": { "type": "boolean" }, + "isRepositoryDeployed": { "type": "boolean" } + }, + "type": "object" + }, + "RiskFactorsType": { + "enum": ["isInternetExpose", "isRepositoryDeployed"], + "type": "string" + }, + "SecurityModule": { + "enum": ["IAC", "SCA", "SECRETS", "CICD"], + "type": "string" + }, + "SeverityIssues": { + "properties": { + "CRITICAL": { + "anyOf": [ + { "format": "double", "type": "number" }, + { "$ref": "#/components/schemas/SecurityModule" } + ] + }, + "HIGH": { + "anyOf": [ + { "format": "double", "type": "number" }, + { "$ref": "#/components/schemas/SecurityModule" } + ] + }, + "INFO": { + "anyOf": [ + { "format": "double", "type": "number" }, + { "$ref": "#/components/schemas/SecurityModule" } + ] + }, + "LOW": { + "anyOf": [ + { "format": "double", "type": "number" }, + { "$ref": "#/components/schemas/SecurityModule" } + ] + }, + "MEDIUM": { + "anyOf": [ + { "format": "double", "type": "number" }, + { "$ref": "#/components/schemas/SecurityModule" } + ] + } + }, + "type": "object" + }, + "SourceTypes": { + "enum": [ + "admissionController", + "AlibabaCloud", + "AWS", + "Azure", + "AzureOnPrem", + "AzureRepos", + "Bitbucket", + "bitbucketEnterprise", + "circleci", + "cli", + "codebuild", + "GCP", + "Github", + "githubActions", + "githubEnterprise", + "Gitlab", + "gitlabEnterprise", + "jenkins", + "Kubernetes", + "kubernetesWorkloads", + "terraformCloud", + "terraformEnterprise", + "tfcRunTasks", + "tfeRunTasks", + "Transporter", + "OnPrem" + ], + "type": "string" + }, + "Technologies": { + "properties": { + "CICD": { "$ref": "#/components/schemas/Technology" }, + "Configuration": { "$ref": "#/components/schemas/Technology" }, + "Data": { "$ref": "#/components/schemas/Technology" }, + "Devops": { "$ref": "#/components/schemas/Technology" }, + "Documentation": { "$ref": "#/components/schemas/Technology" }, + "License": { "$ref": "#/components/schemas/Technology" }, + "Markup": { "$ref": "#/components/schemas/Technology" }, + "PackageManager": { "$ref": "#/components/schemas/Technology" }, + "Programming": { "$ref": "#/components/schemas/Technology" }, + "Prose": { "$ref": "#/components/schemas/Technology" }, + "Unknown": { "$ref": "#/components/schemas/Technology" } + }, + "type": "object" + }, + "Technology": { + "additionalProperties": { + "properties": { + "detectedDate": { "format": "date-time", "type": "string" }, + "percentage": { "format": "double", "type": "number" } + }, + "required": ["detectedDate"], + "type": "object" + }, + "properties": {}, + "type": "object" + }, + "WeeklyCommitOnPR": { + "properties": { + "branchName": { "type": "string" }, + "currWeeklyCommits": { "format": "double", "type": "number" }, + "prevWeeklyCommits": { "format": "double", "type": "number" } + }, + "required": ["prevWeeklyCommits", "currWeeklyCommits", "branchName"], + "type": "object" + }, + "WeeklyCommitOnPrs": { + "properties": { + "branchName": { "type": "string" }, + "currWeeklyCommits": { "format": "double", "type": "number" }, + "prevWeeklyCommits": { "format": "double", "type": "number" } + }, + "required": ["prevWeeklyCommits", "currWeeklyCommits", "branchName"], + "type": "object" + }, "integrationResponse": { "additionalProperties": false, "properties": { @@ -169,7 +739,7 @@ }, "openapi": "3.0.0", "paths": { - "/code/api/v1/repositories": { + "/code/code/api/v1/repositories": { "get": { "description": "Retrieve a list of integrated repositories.\neach repository item includes: id, repoName, source, owner, isPublic, creationDate", "operationId": "getRepositories", @@ -232,14 +802,20 @@ "security": [{ "CustomAuthorizer": [] }], "summary": "List repository list", "tags": ["Repositories"], + "x-bc-required-permissions": [ + "CCSProjects_READ", + "CCSDevelopmentPipelinesCodeReviews_READ", + "CCSDevelopmentPipelinesProjects_READ", + "CCSSupplyChain_READ" + ], "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/repositories\"\n\nquerystring = {\"errorsCount\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories\"\n\nquerystring = {\"errorsCount\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'https://api.prismacloud.io/code/api/v1/repositories?errorsCount=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories?errorsCount=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" } ] }, @@ -274,16 +850,83 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/repositories\"\n\npayload = {\n \"data\": [\"string\"],\n \"id\": \"string\",\n \"type\": \"github\"\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories\"\n\npayload = {\n \"data\": [\"string\"],\n \"id\": \"string\",\n \"type\": \"github\"\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request POST \\\n --url https://api.prismacloud.io/code/api/v1/repositories \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"data\":[\"string\"],\"id\":\"string\",\"type\":\"github\"}'" + "source": "curl --request POST \\\n --url http://undefinedundefined/code/code/api/v1/repositories \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"data\":[\"string\"],\"id\":\"string\",\"type\":\"github\"}'" } ] } }, - "/code/api/v1/repositories/query": { + "/code/code/api/v1/repositories/branches": { + "get": { + "description": "Get a list with all the repositories branches for the requesting customer\nThe returned branches are branches that has at list one CICD runs\neach branches item includes: name, creationDate, CICD status", + "operationId": "getBranches", + "parameters": [ + { + "in": "query", + "name": "repoOwner", + "required": true, + "schema": { "type": "string" } + }, + { + "in": "query", + "name": "repoName", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "Example 1": { + "value": { + "branches": [ + { + "creationDate": "2021-07-13T14:22:53.964Z", + "defaultBranch": false, + "name": "some_branch" + }, + { + "creationDate": null, + "defaultBranch": true, + "name": "master" + } + ], + "source": "Gitlab" + } + } + }, + "schema": { "$ref": "#/components/schemas/BranchesResponse" } + } + }, + "description": "repository branches" + }, + "400": { + "description": "Could not get branches, check GET query params" + }, + "422": { "description": "Request arguments validation error" }, + "500": { "description": "Could not fetch Repositories for customer" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get the repository branches (that has CICD runs)", + "tags": ["Repositories"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/branches\"\n\nquerystring = {\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories/branches?repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/code/api/v1/repositories/query": { "post": { "description": "Get a mapping between repository ids provided to the corresponding repositories names", "operationId": "getQueryRepositories", @@ -342,83 +985,16 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/repositories/query\"\n\npayload = {\"repositoriesIds\": [\"string\"]}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" - }, - { - "lang": "Shell + Curl", - "source": "curl --request POST \\\n --url https://api.prismacloud.io/code/api/v1/repositories/query \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"repositoriesIds\":[\"string\"]}'" - } - ] - } - }, - "/code/api/v1/repositories/branches": { - "get": { - "description": "Get a list with all the repositories branches for the requesting customer\nThe returned branches are branches that has at list one CICD runs\neach branches item includes: name, creationDate, CICD status", - "operationId": "getBranches", - "parameters": [ - { - "in": "query", - "name": "repoOwner", - "required": true, - "schema": { "type": "string" } - }, - { - "in": "query", - "name": "repoName", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Example 1": { - "value": { - "branches": [ - { - "creationDate": "2021-07-13T14:22:53.964Z", - "defaultBranch": false, - "name": "some_branch" - }, - { - "creationDate": null, - "defaultBranch": true, - "name": "master" - } - ], - "source": "Gitlab" - } - } - }, - "schema": { "$ref": "#/components/schemas/BranchesResponse" } - } - }, - "description": "repository branches" - }, - "400": { - "description": "Could not get branches, check GET query params" - }, - "422": { "description": "Request arguments validation error" }, - "500": { "description": "Could not fetch Repositories for customer" } - }, - "security": [{ "CustomAuthorizer": [] }], - "summary": "Get the repository branches (that has CICD runs)", - "tags": ["Repositories"], - "x-codeSamples": [ - { - "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/repositories/branches\"\n\nquerystring = {\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/query\"\n\npayload = {\"repositoriesIds\": [\"string\"]}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'https://api.prismacloud.io/code/api/v1/repositories/branches?repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request POST \\\n --url http://undefinedundefined/code/code/api/v1/repositories/query \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"repositoriesIds\":[\"string\"]}'" } ] } }, - "/code/api/v1/repositories/search": { + "/code/code/api/v1/repositories/search": { "get": { "description": "Get a list with all the repositories of customer\nUse filter params to search among the various repositories", "operationId": "searchRepositories", @@ -512,16 +1088,16 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/repositories/search\"\n\nquerystring = {\"id\":\"SOME_STRING_VALUE\",\"selected\":\"SOME_BOOLEAN_VALUE\",\"source\":\"SOME_STRING_VALUE\",\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\",\"offset\":\"SOME_INTEGER_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/search\"\n\nquerystring = {\"id\":\"SOME_STRING_VALUE\",\"selected\":\"SOME_BOOLEAN_VALUE\",\"source\":\"SOME_STRING_VALUE\",\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\",\"offset\":\"SOME_INTEGER_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'https://api.prismacloud.io/code/api/v1/repositories/search?id=SOME_STRING_VALUE&selected=SOME_BOOLEAN_VALUE&source=SOME_STRING_VALUE&repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories/search?id=SOME_STRING_VALUE&selected=SOME_BOOLEAN_VALUE&source=SOME_STRING_VALUE&repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" } ] } } }, - "servers": [{ "url": "https://api.prismacloud.io" }], + "servers": null, "tags": [{ "name": "Repositories" }] } diff --git a/openapi-specs/code/Repository.json b/openapi-specs/code/Repository.json index 544b65f65..c796ccedb 100644 --- a/openapi-specs/code/Repository.json +++ b/openapi-specs/code/Repository.json @@ -12,7 +12,7 @@ "type": "apiKey", "x-amazon-apigateway-authorizer": { "authorizerResultTtlInSeconds": 0, - "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-authorizer-{UniqueTag}{Alias}/invocations", + "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-v2-authorizer-{UniqueTag}{Alias}/invocations", "identitySource": "method.request.header.authorization", "type": "request" }, @@ -52,7 +52,7 @@ }, "openapi": "3.0.0", "paths": { - "/code/api/v1/repositories/repository": { + "/code/code/api/v1/repositories/repository": { "get": { "description": "Retrieve a single repository.\nthe repository item includes: id, repoName, source, owner, isPublic, creationDate", "operationId": "getRepository", @@ -98,16 +98,16 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/repositories/repository\"\n\nquerystring = {\"repositoryId\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/repository\"\n\nquerystring = {\"repositoryId\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'https://api.prismacloud.io/code/api/v1/repositories/repository?repositoryId=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories/repository?repositoryId=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" } ] } } }, - "servers": [{ "url": "https://api.prismacloud.io" }], + "servers": null, "tags": [{ "name": "Repository" }] } diff --git a/openapi-specs/code/SBOM.json b/openapi-specs/code/SBOM.json new file mode 100644 index 000000000..eea914aae --- /dev/null +++ b/openapi-specs/code/SBOM.json @@ -0,0 +1,350 @@ +{ + "components": { + "examples": {}, + "headers": {}, + "parameters": {}, + "requestBodies": {}, + "responses": {}, + "securitySchemes": { + "CustomAuthorizer": { + "in": "header", + "name": "authorization", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "authorizerResultTtlInSeconds": 0, + "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-v2-authorizer-{UniqueTag}{Alias}/invocations", + "identitySource": "method.request.header.authorization", + "type": "request" + }, + "x-amazon-apigateway-authtype": "custom" + } + }, + "schemas": { + "BOMMaterials": { + "enum": ["oss", "iac", "images", "all"], + "type": "string" + }, + "BOMReportFormat": { "enum": ["csv", "cyclonedx"], "type": "string" }, + "CveRow": { + "additionalProperties": false, + "properties": { + "cvss": { "format": "double", "type": "number" }, + "cvssVectorString": { "type": "string" }, + "description": { "type": "string" }, + "fixedVersion": { "type": "string" }, + "id": { "type": "string" }, + "link": { "type": "string" }, + "publishedDate": { "format": "date-time", "type": "string" }, + "riskFactors": { "$ref": "#/components/schemas/ParsedRiskFactors" }, + "severity": { "type": "string" }, + "summary": { "type": "string" } + }, + "required": [ + "id", + "severity", + "link", + "description", + "publishedDate", + "cvss", + "cvssVectorString", + "riskFactors" + ], + "type": "object" + }, + "DependencyRow": { + "additionalProperties": false, + "properties": { + "cves": { + "items": { "$ref": "#/components/schemas/CveRow" }, + "type": "array" + }, + "id": { "type": "string" }, + "license": { "type": "string" }, + "maxSeverity": { "format": "double", "type": "number" }, + "name": { "type": "string" }, + "origin": { "type": "string" }, + "srcCount": { "format": "double", "type": "number" }, + "version": { "type": "string" } + }, + "required": [ + "id", + "name", + "version", + "origin", + "license", + "srcCount", + "maxSeverity", + "cves" + ], + "type": "object" + }, + "Filters": { + "additionalProperties": false, + "properties": { + "cve": { + "description": "CVE-ID", + "items": { "type": "string" }, + "type": "array" + }, + "license": { + "description": "License identifier", + "items": { "type": "string" }, + "type": "array" + }, + "name": { "description": "Package name", "type": "string" }, + "origin": { + "description": "Package language framwork/ecosystem", + "items": { "type": "string" }, + "type": "array" + }, + "repositoryId": { + "description": "VCS repository ID", + "items": { "type": "string" }, + "type": "array" + }, + "riskFactors": { + "$ref": "#/components/schemas/RiskFactorsFilters", + "description": "CVE risk factors" + }, + "severity": { + "description": "CVE severiry based on CVSS score", + "items": { "type": "string" }, + "type": "array" + }, + "sourceId": { "items": { "type": "string" }, "type": "array" }, + "workspaceIds": { + "description": "VCS workspace/integration ID", + "items": { "type": "string" }, + "type": "array" + } + }, + "type": "object" + }, + "GeneratedBOMReport": { + "additionalProperties": false, + "properties": { + "format": { "$ref": "#/components/schemas/BOMReportFormat" }, + "reportLink": { "type": "string" } + }, + "required": ["reportLink", "format"], + "type": "object" + }, + "GeneratedBOMReportResponse": { + "additionalProperties": false, + "properties": { + "bomResponse": { + "items": { "$ref": "#/components/schemas/GeneratedBOMReport" }, + "type": "array" + } + }, + "required": ["bomResponse"], + "type": "object" + }, + "ParsedRiskFactors": { + "additionalProperties": false, + "properties": { + "ContainerRunningAsRoot": { "type": "boolean" }, + "ExploitExists": { "type": "boolean" }, + "ExploitInTheWild": { "type": "boolean" }, + "ListeningPorts": { "type": "boolean" }, + "NoMandatorySecurityProfileApplied": { "type": "boolean" }, + "PackageInUse": { "type": "boolean" }, + "ReachableFromInternet": { "type": "boolean" }, + "RunningAsPrivilegedContainer": { "type": "boolean" }, + "attackComplexity": { "type": "string" }, + "attackVector": { "type": "string" }, + "doS": { "type": "boolean" }, + "exploitPOC": { "type": "boolean" }, + "recentVulnerability": { "type": "boolean" }, + "remoteExecution": { "type": "boolean" } + }, + "type": "object" + }, + "RiskFactorsFilters": { + "additionalProperties": false, + "properties": { + "attackComplexity": { + "items": { "type": "string" }, + "type": "array" + }, + "attackVector": { "items": { "type": "string" }, "type": "array" }, + "containerRunningAsRoot": { "type": "boolean" }, + "doS": { "type": "boolean" }, + "exploitExists": { "type": "boolean" }, + "exploitInTheWild": { "type": "boolean" }, + "exploitPOC": { "type": "boolean" }, + "hasFix": { "type": "boolean" }, + "listeningPorts": { "type": "boolean" }, + "noMandatorySecurityProfileApplied": { "type": "boolean" }, + "packageInUse": { "type": "boolean" }, + "reachableFromInternet": { "type": "boolean" }, + "recentVulnerability": { "type": "boolean" }, + "remoteExecution": { "type": "boolean" }, + "runningAsPrivilegedContainer": { "type": "boolean" } + }, + "type": "object" + }, + "SortingOptions": { + "enum": [ + "name", + "version", + "license", + "srcCount", + "cves", + "maxSeverity" + ], + "type": "string" + } + } + }, + "info": { + "contact": {}, + "description": "The SBOM endpoints are listed below.\n", + "title": "Prisma Cloud SBOM API Overview", + "version": "Latest" + }, + "openapi": "3.0.0", + "paths": { + "/code/api/v1/bom/getBOMReport/{repoId}": { + "get": { + "description": "Get a BOM Report", + "operationId": "getBOMReport", + "parameters": [ + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { "type": "string" } + }, + { + "in": "query", + "name": "format", + "required": true, + "schema": { "enum": ["csv", "cyclonedx"], "type": "string" } + }, + { + "in": "query", + "name": "material", + "required": true, + "schema": { + "enum": ["oss", "iac", "images", "all"], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "Example 1": { + "value": { + "bomResponse": [ + { + "format": "csv", + "reportLink": "Presigned BOM Report Link" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/GeneratedBOMReportResponse" + } + } + }, + "description": "Get BOM Report" + }, + "401": { "description": "Unauthorized to get the BOM report" }, + "422": { "description": "Request arguments validation error" }, + "500": { "description": "Failed to get BOM Report" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get BOM Report", + "tags": ["SBOM"], + "x-bc-required-permissions": [ + "CCSDevelopmentPipelinesCodeReviews_READ", + "CCSDevelopmentPipelinesProjects_READ", + "CCSSupplyChain_READ" + ], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/bom/getBOMReport/{repoId}\"\n\nquerystring = {\"format\":\"SOME_STRING_VALUE\",\"material\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/api/v1/bom/getBOMReport/{repoId}?format=SOME_STRING_VALUE&material=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/api/v1/sbom/dependencies": { + "post": { + "description": "Get all open-source packages found in your organization's version control system (VCS).", + "operationId": "sbomDependencies", + "parameters": [ + { + "description": "Page number to retrieve", + "in": "query", + "name": "page", + "required": true, + "schema": { "format": "double", "type": "number" } + }, + { + "description": "Amount of dependencies to retrieve", + "in": "query", + "name": "limit", + "required": true, + "schema": { "format": "double", "type": "number" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "filters": { "$ref": "#/components/schemas/Filters" }, + "sortBy": { "$ref": "#/components/schemas/SortingOptions" }, + "sortDesc": { "type": "boolean" } + }, + "required": ["filters"], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { "$ref": "#/components/schemas/DependencyRow" }, + "type": "array" + } + } + }, + "description": "Got dependencies list" + }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get dependencies", + "tags": ["SBOM"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/sbom/dependencies\"\n\nquerystring = {\"page\":\"SOME_NUMBER_VALUE\",\"limit\":\"SOME_NUMBER_VALUE\"}\n\npayload = {\n \"filters\": {\n \"cve\": [\"string\"],\n \"license\": [\"string\"],\n \"name\": \"string\",\n \"origin\": [\"string\"],\n \"repositoryId\": [\"string\"],\n \"riskFactors\": {\n \"attackComplexity\": [\"string\"],\n \"attackVector\": [\"string\"],\n \"containerRunningAsRoot\": True,\n \"doS\": True,\n \"exploitExists\": True,\n \"exploitInTheWild\": True,\n \"exploitPOC\": True,\n \"hasFix\": True,\n \"listeningPorts\": True,\n \"noMandatorySecurityProfileApplied\": True,\n \"packageInUse\": True,\n \"reachableFromInternet\": True,\n \"recentVulnerability\": True,\n \"remoteExecution\": True,\n \"runningAsPrivilegedContainer\": True\n },\n \"severity\": [\"string\"],\n \"sourceId\": [\"string\"],\n \"workspaceIds\": [\"string\"]\n },\n \"sortBy\": \"name\",\n \"sortDesc\": True\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request POST \\\n --url 'http://undefinedundefined/code/api/v1/sbom/dependencies?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"filters\":{\"cve\":[\"string\"],\"license\":[\"string\"],\"name\":\"string\",\"origin\":[\"string\"],\"repositoryId\":[\"string\"],\"riskFactors\":{\"attackComplexity\":[\"string\"],\"attackVector\":[\"string\"],\"containerRunningAsRoot\":true,\"doS\":true,\"exploitExists\":true,\"exploitInTheWild\":true,\"exploitPOC\":true,\"hasFix\":true,\"listeningPorts\":true,\"noMandatorySecurityProfileApplied\":true,\"packageInUse\":true,\"reachableFromInternet\":true,\"recentVulnerability\":true,\"remoteExecution\":true,\"runningAsPrivilegedContainer\":true},\"severity\":[\"string\"],\"sourceId\":[\"string\"],\"workspaceIds\":[\"string\"]},\"sortBy\":\"name\",\"sortDesc\":true}'" + } + ] + } + } + }, + "servers": null, + "tags": [{ "name": "SBOM" }] +} From e98cecaa88f2fd90b4bfa33ea42de84e13cdd430 Mon Sep 17 00:00:00 2001 From: manukumar6 Date: Thu, 6 Jun 2024 19:29:25 +0530 Subject: [PATCH 2/4] add Technologies.json and edit endpoint names --- openapi-specs/code/BOMReport.json | 130 ----- openapi-specs/code/CheckovVersion.json | 2 +- openapi-specs/code/CodeFixes.json | 2 +- openapi-specs/code/DevelopmentPipeline.json | 4 +- openapi-specs/code/Packages.json | 10 +- openapi-specs/code/PackagesAlerts.json | 6 +- openapi-specs/code/Policies.json | 10 +- openapi-specs/code/Remediations.json | 6 +- openapi-specs/code/Repositories.json | 10 +- openapi-specs/code/Repository.json | 2 +- openapi-specs/code/Rules.json | 10 +- openapi-specs/code/SBOM.json | 2 +- openapi-specs/code/SupplyChain.json | 2 +- openapi-specs/code/Suppressions.json | 10 +- openapi-specs/code/Technologies.json | 611 ++++++++++++++++++++ 15 files changed, 649 insertions(+), 168 deletions(-) delete mode 100644 openapi-specs/code/BOMReport.json create mode 100644 openapi-specs/code/Technologies.json diff --git a/openapi-specs/code/BOMReport.json b/openapi-specs/code/BOMReport.json deleted file mode 100644 index 4d5744891..000000000 --- a/openapi-specs/code/BOMReport.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "components": { - "examples": {}, - "headers": {}, - "parameters": {}, - "requestBodies": {}, - "responses": {}, - "securitySchemes": { - "CustomAuthorizer": { - "in": "header", - "name": "authorization", - "type": "apiKey", - "x-amazon-apigateway-authorizer": { - "authorizerResultTtlInSeconds": 0, - "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-authorizer-{UniqueTag}{Alias}/invocations", - "identitySource": "method.request.header.authorization", - "type": "request" - }, - "x-amazon-apigateway-authtype": "custom" - } - }, - "schemas": { - "BOMMaterials": { - "enum": ["oss", "iac", "images", "all"], - "type": "string" - }, - "BOMReportFormat": { "enum": ["csv", "cyclonedx"], "type": "string" }, - "GeneratedBOMReport": { - "additionalProperties": false, - "properties": { - "format": { "$ref": "#/components/schemas/BOMReportFormat" }, - "reportLink": { "type": "string" } - }, - "required": ["reportLink", "format"], - "type": "object" - }, - "GeneratedBOMReportResponse": { - "additionalProperties": false, - "properties": { - "bomResponse": { - "items": { "$ref": "#/components/schemas/GeneratedBOMReport" }, - "type": "array" - } - }, - "required": ["bomResponse"], - "type": "object" - } - } - }, - "info": { - "contact": {}, - "description": "The BOMReport endpoints are listed below.\n", - "title": "Prisma Cloud BOMReport API Overview", - "version": "Latest" - }, - "openapi": "3.0.0", - "paths": { - "/code/api/v1/bom/getBOMReport/{repoId}": { - "get": { - "description": "Get a BOM Report", - "operationId": "getBOMReport", - "parameters": [ - { - "in": "path", - "name": "repoId", - "required": true, - "schema": { "type": "string" } - }, - { - "in": "query", - "name": "format", - "required": true, - "schema": { "enum": ["csv", "cyclonedx"], "type": "string" } - }, - { - "in": "query", - "name": "material", - "required": true, - "schema": { - "enum": ["oss", "iac", "images", "all"], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Example 1": { - "value": { - "bomResponse": [ - { - "format": "csv", - "reportLink": "Presigned BOM Report Link" - } - ] - } - } - }, - "schema": { - "$ref": "#/components/schemas/GeneratedBOMReportResponse" - } - } - }, - "description": "Get BOM Report" - }, - "401": { "description": "Unauthorized to get the BOM report" }, - "422": { "description": "Request arguments validation error" }, - "500": { "description": "Failed to get BOM Report" } - }, - "security": [{ "CustomAuthorizer": [] }], - "summary": "Get BOM Report", - "tags": ["BOMReport"], - "x-codeSamples": [ - { - "lang": "Python + Requests", - "source": "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/bom/getBOMReport/{repoId}\"\n\nquerystring = {\"format\":\"SOME_STRING_VALUE\",\"material\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" - }, - { - "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'https://api.prismacloud.io/code/api/v1/bom/getBOMReport/{repoId}?format=SOME_STRING_VALUE&material=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" - } - ] - } - } - }, - "servers": [{ "url": "https://api.prismacloud.io" }], - "tags": [{ "name": "BOMReport" }] -} diff --git a/openapi-specs/code/CheckovVersion.json b/openapi-specs/code/CheckovVersion.json index 5d9d40fb3..4765581b3 100644 --- a/openapi-specs/code/CheckovVersion.json +++ b/openapi-specs/code/CheckovVersion.json @@ -57,7 +57,7 @@ } }, "security": [], - "summary": "Get the current checkov version being run by Prisma Cloud Application Security", + "summary": "Get Current Checkov Version", "tags": ["CheckovVersion"], "x-codeSamples": [ { diff --git a/openapi-specs/code/CodeFixes.json b/openapi-specs/code/CodeFixes.json index 574aff475..f20ab502b 100644 --- a/openapi-specs/code/CodeFixes.json +++ b/openapi-specs/code/CodeFixes.json @@ -151,7 +151,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Fix infrastructure as code configuration errors", + "summary": "Fix Infrastructure as Code Configuration Errors", "tags": ["CodeFixes"], "x-codeSamples": [ { diff --git a/openapi-specs/code/DevelopmentPipeline.json b/openapi-specs/code/DevelopmentPipeline.json index c1b7eaa6b..e325b5fdd 100644 --- a/openapi-specs/code/DevelopmentPipeline.json +++ b/openapi-specs/code/DevelopmentPipeline.json @@ -330,7 +330,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get Code review runs data", + "summary": "Get Code Review Runs Data", "tags": ["Development Pipeline"], "x-codeSamples": [ { @@ -438,7 +438,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get integrated VCS repositories metadata", + "summary": "Get Integrated VCS Repositories Metadata", "tags": ["Development Pipeline"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Packages.json b/openapi-specs/code/Packages.json index cf5b3ca36..9653dd5af 100644 --- a/openapi-specs/code/Packages.json +++ b/openapi-specs/code/Packages.json @@ -284,7 +284,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get the packages related to a file", + "summary": "Get Packages Related to a File", "tags": ["Packages"], "x-codeSamples": [ { @@ -363,7 +363,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get the direct sub-dependencies packages by source package.", + "summary": "Get Direct Sub-dependency Packages by Source Package", "tags": ["Packages"], "x-codeSamples": [ { @@ -420,7 +420,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get a package.", + "summary": "Get Package", "tags": ["Packages"], "x-codeSamples": [ { @@ -485,7 +485,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Searching for packages.", + "summary": "Search Packages", "tags": ["Packages"], "x-codeSamples": [ { @@ -580,7 +580,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get cves by package uuid.", + "summary": "Get CVEs by Package UUID", "tags": ["Packages"], "x-codeSamples": [ { diff --git a/openapi-specs/code/PackagesAlerts.json b/openapi-specs/code/PackagesAlerts.json index 1b04f287b..8c56af1a7 100644 --- a/openapi-specs/code/PackagesAlerts.json +++ b/openapi-specs/code/PackagesAlerts.json @@ -624,7 +624,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Alert items list for licenses", + "summary": "Alert Items List for Licenses", "tags": ["PackagesAlerts"], "x-codeSamples": [ { @@ -699,7 +699,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Alert items list for packages", + "summary": "Alert Items List for Packages", "tags": ["PackagesAlerts"], "x-codeSamples": [ { @@ -772,7 +772,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Alert items list for policies", + "summary": "Alert Items List for Policies", "tags": ["PackagesAlerts"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Policies.json b/openapi-specs/code/Policies.json index 4b94fa1a0..8e25aa909 100644 --- a/openapi-specs/code/Policies.json +++ b/openapi-specs/code/Policies.json @@ -3629,7 +3629,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Validate policies - code-based", + "summary": "Validate Policies - Code-based", "tags": ["Policies"], "x-codeSamples": [ { @@ -3694,7 +3694,7 @@ "500": { "description": "Failed to create new policy" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Save new policy", + "summary": "Save New Policy", "tags": ["Policies"], "x-amazon-apigateway-integration": { "httpMethod": "POST", @@ -3890,7 +3890,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get custom policies table data", + "summary": "Get Custom Policies Table Data", "tags": ["Policies"], "x-codeSamples": [ { @@ -3962,7 +3962,7 @@ "500": { "description": "Could not update policy" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Update policy", + "summary": "Update Policy", "tags": ["Policies"], "x-amazon-apigateway-integration": { "httpMethod": "POST", @@ -4034,7 +4034,7 @@ "500": { "description": "Could not remove policy" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Delete policy", + "summary": "Delete Policy", "tags": ["Policies"], "x-amazon-apigateway-integration": { "httpMethod": "POST", diff --git a/openapi-specs/code/Remediations.json b/openapi-specs/code/Remediations.json index b6f1e9e5c..ec4b3e371 100644 --- a/openapi-specs/code/Remediations.json +++ b/openapi-specs/code/Remediations.json @@ -128,7 +128,7 @@ "500": { "description": "Failed to commit and push to pull request" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Remediation for build time", + "summary": "Remediation for Build time", "tags": ["Remediations"], "x-codeSamples": [ { @@ -172,7 +172,7 @@ "500": { "description": "Failed to get remediation fix" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get Remediation fix code", + "summary": "Get Remediation Fix Code", "tags": ["Remediations"], "x-codeSamples": [ { @@ -215,7 +215,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get file for remediation", + "summary": "Get File for Remediation", "tags": ["Remediations"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Repositories.json b/openapi-specs/code/Repositories.json index 620144935..3e366987f 100644 --- a/openapi-specs/code/Repositories.json +++ b/openapi-specs/code/Repositories.json @@ -800,7 +800,7 @@ "500": { "description": "Could not fetch Repositories for customer" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "List repository list", + "summary": "List Repository List", "tags": ["Repositories"], "x-bc-required-permissions": [ "CCSProjects_READ", @@ -845,7 +845,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Integrate multiple repositories", + "summary": "Integrate Multiple Repositories", "tags": ["Repositories"], "x-codeSamples": [ { @@ -912,7 +912,7 @@ "500": { "description": "Could not fetch Repositories for customer" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get the repository branches (that has CICD runs)", + "summary": "Get Repository Branches that have CICD Runs", "tags": ["Repositories"], "x-codeSamples": [ { @@ -980,7 +980,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get a repository name to UUID mapping of the requested UUIDs", + "summary": "Get Repository Name to UUID Mapping of Requested UUIDs", "tags": ["Repositories"], "x-codeSamples": [ { @@ -1083,7 +1083,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "search repositories", + "summary": "Search Repositories", "tags": ["Repositories"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Repository.json b/openapi-specs/code/Repository.json index c796ccedb..a4a498bcf 100644 --- a/openapi-specs/code/Repository.json +++ b/openapi-specs/code/Repository.json @@ -93,7 +93,7 @@ "500": { "description": "Could not fetch repository for customer" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "single repository list", + "summary": "Single Repository List", "tags": ["Repository"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Rules.json b/openapi-specs/code/Rules.json index b07091ef3..e7ff73506 100644 --- a/openapi-specs/code/Rules.json +++ b/openapi-specs/code/Rules.json @@ -175,7 +175,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get scheme for a specific account", + "summary": "Get Scheme for Specific Account", "tags": ["Rules"], "x-codeSamples": [ { @@ -207,7 +207,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get all enforcement rules", + "summary": "Get All Enforcement Rules", "tags": ["Rules"], "x-codeSamples": [ { @@ -242,7 +242,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Create a new exception for Enforcement rule", + "summary": "Create New Exception for Enforcement Rule", "tags": ["Rules"], "x-codeSamples": [ { @@ -277,7 +277,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Update Enforcement rule", + "summary": "Update Enforcement Rule", "tags": ["Rules"], "x-codeSamples": [ { @@ -366,7 +366,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get all repositories", + "summary": "Get All Repositories", "tags": ["Rules"], "x-codeSamples": [ { diff --git a/openapi-specs/code/SBOM.json b/openapi-specs/code/SBOM.json index eea914aae..632e2237a 100644 --- a/openapi-specs/code/SBOM.json +++ b/openapi-specs/code/SBOM.json @@ -330,7 +330,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get dependencies", + "summary": "Get Dependencies", "tags": ["SBOM"], "x-codeSamples": [ { diff --git a/openapi-specs/code/SupplyChain.json b/openapi-specs/code/SupplyChain.json index fdc7ddb65..9a0562294 100644 --- a/openapi-specs/code/SupplyChain.json +++ b/openapi-specs/code/SupplyChain.json @@ -498,7 +498,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get nodes", + "summary": "Get Nodes", "tags": ["Supply Chain"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Suppressions.json b/openapi-specs/code/Suppressions.json index 320e72027..04b918032 100644 --- a/openapi-specs/code/Suppressions.json +++ b/openapi-specs/code/Suppressions.json @@ -436,7 +436,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "List suppression rules", + "summary": "List Suppression Rules", "tags": ["Suppressions"], "x-codeSamples": [ { @@ -519,7 +519,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Create new suppression by policy id", + "summary": "Create New Suppression by Policy ID", "tags": ["Suppressions"], "x-codeSamples": [ { @@ -615,7 +615,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Update suppression by policy id and suppression id", + "summary": "Update Suppression by Policy ID and Suppression ID", "tags": ["Suppressions"], "x-codeSamples": [ { @@ -650,7 +650,7 @@ "422": { "description": "Request arguments validation error" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Delete one suppression by suppression id and violation id", + "summary": "Delete Suppression by Suppression ID and Violation ID", "tags": ["Suppressions"], "x-codeSamples": [ { @@ -742,7 +742,7 @@ "500": { "description": "Failed to get suppression" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get suppressions justifications by policy id and query accounts", + "summary": "Get Suppressions Justifications by Policy ID and Query Accounts", "tags": ["Suppressions"], "x-codeSamples": [ { diff --git a/openapi-specs/code/Technologies.json b/openapi-specs/code/Technologies.json new file mode 100644 index 000000000..1f8332394 --- /dev/null +++ b/openapi-specs/code/Technologies.json @@ -0,0 +1,611 @@ +{ + "components": { + "examples": {}, + "headers": {}, + "parameters": {}, + "requestBodies": {}, + "responses": {}, + "securitySchemes": { + "CustomAuthorizer": { + "in": "header", + "name": "authorization", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "authorizerResultTtlInSeconds": 0, + "authorizerUri": "arn:aws:apigateway:{Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:{Region}:{AccountId}:function:bc-authorization-v2-authorizer-{UniqueTag}{Alias}/invocations", + "identitySource": "method.request.header.authorization", + "type": "request" + }, + "x-amazon-apigateway-authtype": "custom" + } + }, + "schemas": { + "CatalogCategory": { + "enum": ["VCS", "CI/CD", "Registries", "Production"], + "type": "string" + }, + "CatalogGroup": { "enum": ["Code", "Build", "Deploy"], "type": "string" }, + "CatalogName": { + "enum": [ + "Github", + "Gitlab", + "Bitbucket", + "Azure Repos", + "CodeCommit", + "Jenkins", + "TeamCity", + "Travis CI", + "GitHub Actions", + "GitLab CI/CD", + "Bitbucket Pipelines", + "CodeFresh", + "CircleCI", + "Argo CD", + "Concourse CI", + "BuildKite", + "AWS CodeBuild", + "AWS CodeDeploy", + "AWS CodePipeline", + "Drone", + "JFrog Artifactory", + "AWS ECR", + "Nexus", + "Docker Hub", + "GitHub Registry", + "AWS EC2", + "AWS EKS", + "AWS ECS", + "AWS Lambda", + "AWS App Mesh", + "AWS API Gateway", + "AWS Elastic Load Balancing", + "Azure Virtual Machines", + "Azure Functions", + "Azure AKS", + "Azure Container Instances", + "Azure Service Fabric", + "Google Kubernetes Engine", + "Google Compute Engine", + "Google Container Registry", + "Chromatic", + "env0", + "FireFly", + "Testim", + "Unity", + "JfrogXray", + "Buddy.Works", + "Snowflake", + "databricks", + "Heroku", + "Netlify", + "PagerDuty", + "Ngrok", + "Google Play", + "FireBase", + "npm", + "Grafana", + "AWS DynamoDB", + "Google Cloud Functions", + "Google Cloud Build", + "Azure Pipelines", + "AWS CodeArtifact", + "AWS STS", + "AWS SQS", + "AWS SNS", + "AWS S3", + "HashiCorp Consul", + "Datadog", + "SENTRY", + "Bamboo", + "Terraform Cloud", + "Nx Cloud", + "DeployHQ", + "Cloudflare", + "Allure TestOps", + "Bitrise", + "Skaffold", + "Google Cloud Run", + "Codecov", + "Checkov", + "Cypress", + "Snyk", + "Helm", + "Salesforce", + "Nginx", + "Bandit", + "Velocity", + "CoveragePy", + "HashiCorpVault", + "Zapier", + "Ansible", + "Yor", + "Semgrep", + "TrivyAction", + "Slack", + "GitLeaks", + "Azure Artifacts Feed", + "Adobe Cloud Manager", + "Adobe Cloud Package Manager" + ], + "type": "string" + }, + "DataStatus": { "enum": ["ok", "empty"], "type": "string" }, + "EvidanceData": { + "additionalProperties": {}, + "properties": { + "firstSeen": { "format": "double", "type": "number" }, + "id": { "type": "string" }, + "lastSeen": { "format": "double", "type": "number" }, + "lastUpdated": { "format": "double", "type": "number" } + }, + "required": ["id", "firstSeen", "lastUpdated", "lastSeen"], + "type": "object" + }, + "Executable": { + "additionalProperties": false, + "properties": { + "insight": { "$ref": "#/components/schemas/Insight" }, + "name": { "type": "string" } + }, + "required": ["name", "insight"], + "type": "object" + }, + "GetResponse": { + "additionalProperties": false, + "properties": { + "data": { "$ref": "#/components/schemas/IScan" }, + "status": { "$ref": "#/components/schemas/DataStatus" } + }, + "required": ["status", "data"], + "type": "object" + }, + "IResolvedCatalog": { + "additionalProperties": false, + "properties": { + "category": { "$ref": "#/components/schemas/CatalogCategory" }, + "description": { "type": "string" }, + "firstSeen": { "format": "double", "type": "number" }, + "group": { "$ref": "#/components/schemas/CatalogGroup" }, + "lastSeen": { "format": "double", "type": "number" }, + "lastUpdated": { "format": "double", "type": "number" }, + "name": { "$ref": "#/components/schemas/CatalogName" }, + "sources": { + "items": { "$ref": "#/components/schemas/IResolvedSource" }, + "type": "array" + } + }, + "required": [ + "name", + "description", + "group", + "category", + "firstSeen", + "lastSeen", + "lastUpdated", + "sources" + ], + "type": "object" + }, + "IResolvedSource": { + "additionalProperties": false, + "properties": { + "evidanceData": { + "items": { "$ref": "#/components/schemas/EvidanceData" }, + "type": "array" + }, + "firstSeen": { "format": "double", "type": "number" }, + "lastSeen": { "format": "double", "type": "number" }, + "lastUpdated": { "format": "double", "type": "number" }, + "name": { "$ref": "#/components/schemas/SourceName" } + }, + "required": [ + "name", + "firstSeen", + "lastSeen", + "lastUpdated", + "evidanceData" + ], + "type": "object" + }, + "IScan": { + "properties": { + "id": { "type": "string" }, + "lastCleared": { "format": "double", "type": "number" }, + "lastScan": { "format": "double", "type": "number" }, + "lastUpdated": { "format": "double", "type": "number" }, + "results": { + "items": { "$ref": "#/components/schemas/IResolvedCatalog" }, + "type": "array" + } + }, + "required": ["results", "lastUpdated", "lastScan", "id"], + "type": "object" + }, + "IVCSInstalledApp": { + "additionalProperties": false, + "properties": { + "adminPermissions": { + "description": "VCS App installed with repository or organization level admin permissions", + "items": { "type": "string" }, + "type": "array" + }, + "customerName": { + "description": "Customer Prisma ID", + "type": "string" + }, + "events": { + "description": "VCS webhook events the App listens on", + "items": { "type": "string" }, + "type": "array" + }, + "htmlUrl": { + "description": "VCS App settings URL", + "type": "string" + }, + "id": { "description": "VCS App ID", "type": "string" }, + "name": { "description": "VCS App name", "type": "string" }, + "nodeCreatedTimestamp": { "format": "double", "type": "number" }, + "readPermissions": { + "description": "VCS App read permissions", + "items": { "type": "string" }, + "type": "array" + }, + "repositorySelection": { + "description": "repositorySelection:\n - `all`: VCS App installed on organization level\n - `selected`: VCS App installed on selected repositories", + "type": "string" + }, + "timestamp": { "format": "double", "type": "number" }, + "type": { + "enum": ["VCSInstalledApp"], + "nullable": false, + "type": "string" + }, + "vendorCreatedTimestamp": { + "description": "Webhook creation date", + "format": "double", + "type": "number" + }, + "writePermissions": { + "description": "VCS App write permissions", + "items": { "type": "string" }, + "type": "array" + } + }, + "required": [ + "id", + "type", + "customerName", + "name", + "timestamp", + "events", + "readPermissions", + "writePermissions", + "adminPermissions", + "repositorySelection", + "htmlUrl" + ], + "type": "object" + }, + "IVCSWebhook": { + "additionalProperties": false, + "properties": { + "createdAt": { + "description": "Webhook creation date", + "format": "double", + "type": "number" + }, + "customerName": { + "description": "Customer Prisma ID", + "type": "string" + }, + "domain": { "description": "Webhook URL domain", "type": "string" }, + "id": { "description": "VCS App ID", "type": "string" }, + "isSSLVerificationEnabled": { + "description": "Webhook SSL verification enabled/disabled", + "type": "boolean" + }, + "name": { "description": "VCS App name", "type": "string" }, + "nodeCreatedTimestamp": { "format": "double", "type": "number" }, + "timestamp": { "format": "double", "type": "number" }, + "triggers": { + "description": "Webhook events triggers", + "items": { "type": "string" }, + "type": "array" + }, + "type": { + "enum": ["VCSWebhook"], + "nullable": false, + "type": "string" + }, + "url": { "description": "Webhook URL", "type": "string" }, + "vendorCreatedTimestamp": { + "description": "Webhook creation date", + "format": "double", + "type": "number" + }, + "webhookType": { "description": "Webhook type", "type": "string" }, + "workspaceId": { + "description": "VCS workspace/integration ID", + "type": "string" + } + }, + "required": [ + "id", + "type", + "customerName", + "name", + "timestamp", + "url", + "domain", + "webhookType", + "triggers" + ], + "type": "object" + }, + "Insight": { + "additionalProperties": false, + "properties": { + "isVerified": { "type": "boolean" }, + "labels": { + "items": { "$ref": "#/components/schemas/Labels" }, + "type": "array" + }, + "owner": { "type": "string" }, + "stars": { "format": "double", "type": "number" }, + "usage": { "format": "double", "type": "number" } + }, + "required": ["labels", "stars", "usage", "owner"], + "type": "object" + }, + "Labels": { + "additionalProperties": false, + "properties": { + "id": { "format": "double", "type": "number" }, + "name": { "type": "string" }, + "tooltip": { "type": "string" } + }, + "required": ["id", "name", "tooltip"], + "type": "object" + }, + "ParsedInventory": { + "additionalProperties": false, + "properties": { + "appName": { "description": "Pipeline tool name", "type": "string" }, + "description": { + "description": "Pipeline tool description", + "type": "string" + }, + "executables": { + "description": "Pipeline tool executables", + "items": { "$ref": "#/components/schemas/Executable" }, + "type": "array" + }, + "link": { "description": "Pipeline tool link", "type": "string" }, + "logo": { "type": "string" }, + "sources": { + "description": "Pipeline tool sources", + "items": { + "properties": { + "arguments": { + "anyOf": [ + { "items": { "type": "string" }, "type": "array" }, + { + "items": { + "properties": { + "command": { "type": "string" }, + "name": { "type": "string" } + }, + "required": ["command", "name"], + "type": "object" + }, + "type": "array" + } + ], + "description": "Pipeline tool arguments" + }, + "casId": { "type": "string" }, + "filePath": { + "description": "Pipeline tool CI file path", + "type": "string" + }, + "lineNumber": { + "description": "Pipeline tool line number in CI file", + "format": "double", + "type": "number" + }, + "name": { + "description": "Pipeline tool name", + "type": "string" + }, + "repoId": { + "description": "VCS repository ID", + "type": "string" + }, + "workspaceId": { + "description": "VCS workspace/integration ID", + "type": "string" + } + }, + "required": [ + "lineNumber", + "filePath", + "workspaceId", + "casId", + "repoId", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "vendor": { "type": "string" } + }, + "required": [ + "appName", + "vendor", + "description", + "link", + "logo", + "sources" + ], + "type": "object" + }, + "SourceName": { + "enum": [ + "VCS Webhooks", + "VCS App", + "VCS DeployKey", + "CI Credentials", + "CI Plugins", + "CI Files", + "VCS Credentials", + "Pipeline Configurations", + "Pipeline Tools", + "Integrations" + ], + "type": "string" + } + } + }, + "info": { + "contact": {}, + "description": "The Technologies endpoints are listed below.\n", + "title": "Prisma Cloud Technologies API Overview", + "version": "Latest" + }, + "openapi": "3.0.0", + "paths": { + "/code/api/v1/apps-webhooks/apps": { + "get": { + "description": "Get all installed apps that exist in the db, the installed apps should at least connected to one workspace.", + "operationId": "getApps", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { "$ref": "#/components/schemas/IVCSInstalledApp" }, + "type": "array" + } + } + }, + "description": "apps" + } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get VCS 3rd Party Apps", + "tags": ["Technologies"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/apps-webhooks/apps\"\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url http://undefinedundefined/code/api/v1/apps-webhooks/apps \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/api/v1/apps-webhooks/webhooks": { + "get": { + "description": "Get an inventory of third-party webhooks found in your organization’s version control system (VCS).", + "operationId": "getWebhooks", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { "$ref": "#/components/schemas/IVCSWebhook" }, + "type": "array" + } + } + }, + "description": "webhooks" + } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get VCS 3rd Party Webhooks", + "tags": ["Technologies"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/apps-webhooks/webhooks\"\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url http://undefinedundefined/code/api/v1/apps-webhooks/webhooks \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/api/v1/assets-inventory": { + "get": { + "description": "List all technologies and their sources", + "operationId": "assetsInventoryGetAll", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/GetResponse" } + } + }, + "description": "Get assets inventory" + }, + "500": { "description": "failed to fetch assets inventory" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "List Technologies", + "tags": ["Technologies"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/assets-inventory\"\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url http://undefinedundefined/code/api/v1/assets-inventory \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/api/v1/ci-inventory": { + "get": { + "description": "Get an inventory of all third-party services and tools used by an organization’s CI/CD pipeline.", + "operationId": "getCiInventory", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { "$ref": "#/components/schemas/ParsedInventory" }, + "type": "array" + } + } + }, + "description": "pipeline tools" + } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get CI Inventory", + "tags": ["Technologies"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/ci-inventory\"\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request GET \\\n --url http://undefinedundefined/code/api/v1/ci-inventory \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + } + }, + "servers": null, + "tags": [{ "name": "Technologies" }] +} From 2896b0b79f0fa914228596d8212a55c7000f2ef9 Mon Sep 17 00:00:00 2001 From: manukumar6 Date: Thu, 6 Jun 2024 20:33:33 +0530 Subject: [PATCH 3/4] fixed missing endpoint --- openapi-specs/code/Repositories.json | 81 ++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/openapi-specs/code/Repositories.json b/openapi-specs/code/Repositories.json index 3e366987f..ae34f373d 100644 --- a/openapi-specs/code/Repositories.json +++ b/openapi-specs/code/Repositories.json @@ -739,7 +739,7 @@ }, "openapi": "3.0.0", "paths": { - "/code/code/api/v1/repositories": { + "/code/api/v1/repositories": { "get": { "description": "Retrieve a list of integrated repositories.\neach repository item includes: id, repoName, source, owner, isPublic, creationDate", "operationId": "getRepositories", @@ -811,11 +811,11 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories\"\n\nquerystring = {\"errorsCount\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/repositories\"\n\nquerystring = {\"errorsCount\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories?errorsCount=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/api/v1/repositories?errorsCount=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" } ] }, @@ -850,16 +850,16 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories\"\n\npayload = {\n \"data\": [\"string\"],\n \"id\": \"string\",\n \"type\": \"github\"\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/repositories\"\n\npayload = {\n \"data\": [\"string\"],\n \"id\": \"string\",\n \"type\": \"github\"\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request POST \\\n --url http://undefinedundefined/code/code/api/v1/repositories \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"data\":[\"string\"],\"id\":\"string\",\"type\":\"github\"}'" + "source": "curl --request POST \\\n --url http://undefinedundefined/code/api/v1/repositories \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"data\":[\"string\"],\"id\":\"string\",\"type\":\"github\"}'" } ] } }, - "/code/code/api/v1/repositories/branches": { + "/code/api/v1/repositories/branches": { "get": { "description": "Get a list with all the repositories branches for the requesting customer\nThe returned branches are branches that has at list one CICD runs\neach branches item includes: name, creationDate, CICD status", "operationId": "getBranches", @@ -912,21 +912,21 @@ "500": { "description": "Could not fetch Repositories for customer" } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get Repository Branches that have CICD Runs", + "summary": "Get Repository Branches with CICD Runs", "tags": ["Repositories"], "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/branches\"\n\nquerystring = {\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/repositories/branches\"\n\nquerystring = {\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories/branches?repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/api/v1/repositories/branches?repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" } ] } }, - "/code/code/api/v1/repositories/query": { + "/code/api/v1/repositories/query": { "post": { "description": "Get a mapping between repository ids provided to the corresponding repositories names", "operationId": "getQueryRepositories", @@ -985,16 +985,16 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/query\"\n\npayload = {\"repositoriesIds\": [\"string\"]}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/repositories/query\"\n\npayload = {\"repositoriesIds\": [\"string\"]}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request POST \\\n --url http://undefinedundefined/code/code/api/v1/repositories/query \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"repositoriesIds\":[\"string\"]}'" + "source": "curl --request POST \\\n --url http://undefinedundefined/code/api/v1/repositories/query \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"repositoriesIds\":[\"string\"]}'" } ] } }, - "/code/code/api/v1/repositories/search": { + "/code/api/v1/repositories/search": { "get": { "description": "Get a list with all the repositories of customer\nUse filter params to search among the various repositories", "operationId": "searchRepositories", @@ -1088,11 +1088,62 @@ "x-codeSamples": [ { "lang": "Python + Requests", - "source": "import requests\n\nurl = \"http://undefinedundefined/code/code/api/v1/repositories/search\"\n\nquerystring = {\"id\":\"SOME_STRING_VALUE\",\"selected\":\"SOME_BOOLEAN_VALUE\",\"source\":\"SOME_STRING_VALUE\",\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\",\"offset\":\"SOME_INTEGER_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/repositories/search\"\n\nquerystring = {\"id\":\"SOME_STRING_VALUE\",\"selected\":\"SOME_BOOLEAN_VALUE\",\"source\":\"SOME_STRING_VALUE\",\"repoOwner\":\"SOME_STRING_VALUE\",\"repoName\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\",\"offset\":\"SOME_INTEGER_VALUE\"}\n\nheaders = {\"authorization\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" }, { "lang": "Shell + Curl", - "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/code/api/v1/repositories/search?id=SOME_STRING_VALUE&selected=SOME_BOOLEAN_VALUE&source=SOME_STRING_VALUE&repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + "source": "curl --request GET \\\n --url 'http://undefinedundefined/code/api/v1/repositories/search?id=SOME_STRING_VALUE&selected=SOME_BOOLEAN_VALUE&source=SOME_STRING_VALUE&repoOwner=SOME_STRING_VALUE&repoName=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \\\n --header 'authorization: REPLACE_KEY_VALUE'" + } + ] + } + }, + "/code/api/v1/vcs-repository/repositories": { + "post": { + "description": "Get repositories page", + "operationId": "getVCSRepositoryPage", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RepoRequestBody" } + } + }, + "description": "the body includes filters page configuration.", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "items": { "$ref": "#/components/schemas/RepoInfo" }, + "type": "array" + }, + { + "items": { "$ref": "#/components/schemas/RdsRepoInfo" }, + "type": "array" + } + ] + } + } + }, + "description": "repositories" + }, + "422": { "description": "Request arguments validation error" } + }, + "security": [{ "CustomAuthorizer": [] }], + "summary": "Get Repositories Page", + "tags": ["Repositories"], + "x-codeSamples": [ + { + "lang": "Python + Requests", + "source": "import requests\n\nurl = \"http://undefinedundefined/code/api/v1/vcs-repository/repositories\"\n\npayload = {\n \"filters\": {\n \"archived\": [\"string\"],\n \"casIds\": [\"string\"],\n \"ciFiles\": [\"string\"],\n \"customerName\": \"string\",\n \"ids\": [\"string\"],\n \"images\": [\"string\"],\n \"issues\": [\"string\"],\n \"lastUpdated\": \"2019-08-24T14:15:22Z\",\n \"name\": \"string\",\n \"pipelines\": [\"string\"],\n \"privacyLevels\": [\"public\"],\n \"providers\": [\"string\"],\n \"riskFactors\": [\"isInternetExpose\"],\n \"technologies\": [\"string\"],\n \"workspaceIds\": [\"string\"]\n },\n \"orderBy\": {\n \"fieldName\": \"string\",\n \"isAsc\": True,\n \"type\": \"string\"\n },\n \"pageConfig\": {\n \"page\": 0,\n \"pageSize\": 0\n }\n}\nheaders = {\n \"content-type\": \"application/json\",\n \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "Shell + Curl", + "source": "curl --request POST \\\n --url http://undefinedundefined/code/api/v1/vcs-repository/repositories \\\n --header 'authorization: REPLACE_KEY_VALUE' \\\n --header 'content-type: application/json' \\\n --data '{\"filters\":{\"archived\":[\"string\"],\"casIds\":[\"string\"],\"ciFiles\":[\"string\"],\"customerName\":\"string\",\"ids\":[\"string\"],\"images\":[\"string\"],\"issues\":[\"string\"],\"lastUpdated\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"pipelines\":[\"string\"],\"privacyLevels\":[\"public\"],\"providers\":[\"string\"],\"riskFactors\":[\"isInternetExpose\"],\"technologies\":[\"string\"],\"workspaceIds\":[\"string\"]},\"orderBy\":{\"fieldName\":\"string\",\"isAsc\":true,\"type\":\"string\"},\"pageConfig\":{\"page\":0,\"pageSize\":0}}'" } ] } From a7cca887a134d5cca967b183d03ad9290df22601 Mon Sep 17 00:00:00 2001 From: manukumar6 Date: Thu, 6 Jun 2024 21:01:01 +0530 Subject: [PATCH 4/4] inputs from Guy --- openapi-specs/code/Technologies.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi-specs/code/Technologies.json b/openapi-specs/code/Technologies.json index 1f8332394..87767ed2e 100644 --- a/openapi-specs/code/Technologies.json +++ b/openapi-specs/code/Technologies.json @@ -477,7 +477,7 @@ "paths": { "/code/api/v1/apps-webhooks/apps": { "get": { - "description": "Get all installed apps that exist in the db, the installed apps should at least connected to one workspace.", + "description": "Get an inventory of third-party applications (apps) found in your organization's version control system (VCS).", "operationId": "getApps", "parameters": [], "responses": { @@ -591,7 +591,7 @@ } }, "security": [{ "CustomAuthorizer": [] }], - "summary": "Get CI Inventory", + "summary": "Get Pipeline Tools", "tags": ["Technologies"], "x-codeSamples": [ {