This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
generated from JupiterOne-Archives/integration-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Sonarqube filter params sdk 13.x #54
Merged
Merged
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7ed5a16
filter params added
Bharatkk-metron b171394
severity mapping modified
Bharatkk-metron 3bf10c5
updated version
Bharatkk-metron 8181942
updated version 14 to 18
Bharatkk-metron 3f6d11c
remove unwanted
Bharatkk-metron a88b6e6
convertes string to array
Bharatkk-metron aeda40d
updated to version 13
Bharatkk-metron f299417
re recorded har file
Bharatkk-metron 60d3ed3
recording updated
Bharatkk-metron 14cd308
vendor name changed
Bharatkk-metron 021914c
.env-example file updated
Bharatkk-metron 5132247
.env-example file updated
Bharatkk-metron 3f17bce
empty lines removed
Bharatkk-metron afcacfd
env.example file modified
Bharatkk-metron 0f04ed1
fix tsconfig
RonaldEAM 9c2d878
review changes
Bharatkk-metron 1444c1e
updated the variables name
Bharatkk-metron e02d0fb
removed console log
Bharatkk-metron 4601362
string corrected
Bharatkk-metron bcde8d8
review comments
Bharatkk-metron 6a03238
updated example file
Bharatkk-metron 12cbe7e
refactor files
RonaldEAM 69938aa
v2.1.0
RonaldEAM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
BASE_URL= | ||
API_TOKEN= | ||
ENABLE_FINDINGS_INGESTION= | ||
ENABLE_FINDINGS_INGESTION=true/false | ||
|
||
# INFO, MINOR -> LOW in API Version 2 | ||
# MAJOR -> MEDIUM in API Version 2 | ||
# CRITICAL BLOCKERS -> HIGH in API Version 2 | ||
# 0 or more values you can pass from given values | ||
SEVERITIES=INFO,MINOR,MAJOR,CRITICAL,BLOCKER | ||
|
||
# OPEN -> OPEN in API Version 2 | ||
# CONFIRMED -> CONFIRMED' in API Version 2 | ||
# REOPENED -> FALSE_POSITIVE' in API Version 2 | ||
# RESOLVED -> ACCEPTED' in API Version 2 | ||
# CLOSED -> FIXED in API Version 2 | ||
# 0 or more values you can pass from given values | ||
STATUS=OPEN,CONFIRMED,REOPENED,RESOLVED,CLOSED | ||
|
||
#createdInLast: optional | ||
#To retrieve issues created during a time span before the current time (exclusive). Accepted units are 'y' for year, 'm' for month, 'w' for week and 'd' for day. If this parameter is set, createdAfter must not be set | ||
# Example value: 1m2w (1 month 2 weeks) | ||
CREATED_IN_LAST=10d # default value is 10 days | ||
|
||
# CODE_SMELL -> MAINTAINABILITY in API Version 2 | ||
# BUG -> RELIABILITY in API Version 2 | ||
# VULNERABILITY: SECURITY in API Version 2 | ||
TYPES=CODE_SMELL,BUG,VULNERABILITY # 0 or more values you can pass from given values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:14-alpine | ||
FROM node:18-alpine | ||
|
||
ENV JUPITERONE_INTEGRATION_DIR=/opt/jupiterone/integration | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { IntegrationIngestionConfigFieldMap } from '@jupiterone/integration-sdk-core'; | ||
import { INGESTION_SOURCE_IDS } from './steps/constants'; | ||
|
||
export const ingestionConfig: IntegrationIngestionConfigFieldMap = { | ||
[INGESTION_SOURCE_IDS.ACCOUNT]: { | ||
title: 'Account', | ||
description: 'SonarQube Accounts', | ||
defaultsToDisabled: false, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ingestion source is not required, in general without account the rest of the steps wouldn't run, and we don't fetch anything so it's ok to always have it |
||
[INGESTION_SOURCE_IDS.FINDINGS]: { | ||
title: 'Users', | ||
description: 'SonarQube Issues', | ||
defaultsToDisabled: false, | ||
}, | ||
[INGESTION_SOURCE_IDS.USERS]: { | ||
title: 'Users', | ||
description: 'SonarQube Users', | ||
defaultsToDisabled: false, | ||
}, | ||
[INGESTION_SOURCE_IDS.PROJECT]: { | ||
title: 'Projects', | ||
description: 'SonarQube Projects', | ||
defaultsToDisabled: false, | ||
}, | ||
[INGESTION_SOURCE_IDS.USER_GROUPS]: { | ||
title: 'User Groups', | ||
description: 'SonarQube Groups', | ||
defaultsToDisabled: false, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,6 +13,26 @@ const instanceConfigFields: IntegrationInstanceConfigFieldMap = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mask: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
severities: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mask: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mask: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdInLast: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mask: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
types: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: 'string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mask: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export default instanceConfigFields; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,12 @@ import { | |
IntegrationStepExecutionContext, | ||
} from '@jupiterone/integration-sdk-core'; | ||
|
||
import { ACCOUNT_ENTITY_KEY, Entities, Steps } from '../constants'; | ||
import { | ||
ACCOUNT_ENTITY_KEY, | ||
Entities, | ||
INGESTION_SOURCE_IDS, | ||
Steps, | ||
} from '../constants'; | ||
import { createAccountEntity } from './converter'; | ||
import { SonarqubeIntegrationConfig } from '../../types'; | ||
|
||
|
@@ -19,6 +24,7 @@ export const accountSteps: IntegrationStep<SonarqubeIntegrationConfig>[] = [ | |
{ | ||
id: Steps.ACCOUNT, | ||
name: 'Fetch Account', | ||
ingestionSourceId: INGESTION_SOURCE_IDS.ACCOUNT, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this |
||
entities: [Entities.ACCOUNT], | ||
executionHandler: fetchAccount, | ||
relationships: [], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,46 @@ import { RelationshipClass } from '@jupiterone/integration-sdk-core'; | |
|
||
export const ACCOUNT_ENTITY_KEY = 'sonarqube:account'; | ||
|
||
export const FINDINGS_SEVERITIES = { | ||
INFO: 'LOW', | ||
MINOR: 'LOW', | ||
MAJOR: 'MEDIUM', | ||
CRITICAL: 'HIGH', | ||
BLOCKER: 'HIGH', | ||
}; | ||
|
||
export const V1_SEVERITIES_VALUES = [ | ||
'INFO', | ||
'MINOR', | ||
'MAJOR', | ||
'CRITICAL', | ||
'BLOCKER', | ||
]; | ||
export const V2_SEVERITIES_VALUES = ['LOW', 'MEDIUM', 'HIGH']; | ||
export const DEFAULT_CREATED_IN_LAST = '10d'; | ||
|
||
export const FINDING_STATUSES = { | ||
OPEN: 'OPEN', | ||
CONFIRMED: 'CONFIRMED', | ||
REOPENED: 'FALSE_POSITIVE', | ||
RESOLVED: 'ACCEPTED', | ||
CLOSED: 'FIXED', | ||
}; | ||
|
||
export const FINDING_TYPES = { | ||
CODE_SMELL: 'MAINTAINABILITY', | ||
BUG: 'RELIABILITY', | ||
VULNERABILITY: 'SECURITY', | ||
}; | ||
|
||
export const INGESTION_SOURCE_IDS = { | ||
ACCOUNT: 'accounts', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this one |
||
PROJECT: 'projects', | ||
USERS: 'users', | ||
USER_GROUPS: 'user-groups', | ||
FINDINGS: 'findings', | ||
}; | ||
|
||
export const Steps = { | ||
ACCOUNT: 'fetch-account', | ||
PROJECTS: 'fetch-projects', | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this name to
FINDINGS_INGEST_SINCE_DAYS
and make it a number where options are 90, 180, 275, 365 (days). Then you can convert those to the format sonarqube expects when you send the request. This way we are not attached to using their format in our config.Github example: