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

fix(vm): support sector size of 4096 #4564

Merged
merged 4 commits into from
Jun 8, 2023

Conversation

amirbenun
Copy link
Contributor

@amirbenun amirbenun commented Jun 5, 2023

Description

Bump go-xfs-filesystem to support sector size of 4096.
Before the fix, when scanning an EBS snapshot with sector size of 4096 trivy printed: Partition error: filesystem error: unexpected fs error: new xfs filesystem error: failed to parse primary allocation group: failed to parse agf magic byte error: 00000000

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@amirbenun amirbenun requested a review from knqyf263 as a code owner June 5, 2023 17:22
@CLAassistant
Copy link

CLAassistant commented Jun 5, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@masahiro331
Copy link
Collaborator

masahiro331 commented Jun 8, 2023

Update dependency.

History:

masahiro331/go-xfs-filesystem#5 for fixing failing windows-latest test
masahiro331/go-xfs-filesystem@db911cc for parse b-tree directory extents

@masahiro331
Copy link
Collaborator

masahiro331 commented Jun 8, 2023

Test images.

AMI-ID Name pass
ami-07c2a88388bb80eb0 amzn2-ami-kernel-5.10-hvm-2.0.20230515.0-x86_64-gp2
ami-0d52744d6551d851e Ubuntu Server 22.04 LTS (HVM), SSD Volume Type
ami-0ed99df77a82560e6 Ubuntu Server 20.04 LTS (HVM), SSD Volume Type
ami-0750fb43a63427eff Debian 11 (HVM), SSD Volume Type
ami-08e2e16f77aee034d SUSE Linux Enterprise Server 15 SP4 (HVM), SSD Volume Type
ami-0477d3aed9e98876c Red Hat Enterprise Linux 9 (HVM), SSD Volume Type

Other test, the test was conducted using the following packer template

{
  "builders": [
    {
      "type": "amazon-ebs",
      "region": "ap-northeast-1",
      "instance_type": "t2.micro",
      "ssh_username": "ec2-user",
      "ami_name": "amazonlinux-2023",
      "source_ami": "ami-0f36dcfcc94112ea1",
      "tags": {
        "Name": "amazonlinux2-gp2-x86",
        "Description": "created by packer"
      },
      "snapshot_tags": {
        "Name": "amazonlinux2-gp2-x86",
        "Description": "created by packer"
      },
      "launch_block_device_mappings": {
        "device_name": "/dev/xvda",
        "volume_type": "gp2",
        "volume_size": 8
      }
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "sudo yum -y update",
        "sudo yum install -y wget",
        "sudo mkdir /deploy && sudo chown ec2-user:ec2-user /deploy",
        "wget https://archive.apache.org/dist/kafka/2.7.2/kafka_2.12-2.7.2.tgz -P /deploy/",
        "tar xvf /deploy/kafka_2.12-2.7.2.tgz -C /deploy/"
      ]
    }
  ]
}

@knqyf263 knqyf263 changed the title chore(deps): bump go-xfs-filesystem fix(vm): support sector size of 4096 Jun 8, 2023
@knqyf263 knqyf263 merged commit 9b531fa into aquasecurity:main Jun 8, 2023
9 checks passed
AnaisUrlichs pushed a commit to AnaisUrlichs/trivy that referenced this pull request Aug 10, 2023
Co-authored-by: masahiro331 <m_fujimura@r.recruit.co.jp>
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.

None yet

4 participants