Skip to content
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

feat(config-api): new endpoint for jans service status and file type script enhancement #10014

Merged
merged 171 commits into from
Nov 5, 2024

Conversation

pujavs
Copy link
Contributor

@pujavs pujavs commented Nov 1, 2024

Prepare


Description

  1. Issue#9979: fix(jans-tui): Saving a script as a file is not working
  2. Issue#9884: feat(jans-config-api): need health APIs for FIDO, KC, SCIM, CASA

Target issue

closes #9884 #9979

Implementation Details


Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

Copy link

dryrunsecurity bot commented Nov 1, 2024

DryRun Security Summary

The pull request covers various updates and improvements to the Jans Config API application, with a focus on the health monitoring and service status reporting functionality, and while the changes do not appear to introduce immediate security vulnerabilities, there are a few areas that should be carefully reviewed and addressed to maintain the overall security of the application.

Expand for full summary

Summary:

The code changes in this pull request cover various updates and improvements to the Jans Config API application, with a focus on the health monitoring and service status reporting functionality. The changes include the addition of new API endpoints, improvements to date and integer data handling, and the introduction of example responses for certain endpoints.

From an application security perspective, the changes do not appear to introduce any immediate security vulnerabilities. However, there are a few areas that should be carefully reviewed and addressed to maintain the overall security of the application:

  1. Sensitive Information Exposure: The new /health/service-status endpoint and the example server-stat.json file could potentially expose sensitive information about the server's infrastructure, such as hostname, IP address, and system metrics. Ensure that access to this information is properly restricted and that no sensitive data is inadvertently included.

  2. Input Validation and Sanitization: While the changes include some improvements to input handling, such as the null check for assertionValue and the use of the escapeLog() method, it's important to thoroughly review all user input validation and sanitization across the application to prevent common web application vulnerabilities like SQL injection, command injection, and cross-site scripting (XSS).

  3. Authorization and Access Control: Ensure that the new health monitoring and service status endpoints are properly protected and accessible only to authorized users or roles. Regularly review the access control mechanisms to prevent unauthorized access to sensitive information or functionality.

  4. Secure Handling of Sensitive Data: The application interacts with various external programs and services to gather system information. Ensure that any sensitive data, such as credentials or API keys, are properly secured and not exposed in the application's logs or responses.

  5. Hardcoded Paths and Configuration: While the changes include some improvements, such as the use of the getIso8601Date() method, there are still some instances of hardcoded paths and configuration values. Consider making these more configurable to improve the application's maintainability and security.

Overall, the changes appear to be focused on improving the functionality and robustness of the Jans Config API application. By addressing the security considerations outlined above, the application's security posture can be further strengthened and the risk of potential vulnerabilities can be reduced.

Files Changed:

  1. ApiConstants.java: The changes introduce a new constant for a /service-status endpoint, which should be reviewed for proper implementation of security controls.
  2. CustomScriptResource.java: The changes address the handling of custom scripts with a FILE location type, which is a positive security enhancement.
  3. ApiHealthCheck.java: The changes include the addition of a new /health/service-status endpoint, which should be carefully reviewed for potential sensitive information exposure and proper access control.
  4. server-stat.json: The new JSON file contains potentially sensitive server information, and its access should be properly restricted.
  5. TokenService.java: The changes improve the handling of token-related operations, which is a security-sensitive area that requires ongoing review and monitoring.
  6. StatusCheckerTimer.java: The changes introduce the execution of external programs to gather system information, which should be reviewed for potential command injection vulnerabilities and secure handling of any sensitive data.
  7. service-status.json: The new JSON file represents the status of various services, and its access should be properly controlled to prevent information disclosure.
  8. DataUtil.java: The changes improve the handling of date and integer data types, which is a positive security enhancement.
  9. jans-config-api-swagger.yaml: The changes include the addition of example responses for the health monitoring and service status endpoints, which should be reviewed for potential security implications.

Code Analysis

We ran 9 analyzers against 9 files and 1 analyzer had findings. 8 analyzers had no findings.

Analyzer Findings
Authn/Authz Analyzer 4 findings

Riskiness

🟢 Risk threshold not exceeded.

View PR in the DryRun Dashboard.

@mo-auto mo-auto added comp-docs Touching folder /docs comp-jans-config-api Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Nov 1, 2024
yurem
yurem previously approved these changes Nov 1, 2024
@yurem yurem enabled auto-merge (squash) November 1, 2024 17:30
Copy link

sonarcloud bot commented Nov 3, 2024

Copy link

sonarcloud bot commented Nov 4, 2024

Copy link

sonarcloud bot commented Nov 4, 2024

Copy link

sonarcloud bot commented Nov 4, 2024

Copy link

sonarcloud bot commented Nov 4, 2024

Copy link

sonarcloud bot commented Nov 4, 2024

Copy link

sonarcloud bot commented Nov 4, 2024

@yurem yurem merged commit 7c036f5 into main Nov 5, 2024
8 of 9 checks passed
@yurem yurem deleted the jans-config-fix branch November 5, 2024 10:11
yuriyz added a commit that referenced this pull request Nov 7, 2024
…script enhancement (#10014)

* fix(config-api): asset mgt endpoint fixes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset upload mgt ehancement and fido

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset upload mgt ehancement and fido

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset upload mgt ehancement and fido

Signed-off-by: pujavs <[email protected]>

* fix(config-api): asset upload

Signed-off-by: pujavs <[email protected]>

* fix(config-api): lock review comments

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock code review comments

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock master renamed to lock server

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 delete functionality

Signed-off-by: pujavs <[email protected]>

* fix(config-api): acr validation

Signed-off-by: pujavs <[email protected]>

* feat(config-api): doc(config-api): IDP schema attribute descriptions #9187

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): uploading assets via API generates 2 entries #9178

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt, fido and IDP changes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 device endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): resolved sonar review issues

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sonar review comment fix

Signed-off-by: pujavs <[email protected]>

* feat(config-api): swagger spec

Signed-off-by: pujavs <[email protected]>

* feat(config-api): saml config attribute description

Signed-off-by: pujavs <[email protected]>

* doc(config-api): added SAML attribute description

Signed-off-by: pujavs <[email protected]>

* doc(config-api): added SAML attribute description

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* fix(jans-lock): code review comment fix isssue#9305

Signed-off-by: pujavs <[email protected]>

* fix(jans-lock): code review comment fix isssue#9305

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock review point

Signed-off-by: pujavs <[email protected]>

* fix(lock): code review comment

Signed-off-by: pujavs <[email protected]>

* fix(lock): code review comment

Signed-off-by: pujavs <[email protected]>

* fix(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): lock endpoint fixes and SAML IDP NPE

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): implement timer for asset mgt to fetch and deploy assets forconfig-api #9403

Signed-off-by: pujavs <[email protected]>

* fix(config-api): scope validation issue #9426

Signed-off-by: pujavs <[email protected]>

* fix(config-api): asset delete error fix

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sysnc with main

Signed-off-by: pujavs <[email protected]>

* fix(config-ap): lock audit endpoint parameter declaration error#9460

Signed-off-by: pujavs <[email protected]>

* feat(config-api): client token functionality

Signed-off-by: pujavs <[email protected]>

* fix(Config-api): lock audit endpoint path param rectification

Signed-off-by: pujavs <[email protected]>

* feat(config-api): clint token endpoint - wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): clint token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): client token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): client token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session ednpoint wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session ednpoint wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and token endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and fido2 endpoint

Signed-off-by: pujavs <[email protected]>

* test(config-api): marked session failing test case

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt dir mapping changes wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt dir changes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt changes for dir

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt endpoint -wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): asset mgt endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): custom asset mgt wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): custom asset mgt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): custom asset mgt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove sessionId

Signed-off-by: pujavs <[email protected]>

* feat(config-api) session endpoint changes to hide id

Signed-off-by: pujavs <[email protected]>

* feat(config-api) session endpoint changes to hide id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint mgt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session enhancement for removing id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint changes to remove session id

Signed-off-by: pujavs <[email protected]>

* feat(config-api): search fieldValuePair enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): search fieldValuePair enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session field filter enhancement - wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session field search enhancement wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint search enhancemnt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint search enhancemnt

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session endpoint search enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and token endpoint enhacement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session and token search enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): session search changes for session attribute

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 search endpoint

Signed-off-by: pujavs <[email protected]>

* feat(config-api): fido2 entry search

Signed-off-by: pujavs <[email protected]>

* feat(config-api): pagination implemented in fido2, session and token endpoints

Signed-off-by: pujavs <[email protected]>

* feat(Config-ap): acr enhacement for agama

Signed-off-by: pujavs <[email protected]>

* feat(Config-ap): made asset error message descriptive

Signed-off-by: pujavs <[email protected]>

* feat(config-api): token date format changes

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date time changes for tkken comparison:

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date time changes for tkken comparison

Signed-off-by: pujavs <[email protected]>

* feat(config-api): sync with main

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date check

Signed-off-by: pujavs <[email protected]>

* feat(config-api): date format enhancement - wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): service status endpoint wip

Signed-off-by: pujavs <[email protected]>

* feat(config-api): new endpoint for jans service status and file type script enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): new endpoint for jans service status and file type script enhancement

Signed-off-by: pujavs <[email protected]>

* feat(config-api): new endpoint for jans service status and file type script enhancement

Signed-off-by: pujavs <[email protected]>

---------

Signed-off-by: pujavs <[email protected]>
Co-authored-by: YuriyZ <[email protected]>
Former-commit-id: 7c036f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-docs Touching folder /docs comp-jans-config-api Component affected by issue or PR kind-feature Issue or PR is a new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(jans-config-api): need health APIs for FIDO, KC, SCIM, CASA
5 participants