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

Initial setup and configuration for Docker Fluent Bit Collector #1

Merged
merged 5 commits into from
Nov 17, 2024

Conversation

bardabun
Copy link
Contributor

@bardabun bardabun commented Nov 3, 2024

Overview This pull request establishes the foundational setup for the Docker Fluent Bit Collector project, which integrates log collection with Logz.io using Fluent Bit. This initial commit includes the core components, configuration files, and Docker setup necessary to begin collecting and shipping logs from Docker containers.

@bardabun bardabun requested a review from 8naama November 3, 2024 18:08
Dockerfile.amd64 Outdated Show resolved Hide resolved
Dockerfile.arm64 Outdated Show resolved Hide resolved
Copy link

@8naama 8naama left a comment

Choose a reason for hiding this comment

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

Very cool! 🎉
left a few notes, also need to review the cycode notes and ensure the e2e test will pass

.github/workflows/ci-tests.yml Outdated Show resolved Hide resolved
.github/workflows/ci-tests.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docker-metadata.lua Outdated Show resolved Hide resolved
docker-metadata.lua Outdated Show resolved Hide resolved
docker-metadata.lua Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
create_fluent_bit_config.py Outdated Show resolved Hide resolved
Dockerfile.arm64 Outdated Show resolved Hide resolved
Dockerfile.amd64 Outdated Show resolved Hide resolved
Dockerfile.amd64 Outdated Show resolved Hide resolved
Dockerfile.arm64 Outdated Show resolved Hide resolved
@bardabun bardabun requested a review from 8naama November 14, 2024 10:29
Copy link

@8naama 8naama left a comment

Choose a reason for hiding this comment

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

Looks really good!! Nice job! 💪🏼

I only commented on 2 of my previous points, perhaps worth to get an extra opinion from the team on those

FROM fluent/fluent-bit:1.9.10 AS fluent-bit

# Copy Fluent Bit binary to the base image
FROM base

Choose a reason for hiding this comment

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

Cycode: Infrastructure configuration issue: 'Specific user should be defined'.
Severity: High

Description

The image will run as root unless a lesser privileged user is defined

Cycode Remediation Guideline

Ensure that at least one USER instruction is defined before or in any none 'FROM scratch' build stage)


def save_config_file(config_content, filename):
os.makedirs(os.path.dirname(filename), exist_ok=True)
with open(filename, 'w') as file:

Choose a reason for hiding this comment

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

Cycode: SAST violation: 'Unsanitized dynamic input in file path'.

Severity: High

Description

Using unsanitized dynamic input to determine file paths can allow attackers to gain access to files and folders outside of the intended scope. This vulnerability occurs when input provided by users is directly used to access the filesystem without proper validation or sanitization.

Cycode Remediation Guideline

✅ Do


  • Do sanitize external input used in file paths. Use os.path.normpath to normalize paths and remove any redundant separators in order to prevent path traversal attacks.
    os.path.normpath(os.path.join(base_directory, user_input))
  • Do use absolute path checks to confirm that the constructed path is within the expected directory
    base = os.path.abspath(base_directory)
    user_path = os.path.abspath(os.path.join(base_directory, user_input))
    if user_path.startswith(base)
      # Handle or reject the input

❌ Don't


  • Do not directly use external input to construct file paths. This can lead to unauthorized file access.

📋 References


Tell us what how you wish to proceed using one of the following commands:

Tag Short Description
#cycode_sast_ignore_here Ignore this violation — applies to this violation only
#cycode_sast_false_positive Mark as false positive — applies to this violation only

⚠️ When commenting on Github, you may need to refresh the page to see the latest updates.

@bardabun bardabun requested a review from 8naama November 17, 2024 12:48
Copy link

@8naama 8naama left a comment

Choose a reason for hiding this comment

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

Yalla 🍻

@bardabun bardabun merged commit 53a026c into main Nov 17, 2024
5 of 7 checks passed
@bardabun bardabun deleted the feature/initial-setup branch November 17, 2024 13:23
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.

2 participants