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

Issue #34 Enhance Docker Security and Best Practices #40

Closed
wants to merge 4 commits into from

Conversation

myselfdeepdas
Copy link

This pull request introduces improvements to enhance the security and follow best practices when running Docker containers for the OBA server and the transit data bundler.

Changes Made:

  1. oba/Dockerfile:

    • Create a non-root user ('oba') for improved security.
    • Switch to the non-root user for subsequent Dockerfile steps.
    • Refactor the Dockerfile to align with Docker best practices.
  2. bundler/Dockerfile:

    • Create a non-root user ('oba') for enhanced security.
    • Switch to the non-root user for the remaining Dockerfile steps.
    • Adjust the Dockerfile according to best practices.

Context:

The changes aim to minimize the potential security risks associated with running containers as the root user. Following best practices, we've created a dedicated non-root user for the containers, reducing the attack surface and enhancing the overall security posture.

Please review and merge these changes to ensure a more secure and reliable deployment of the OBA server and the transit data bundler containers.

Thank you!

Introduce a non-root user ('oba') in the OBA Dockerfile and switch to that user for improved security. This aligns with best practices for running Docker containers without superuser privileges. Ensure that the non-root user has the required permissions for the subsequent commands.
Introduce a non-root user ('oba') in the Bundler Dockerfile and switch to that user for enhanced security. Following Docker best practices reduces the risks associated with running containers as the root user. Confirm that the non-root user has the necessary permissions for the subsequent steps.
@CLAassistant
Copy link

CLAassistant commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

@myselfdeepdas myselfdeepdas changed the title #34 Enhance Docker Security and Best Practices Issue #34 Enhance Docker Security and Best Practices Feb 22, 2024
Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Dockerfiles will no longer work after the changes that are in this PR. It almost looks like the output of ChatGPT with the comments saying "Continue with the rest of the Dockerfile as the non-root user" in the Dockerfiles

@myselfdeepdas
Copy link
Author

Check it out—I made some changes

@@ -16,8 +19,6 @@ WORKDIR /oba/libs

# OBA WAR and JAR files
RUN wget "https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-transit-data-federation-webapp/${OBA_VERSION}/onebusaway-transit-data-federation-webapp-${OBA_VERSION}.war"
RUN wget "https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-api-webapp/${OBA_VERSION}/onebusaway-api-webapp-${OBA_VERSION}.war"
Copy link
Contributor

@Neo2308 Neo2308 Feb 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@myselfdeepdas Removing these wget statements seems to be unintentional. Could you revert?

@aaronbrethorst
Copy link
Member

Superseded by #55

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.

4 participants