Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Create data model for Web Security Scanner #559

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/spec/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { IntegrationSpecConfig } from '@jupiterone/integration-sdk-core';
import { buildSteps } from './steps/services/build';
import { functionSteps } from './steps/services/functions';
import { webSecurityScannerSteps } from './steps/services/web-security-scanner';

export const invocationConfig: IntegrationSpecConfig = {
integrationSteps: [...buildSteps, ...functionSteps],
integrationSteps: [
...buildSteps,
...functionSteps,
...webSecurityScannerSteps,
],
};
81 changes: 81 additions & 0 deletions docs/spec/src/steps/services/web-security-scanner/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import {
IntegrationInstanceConfig,
RelationshipClass,
StepSpec,
} from '@jupiterone/integration-sdk-core';

export const webSecurityScannerSteps: StepSpec<IntegrationInstanceConfig>[] = [
{
/**
* ENDPOINT: https://cloud.google.com/security-command-center/docs/reference/web-security-scanner/rest/v1/projects.scanConfigs/list
* PATTERN: Fetch Entities
* REQUIRED PERMISSIONS: cloudsecurityscanner.scans.list
*/
id: 'fetch-scan-configs',
name: 'Fetch Scan Configs',
entities: [
{
resourceName: 'Scan Config',
_type: 'google_cloud_scan_config',
_class: ['Configuration'],
},
],
relationships: [],
dependsOn: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as familiar with the graph-google-cloud project, but just making sure, there's not service-level entity this would be dependent on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I am aware of, I am also not too familiar but from what I could find it didn't need any

implemented: false,
},
{
/**
* ENDPOINT: https://cloud.google.com/security-command-center/docs/reference/web-security-scanner/rest/v1/projects.scanConfigs.scanRuns/list
* https://cloud.google.com/security-command-center/docs/reference/web-security-scanner/rest/v1/projects.scanConfigs.scanRuns.crawledUrls/list
* PATTERN: Fetch Child Entities
* REQUIRED PERMISSIONS: cloudsecurityscanner.scanruns.list
* cloudsecurityscanner.crawledurls.list
*/
id: 'fetch-scan-runs',
name: 'Fetch Scan Runs',
entities: [
{
resourceName: 'Scan Run',
_type: 'google_cloud_scan_run',
_class: ['Finding'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a great class for this but not sure which one would be better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have a better alternative. If no one else has a complaint, it's probably fine.

},
],
relationships: [
{
_type: 'google_cloud_scan_config_performed_scan_run',
sourceType: 'google_cloud_scan_config',
_class: RelationshipClass.PERFORMED,
targetType: 'google_cloud_scan_run',
},
],
dependsOn: ['fetch-scan-configs'],
implemented: false,
},
{
/**
* ENDPOINT: https://cloud.google.com/security-command-center/docs/reference/web-security-scanner/rest/v1/projects.scanConfigs.scanRuns.findings/list
* PATTERN: Fetch Child Entities
* REQUIRED PERMISSIONS: cloudsecurityscanner.results.list
*/
id: 'fetch-scan-run-findings',
name: 'Fetch Scan Run Findings',
entities: [
{
resourceName: 'Scan Run Finding',
_type: 'google_cloud_scan_run_finding',
_class: ['Finding'],
},
],
relationships: [
{
_type: 'google_cloud_scan_run_has_finding',
sourceType: 'google_cloud_scan_run',
_class: RelationshipClass.HAS,
targetType: 'google_cloud_scan_run_finding',
},
],
dependsOn: ['fetch-scan-runs'],
implemented: false,
},
];