-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* required files created * func added to transition into new jira schema * jira translation done * not needed file removed * schema and folder added * files altered * scoring function * scoring func updated in sync with ssd opa * log messages added * fix: logs & continue/return stats * fix: artifact risk id query --------- Co-authored-by: priyanshishikha <[email protected]>
- Loading branch information
1 parent
41bc9ae
commit d1d9f22
Showing
15 changed files
with
7,483 additions
and
20 deletions.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
schema: schema.graphql | ||
operations: | ||
- queries.graphql | ||
generated: schema-generated.go | ||
package: august2024august2024v2 | ||
use_struct_references: true | ||
bindings: | ||
Boolean: | ||
type: "*bool" | ||
DateTime: | ||
type: "*time.Time" | ||
Int64: | ||
type: int64 | ||
Int: | ||
type: "*int" | ||
ID: | ||
type: "*string" |
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,60 @@ | ||
package august2024august2024v2 | ||
|
||
import "time" | ||
|
||
const ( | ||
RunHistoryStatusException = "exception" | ||
|
||
Pass string = "pass" | ||
Fail string = "fail" | ||
Low string = "low" | ||
Medium string = "medium" | ||
High string = "high" | ||
Critical string = "critical" | ||
|
||
SOURCE string = "source" | ||
BUILD string = "build" | ||
ARTIFACT string = "artifact" | ||
DEPLOY string = "deploy" | ||
ImageRisk string = "imageRisk" | ||
|
||
HighStatusValue int = 50 | ||
LowStatusValue int = 70 | ||
) | ||
|
||
type Scoring struct { | ||
OrganizationName string | ||
TeamName string | ||
Namespace string | ||
ClusterId string | ||
ApplicationName string | ||
ServiceName string | ||
DeployedAt time.Time | ||
Policy map[string][]PolicyDetail | ||
Image string | ||
ImageTag string | ||
ImageSha string | ||
ApplicationDeploymentId string | ||
BlockedDeployment bool | ||
FailDeploymentFirewallResult bool | ||
DeploymentFirewall bool | ||
} | ||
|
||
type PolicyDetail struct { | ||
PolicyName string | ||
Stage string | ||
Status string | ||
Severity string | ||
} | ||
|
||
type PolicyStatusCount struct { | ||
PassCount int | ||
LowPassCount int | ||
MediumPassCount int | ||
HighPassCount int | ||
CriticalPassCount int | ||
LowCount int | ||
MediumCount int | ||
HighCount int | ||
CriticalCount int | ||
} |
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,107 @@ | ||
query GetArtifactScanDataId { | ||
queryArtifactScanData { | ||
id | ||
artifactRisk { | ||
id | ||
} | ||
} | ||
} | ||
|
||
query QueryArtifactScanDataRunHistory ($scanDataId: String!) { | ||
queryArtifactScanData(filter: {id:{eq:$scanDataId}}) @cascade(fields: ["artifactRunHistory"]) { | ||
artifactRunHistory @cascade(fields: ["id"]) { | ||
id | ||
policyId | ||
PolicyName | ||
Stage | ||
Artifact | ||
ArtifactTag | ||
ArtifactSha | ||
CreatedAt | ||
UpdatedAt | ||
DeployedAt | ||
Hash | ||
Pass | ||
MetaData | ||
scheduledPolicy | ||
DatasourceTool | ||
Status | ||
securityIssue { | ||
AlertTitle | ||
AlertMessage | ||
Suggestions | ||
Severity | ||
Action | ||
Error | ||
} | ||
policyEnforcements { | ||
id | ||
status | ||
severity | ||
action | ||
conditionValue | ||
policy { | ||
id | ||
policyName | ||
category | ||
stage | ||
scheduledPolicy | ||
script | ||
variables | ||
conditionName | ||
suggestion | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
query GetArtifactRisk($id: ID!) { | ||
getArtifactRisk(id: $id) { | ||
sourceCodeAlertsScore | ||
buildAlertsScore | ||
artifactAlertsScore | ||
deploymentAlertsScore | ||
artifactRiskStatus | ||
} | ||
} | ||
|
||
mutation UpdateArtifactScanDataRiskScoreAndStatus( | ||
$id: ID! | ||
$riskStatus: RiskStatus! | ||
$buildAlertsScore: Int | ||
$sourceCodeAlertsScore: Int | ||
$artifactAlertsScore: Int | ||
$deploymentAlertsScore: Int | ||
) { | ||
updateArtifactRisk( | ||
input: { | ||
set: { | ||
artifactRiskStatus: $riskStatus | ||
sourceCodeAlertsScore: $sourceCodeAlertsScore | ||
buildAlertsScore: $buildAlertsScore | ||
artifactAlertsScore: $artifactAlertsScore | ||
deploymentAlertsScore: $deploymentAlertsScore | ||
} | ||
filter: { id: [$id] } | ||
} | ||
) { | ||
numUids | ||
} | ||
} | ||
|
||
|
||
mutation UpdateArtifactScanData($artifactScanDataId: String!) { | ||
updateArtifactScanData( | ||
input: { | ||
set: { artifactRisk: { artifactRiskStatus: scanning } } | ||
filter: { id: { eq: $artifactScanDataId } } | ||
} | ||
) { | ||
artifactScanData { | ||
artifactRisk { | ||
id | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.