Skip to content

Security/src findings#398

Merged
estohlmann merged 42 commits into
developfrom
security/src-findings
Sep 29, 2025
Merged

Security/src findings#398
estohlmann merged 42 commits into
developfrom
security/src-findings

Conversation

@batzela
Copy link
Copy Markdown
Contributor

@batzela batzela commented Sep 19, 2025

Security Improvements and Vulnerability Remediation

This PR addresses multiple security vulnerabilities identified through security scorecard analysis and implements comprehensive security best practices across the LISA codebase.

Security Enhancements

Dependency Security:

  • Updated vulnerable dependencies across Python and Node.js packages
  • Implemented Dependabot configuration for automated security updates

Container Security:

  • Updated Dockerfiles with security-focused base images
  • Improved container build processes with security scanning
  • Enhanced Docker layer caching and security practices

Infrastructure Security:

  • Added CodeQL security scanning workflow
  • Implemented security-focused GitHub Actions workflows
  • Enhanced CI/CD pipeline with security checks

API Security:

  • Improved API key handling and cleanup mechanisms
  • Enhanced LiteLLM integration with secure configuration
  • Added model API key cleanup functionality

Key Changes

  • Security Documentation: Added comprehensive SECURITY.md
  • Dependency Management: Updated 9+ requirement files with security patches
  • Workflow Security: Enhanced 15+ GitHub Actions workflows
  • Container Security: Updated 6+ Dockerfiles with security improvements
  • API Security: Implemented secure API key management

This PR significantly enhances the security posture of the LISA project by addressing known vulnerabilities and implementing industry-standard security practices.

- Added a new Lambda function for cleaning up API keys from existing models to resolve "Invalid API Key format" errors.
- Updated langchain and langchain-community dependencies to version 0.3.27 in multiple requirements files.
- Introduced Dockerfiles for Lambda functions to support container-based deployments.
- Refactored existing Lambda functions to utilize Docker images for improved performance and maintainability.
- Adjusted environment variables and permissions in the API and RAG constructs to accommodate new configurations.
- Updated the logic to only set the api_key in litellm_params if it is present in the event, improving robustness and preventing unnecessary assignments.
- Improved error handling in the `handle_add_model_to_litellm` function to accommodate various response structures from the LiteLLM API.
- Refactored debug logging in `model_api_key_cleanup.py` for clarity.
- Updated Docker image function naming in `utils.ts` for better identification.
- Added new environment variables in `serveApplicationConstruct.ts` to support database connection information.
- Adjusted permissions for REST API roles to include new database access.
- Updated LisaModels NAG error count from 76 to 80
- Updated LisaRAG NAG error count from 51 to 37
- Updated LisaModels NIST error count from 64 to 70
- Updated LisaModels role count from 9 to 10
- Added LisaModels role override count of 1

These changes reflect the security improvements made in the branch
that added new IAM roles and security configurations.
Comment thread .github/workflows/test-and-lint.yml Outdated
batzela and others added 14 commits September 22, 2025 16:39
- Added comprehensive tests for bedrock_auth_cleanup.py (93% coverage)
- Added comprehensive tests for model_api_key_cleanup.py (42% coverage)
- Improved overall test coverage from 80.71% to 82.67%
- Tests cover success, failure, and edge case scenarios
- All new tests pass successfully
- Updated react-syntax-highlighter imports to use available styles
- Changed from vscDarkPlus to atomOneDark theme
- Fixed import paths to work with updated package versions
- Build now completes successfully
- Modified CodeQL workflow to enable upload of analysis results.
- Enhanced Cypress login command to ensure modal visibility before clicking the Sign in button.
- Updated VitePress configuration to exclude image files from Rollup build.
- Refactored and added new tests for model_api_key_cleanup, covering scenarios for no tables found, missing columns, and handling cases with no models needing updates.
…coverage

- Temporarily disabled CodeQL triggers to avoid conflicts with the default setup.
- Added a custom logout command in Cypress to clear authentication state before tests.
- Updated Cypress smoke tests to ensure a clean state by logging out before each test.
- Improved test coverage in bedrock_auth_cleanup.py with better handling of request types and exceptions.
- Added debug checks in smoke tests to verify page navigation and user authentication.
- Improved button existence checks in admin helper functions by logging available buttons on the page.
- Updated button selection to use text content for better reliability in identifying the Administration button.
…elComparison.config.ts to align with the latest react-syntax-highlighter structure.
Comment thread .github/dependabot.yml Outdated
Comment thread .github/dependabot.yml
Comment thread .github/dependabot.yml
Comment thread Makefile
Comment thread lambda/models/model_api_key_cleanup.py Outdated
Comment thread lambda/requirements.txt
Comment thread package.json Outdated
Comment thread lib/serve/rest-api/src/requirements.txt Outdated
Comment thread lambda/models/state_machine/create_model.py
Comment thread lambda/utilities/common_functions.py
Comment thread lib/docs/.vitepress/config.mts Outdated
Comment thread lib/user-interface/react/src/components/chatbot/components/Message.tsx Outdated
bedanley
bedanley previously approved these changes Sep 29, 2025
@estohlmann estohlmann merged commit e611b80 into develop Sep 29, 2025
8 checks passed
@estohlmann estohlmann deleted the security/src-findings branch September 29, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants