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

Implement Django Security Patch Automation Workflow #300

Closed

Conversation

magajh
Copy link

@magajh magajh commented Aug 9, 2023

Description:

This PR introduces an automated workflow that detects vulnerabilities in the Django version used by our latest Open edX release and notifies the Build Test Release Working Group to apply the necessary security patches.

What does this workflow do?

  1. The workflow is set to routinely check GitHub for new Django advisories. Currently, it runs on a monthly schedule.
  2. It parses the advisories to determine if our current Django version is affected by a security vulnerability.
  3. If a vulnerability is found, the workflow creates an issue, providing details about the patch version, the vulnerability's nature, its severity, the tasks that need to be completed, and any relevant references. By opening the issue in this repository, we take advantage of the 'add-issue-to-project' workflow that automatically adds the issue to the BTR project board.

Key Implementation Details:

  • The GitHub advisory API is the primary source for vulnerability data.
  • Python scripts are used for processing and determining the relevance of vulnerabilities.
  • Issues are automatically generated if vulnerabilities are confirmed.

Request for Feedback:

I would highly appreciate your feedback on:

  • The overall structure of the workflow.
  • Potential blind spots or overlooked edge cases.
  • Improvements in error handling and efficiency.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 9, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Aug 9, 2023

Thanks for the pull request, @magajh! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

This is currently a draft pull request. When it is ready for our review and all tests are green, click "Ready for Review", or remove "WIP" from the title, as appropriate.

@cheskiduty
Copy link

To implement a Django security patch automation workflow, you can follow the steps outlined below:

  1. Stay Updated: It is crucial to stay informed about the latest security patches released by the Django community. Regularly check the official Django website, mailing lists, and security advisories to ensure you are aware of any vulnerabilities and their corresponding patches.

  2. Automated Monitoring: Set up an automated monitoring system to track new releases and security advisories. This can be done using tools like RSS feeds or email notifications from trusted sources such as the official Django website or security mailing lists.

  3. Assess Impact: When a new security patch is released, it is important to assess its impact on your Django application. Read the release notes and security advisories carefully to understand the vulnerabilities being addressed and determine if they affect your application.

  4. Test Patches: Before applying any security patch to your production environment, it is essential to test it thoroughly in a staging or development environment. Create a replica of your production setup and apply the patch to identify any potential conflicts or issues that may arise.

  5. Version Control: Use version control systems like Git to manage your Django project's codebase. This allows you to easily revert changes if a patch causes unexpected problems or conflicts with your existing code.

  6. Automated Patch Deployment: Once you have tested the security patch successfully, automate its deployment process. This can be achieved using configuration management tools like Ansible, Puppet, or Chef. These tools allow you to define the desired state of your infrastructure and automatically apply changes across multiple servers.

@magajh magajh force-pushed the magajh/add-auto-django-patch-workflow branch from 0776e6a to 5b50c05 Compare September 27, 2023 12:45
@magajh magajh force-pushed the magajh/add-auto-django-patch-workflow branch from 5b50c05 to 25c1f86 Compare September 27, 2023 13:47
@mphilbrick211
Copy link

Hi @magajh! Just checking in on this to see if you are planning to pursue this PR. Please let us know. Thanks!

@magajh
Copy link
Author

magajh commented Nov 15, 2023

The primary purpose of this PR was to automate the detection of vulnerabilities and ensure timely updates. However, during comprehensive testing of the workflow, we encountered a significant challenge related to the timeliness and reliability of the security vulnerability databases. Specifically, we used two main sources:

  1. GitHub REST API for Global Security Advisories
  2. NVD Vulnerabilities API for CVEs

The critical issue is that both these databases/APIs do not seem to be updated frequently enough. In practice, this means there could be a substantial delay - potentially months - before new Django security patches are recognized and reported by these APIs.

Given this limitation, the automated workflow may not effectively serve its intended purpose of timely vulnerability detection. Relying on this workflow could create a false sense of security, where we might overlook newly released patches that are not yet listed in these databases.

While the idea of automating the process of identifying and applying security patches is still valuable, we need to find a more reliable source of information. For now, we will not be moving forward with this PR.

@magajh magajh closed this Nov 15, 2023
@openedx-webhooks
Copy link

@magajh Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

1 similar comment
@openedx-webhooks
Copy link

@magajh Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants