-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MARP-1294 Create a central monitoring reporting for security issues of axonivy marketplace #251
Merged
ndkhanh-axonivy
merged 26 commits into
develop
from
feature/MARP-1294-Create-a-central-monitoring-reporting-for-security-issues-of-axonivy-marketplace
Dec 17, 2024
Merged
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0015c30
Implement
ndkhanh-axonivy bd5b0b0
Add tests and refactor code UI
ndkhanh-axonivy d5d107f
Implement Test for BE
ndkhanh-axonivy fb068b0
Handle feedbacks
ndkhanh-axonivy c03eb6e
Handle feedbacks
ndkhanh-axonivy d5a2306
Handle feedbacks
ndkhanh-axonivy 6cab5cd
Handle feedbacks
ndkhanh-axonivy d37e64b
Update GitHubUtilsTest.java
ndkhanh-axonivy ff89fb9
Fix sonar issues
ndkhanh-axonivy 97be794
Fix sonars
ndkhanh-axonivy 8c61d56
Sonar fixes
ndkhanh-axonivy 98cf424
Update security-monitor.component.ts
ndkhanh-axonivy b7e4f6f
Update test UI
ndkhanh-axonivy 259ce0a
Handle feedbacks
ndkhanh-axonivy 2e834b1
Merge branch 'develop' into feature/MARP-1294-Create-a-central-monito…
ndkhanh-axonivy f0f0caf
Fix sonar issues
ndkhanh-axonivy 564de97
Fix UI sonar issues
ndkhanh-axonivy 4668ce1
Fix sonar UI
ndkhanh-axonivy 0fa0987
Update security-monitor.component.ts
ndkhanh-axonivy ebfff4f
Update security-monitor.component.ts
ndkhanh-axonivy c2b4431
Handle feedbacks
ndkhanh-axonivy af3ae9c
Update security-monitor.component.ts
ndkhanh-axonivy cd4f397
Update security-monitor.component.spec.ts
ndkhanh-axonivy 90a1f61
Update security-monitor.component.ts
ndkhanh-axonivy eeb6abb
Update security-monitor.component.spec.ts
ndkhanh-axonivy cfe9240
Update security-monitor.component.ts
ndkhanh-axonivy 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
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
39 changes: 39 additions & 0 deletions
39
...tplace-service/src/main/java/com/axonivy/market/controller/SecurityMonitorController.java
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,39 @@ | ||
package com.axonivy.market.controller; | ||
|
||
import com.axonivy.market.constants.GitHubConstants; | ||
import com.axonivy.market.github.service.GitHubService; | ||
import com.axonivy.market.github.model.ProductSecurityInfo; | ||
import com.axonivy.market.util.AuthorizationUtils; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
import static com.axonivy.market.constants.RequestMappingConstants.SECURITY_MONITOR; | ||
import static org.springframework.http.HttpHeaders.AUTHORIZATION; | ||
|
||
@RestController | ||
@RequestMapping(SECURITY_MONITOR) | ||
@Tag(name = "Security Monitor Controllers", description = "API collection to get Github Marketplace security's detail.") | ||
@AllArgsConstructor | ||
public class SecurityMonitorController { | ||
private final GitHubService gitHubService; | ||
|
||
@GetMapping | ||
@Operation(hidden = true) | ||
public ResponseEntity<Object> getGitHubMarketplaceSecurity( | ||
@RequestHeader(value = AUTHORIZATION) String authorizationHeader) { | ||
String token = AuthorizationUtils.getBearerToken(authorizationHeader); | ||
gitHubService.validateUserInOrganizationAndTeam(token, GitHubConstants.AXONIVY_MARKET_ORGANIZATION_NAME, | ||
GitHubConstants.AXONIVY_MARKET_TEAM_NAME); | ||
List<ProductSecurityInfo> securityInfoList = gitHubService.getSecurityDetailsForAllProducts(token, | ||
GitHubConstants.AXONIVY_MARKET_ORGANIZATION_NAME); | ||
return ResponseEntity.ok(securityInfoList); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
marketplace-service/src/main/java/com/axonivy/market/enums/AccessLevel.java
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,10 @@ | ||
package com.axonivy.market.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum AccessLevel { | ||
NO_PERMISSION, ENABLED, DISABLED | ||
} |
16 changes: 16 additions & 0 deletions
16
marketplace-service/src/main/java/com/axonivy/market/github/model/CodeScanning.java
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,16 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import com.axonivy.market.enums.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Map; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class CodeScanning { | ||
private Map<String, Integer> alerts; | ||
private AccessLevel status; | ||
} |
16 changes: 16 additions & 0 deletions
16
marketplace-service/src/main/java/com/axonivy/market/github/model/Dependabot.java
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,16 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import com.axonivy.market.enums.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Map; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class Dependabot { | ||
private Map<String, Integer> alerts; | ||
private AccessLevel status; | ||
} |
25 changes: 25 additions & 0 deletions
25
marketplace-service/src/main/java/com/axonivy/market/github/model/ProductSecurityInfo.java
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,25 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Date; | ||
import java.util.Map; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ProductSecurityInfo { | ||
private String repoName; | ||
private boolean isArchived; | ||
private String visibility; | ||
private boolean branchProtectionEnabled; | ||
private Date lastCommitDate; | ||
private String latestCommitSHA; | ||
private Dependabot dependabot; | ||
private SecretScanning secretsScanning; | ||
private CodeScanning codeScanning; | ||
} |
14 changes: 14 additions & 0 deletions
14
marketplace-service/src/main/java/com/axonivy/market/github/model/SecretScanning.java
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,14 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import com.axonivy.market.enums.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class SecretScanning { | ||
private Integer numberOfAlerts; | ||
private AccessLevel status; | ||
} |
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
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.
this constant is not used.