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

msf-6.4.47 #9

Merged
merged 13 commits into from
Feb 4, 2025
Merged

msf-6.4.47 #9

merged 13 commits into from
Feb 4, 2025

Conversation

matusso
Copy link
Owner

@matusso matusso commented Feb 2, 2025

User description

Pull Request Description

Title: msf-6.4.47

Description:

This pull request includes several important updates to the GitHub Actions workflow for the Metasploit Framework, specifically targeting version 6.4.47. The changes made in this PR are as follows:

  1. Release Version Update: The RELEASE_VERSION in the workflow file has been updated to 6.4.47. This ensures that the workflow reflects the latest version of the Metasploit Framework, allowing for accurate builds and deployments.

  2. Clang Compiler Setup: A new feature has been added to the workflow to include the Clang compiler setup. This involves installing the latest C++ compiler and configuring the necessary environment variables for Ruby dependency installation. This enhancement is crucial for maintaining compatibility with projects that require Clang during the build process.

  3. Metasploit Version Update: The Metasploit version in the workflow configuration has been updated from 6.4.41 to 6.4.47. This change ensures that the latest features and security patches are utilized in our CI/CD processes.

These updates are essential for maintaining the integrity and functionality of the Metasploit Framework as we continue to develop and deploy new features.


PR Type

Enhancement


Description

  • Updated GitHub Actions workflow to support Clang compiler.

  • Added Clang compiler setup for Ruby dependency installation.

  • Updated Metasploit version in workflow from 6.4.41 to 6.4.47.

  • Enhanced CI/CD compatibility with latest tools and configurations.


Changes walkthrough 📝

Relevant files
Enhancement
metasploit-framework.yml
Add Clang support and update workflow version                       

.github/workflows/metasploit-framework.yml

  • Updated branch reference from msf-6.4.41 to msf-6.4.47.
  • Added Clang compiler setup in the workflow matrix.
  • Introduced a step to install the latest C++ compiler.
  • Configured environment variables for Ruby dependencies to use Clang.
  • +12/-1   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Shell Specification

    The shell specification on line 75 appears redundant since GitHub Actions already uses bash by default for Linux runners. This could be removed to simplify the workflow.

    shell: bash

    Copy link

    qodo-merge-pro-for-open-source bot commented Feb 2, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    ✅ Pin action version for stability

    Specify a fixed version for the setup-cpp-compiler action instead of using 'master'
    to ensure workflow stability and prevent breaking changes.

    .github/workflows/metasploit-framework.yml [49-50]

     - name: Install compiler
       id: install_cc
    -  uses: rlalik/setup-cpp-compiler@master
    +  uses: rlalik/[email protected]

    [Suggestion has been applied]

    Suggestion importance[1-10]: 8

    Why: Using a fixed version (@v1.1) instead of @master is a crucial best practice for GitHub Actions to ensure workflow stability and prevent unexpected breaking changes from newer versions.

    8
    Possible issue
    Add error handling for installation

    Add failure handling for the compiler installation step to ensure the workflow fails
    gracefully if the compiler setup fails.

    .github/workflows/metasploit-framework.yml [48-52]

     - name: Install compiler
       id: install_cc
       uses: rlalik/setup-cpp-compiler@master
       with:
         compiler: latest
    +  continue-on-error: false
    +  timeout-minutes: 5
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Adding timeout and explicit failure handling improves workflow reliability by preventing hanging builds and ensuring clear failure states, though the default behavior would likely catch most issues anyway.

    6

    Copy link

    qodo-merge-pro-for-open-source bot commented Feb 2, 2025

    CI Feedback 🧐

    (Feedback updated until commit 9da358c)

    A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

    Action: build-and-push (ubuntu-latest)

    Failed stage: Build and push Docker image [❌]

    Failure summary:

    The build failed during the Docker image build process due to a CGO compilation error on ARM64
    architecture:

  • The error occurred while trying to build the kiterunner project using make build
  • Specifically, the CGO tool failed with "runtime/cgo: /usr/lib/go/pkg/tool/linux_arm64/cgo: exit
    status 2"
  • This appears to be an architecture compatibility issue when building for ARM64 platform
  • The failure happened in the Dockerfile at line 20-22 during the RUN command that clones and builds
    the project

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    733:  #11 0.206 
    734:  #11 0.206 Turn off this advice by setting config variable advice.detachedHead to false
    735:  #11 0.206 
    736:  #11 0.232 mkdir -p dist
    737:  #11 0.233 go build -ldflags "-extld 'g++' -extldflags '-static' -X 'github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version=v1.0.2' -X 'github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Commit=e7a7fa635c2271cb5aeea7a885c1dc66774bb5c7' -X 'github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Date=Tue Feb  4 15:42:03 UTC 2025'" -o dist/kr ./cmd/kiterunner
    738:  #11 1.281 go: downloading github.com/mitchellh/go-homedir v1.1.0
    739:  #11 1.281 go: downloading github.com/spf13/cobra v1.1.3
    740:  #11 1.282 go: downloading github.com/spf13/viper v1.7.1
    741:  #11 1.311 go: downloading github.com/hashicorp/go-multierror v1.0.0
    ...
    
    747:  #11 1.386 go: downloading github.com/rs/zerolog v1.20.0
    748:  #11 1.470 go: downloading github.com/valyala/bytebufferpool v1.0.0
    749:  #11 1.471 go: downloading github.com/valyala/fasthttp v1.20.0
    750:  #11 1.471 go: downloading github.com/google/uuid v1.2.0
    751:  #11 1.477 go: downloading github.com/beevik/etree v1.1.0
    752:  #11 1.484 go: downloading github.com/francoispqt/gojay v1.2.13
    753:  #11 1.495 go: downloading github.com/gogo/protobuf v1.3.2
    754:  #11 1.539 go: downloading github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb
    755:  #11 1.550 go: downloading github.com/pkg/errors v0.8.1
    ...
    
    832:  #13 1.361 
    833:  #13 1.361 Turn off this advice by setting config variable advice.detachedHead to false
    834:  #13 1.361 
    835:  #13 1.759 mkdir -p dist
    836:  #13 1.783 go build -ldflags "-extld 'g++' -extldflags '-static' -X 'github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version=v1.0.2' -X 'github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Commit=e7a7fa635c2271cb5aeea7a885c1dc66774bb5c7' -X 'github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Date=Tue Feb  4 15:42:21 UTC 2025'" -o dist/kr ./cmd/kiterunner
    837:  #13 4.257 go: downloading github.com/mitchellh/go-homedir v1.1.0
    838:  #13 4.261 go: downloading github.com/spf13/cobra v1.1.3
    839:  #13 4.263 go: downloading github.com/spf13/viper v1.7.1
    840:  #13 4.552 go: downloading github.com/hashicorp/go-multierror v1.0.0
    ...
    
    858:  #13 6.010 go: downloading gopkg.in/yaml.v2 v2.4.0
    859:  #13 6.182 go: downloading github.com/valyala/bytebufferpool v1.0.0
    860:  #13 6.186 go: downloading github.com/valyala/fasthttp v1.20.0
    861:  #13 6.208 go: downloading github.com/beevik/etree v1.1.0
    862:  #13 6.212 go: downloading github.com/francoispqt/gojay v1.2.13
    863:  #13 6.215 go: downloading github.com/gogo/protobuf v1.3.2
    864:  #13 6.491 go: downloading github.com/google/uuid v1.2.0
    865:  #13 6.529 go: downloading github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb
    866:  #13 6.561 go: downloading github.com/pkg/errors v0.8.1
    ...
    
    885:  #14 DONE 0.1s
    886:  #13 [linux/arm64 4/5] RUN RELEASE_VERSION="v1.0.2" git clone --depth=1 --branch "v1.0.2"  https://github.com/assetnote/kiterunner.git .     && make build     && ln -s $(pwd)/dist/kr /usr/local/bin/kr
    887:  #13 12.64 go: downloading github.com/mattn/go-colorable v0.1.2
    888:  #13 12.65 go: downloading github.com/mattn/go-isatty v0.0.12
    889:  #13 12.67 go: downloading github.com/VividCortex/ewma v1.1.1
    890:  #13 12.67 go: downloading golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
    891:  #13 12.71 go: downloading github.com/lunixbochs/vtclean v1.0.0
    892:  #13 45.72 runtime/cgo: /usr/lib/go/pkg/tool/linux_arm64/cgo: exit status 2
    893:  #13 167.5 make: *** [makefile:19: build] Error 1
    894:  #13 ERROR: process "/dev/.buildkit_qemu_emulator /bin/sh -c RELEASE_VERSION=\"$RELEASE_VERSION\" git clone --depth=1 --branch \"$RELEASE_VERSION\"  https://github.com/assetnote/kiterunner.git .     && make build     && ln -s $(pwd)/dist/kr /usr/local/bin/kr" did not complete successfully: exit code: 2
    ...
    
    898:  9.615 go: downloading github.com/andybalholm/brotli v1.0.0
    899:  9.623 go: downloading github.com/klauspost/compress v1.10.7
    900:  12.64 go: downloading github.com/mattn/go-colorable v0.1.2
    901:  12.65 go: downloading github.com/mattn/go-isatty v0.0.12
    902:  12.67 go: downloading github.com/VividCortex/ewma v1.1.1
    903:  12.67 go: downloading golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
    904:  12.71 go: downloading github.com/lunixbochs/vtclean v1.0.0
    905:  45.72 runtime/cgo: /usr/lib/go/pkg/tool/linux_arm64/cgo: exit status 2
    906:  167.5 make: *** [makefile:19: build] Error 1
    ...
    
    908:  Dockerfile:20
    909:  --------------------
    910:  19 |     WORKDIR $KR_DIR
    911:  20 | >>> RUN RELEASE_VERSION="$RELEASE_VERSION" git clone --depth=1 --branch "$RELEASE_VERSION"  https://github.com/assetnote/kiterunner.git . \
    912:  21 | >>>     && make build \
    913:  22 | >>>     && ln -s $(pwd)/dist/kr /usr/local/bin/kr
    914:  23 |     
    915:  --------------------
    916:  ERROR: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c RELEASE_VERSION=\"$RELEASE_VERSION\" git clone --depth=1 --branch \"$RELEASE_VERSION\"  https://github.com/assetnote/kiterunner.git .     && make build     && ln -s $(pwd)/dist/kr /usr/local/bin/kr" did not complete successfully: exit code: 2
    917:  ##[error]Process completed with exit code 1.
    

    Adds Clang compiler to the GitHub Actions workflow for the 
    Metasploit Framework. This change includes installing the 
    latest C++ compiler and setting environment variables for 
    Ruby dependency installation. This ensures compatibility 
    with projects requiring Clang during the build process.
    Updates the Metasploit version in the GitHub Actions workflow 
    configuration from 6.4.41 to 6.4.47 to ensure the latest features 
    and security patches are utilized during CI/CD processes.
    Rearrange the shell command and run directive in the 
    metasploit-framework.yml workflow file to ensure 
    proper execution of Ruby dependencies installation.
    Removes the unused compiler matrix option and sets the compiler to 
    clang in the setup step. This streamlines the CI configuration and 
    ensures consistency in the build environment.
    Adds environment variables for CC and CXX in the Docker build step. 
    Specifies the shell as bash to ensure compatibility. This enhances 
    the build process by allowing the use of the correct compilers 
    for different architectures, improving the overall build 
    efficiency and.
    Updates the GitHub Actions workflow for Metasploit to include 
    the installation of the libpq-dev package alongside libpcap-dev. 
    This change ensures that the necessary dependencies for PostgreSQL 
    are available during the build process.
     unnecessary installation steps libpcap and dependencies. 
     the Docker build command to directly reference the Metasploit 
    repository, streamlining the workflow and reducing build time. 
    Set the Ruby version environment variable for clarity.
    Add local caching for Docker builds in the GitHub Actions workflow. 
    This change enhances build performance by utilizing cached layers, 
    reducing build time and improving efficiency during the CI process.
    Add QEMU and Docker Buildx setup steps to the workflow. 
    Upgrade the Docker cache action to version 4 for improved 
    performance. Remove the redundant compiler installation 
    step to streamline the build process. Adjust the shell 
    command for building and pushing the Docker image.
    Updates the GitHub Actions workflow to multi-architecture 
    Docker image builds for both amd64 and arm64 platforms. This change 
    includes the addition of a new job for building and pushing the 
    arm64 Docker image, as well as creating and pushing a multi-platform 
    manifest. The workflow also integrates security scanning and 
    uploads SARIF reports for better vulnerability management. These 
    enhancements improve the deployment flexibility and security of the 
    Metasploit Framework.
    Change the runner for the ARM64 build job from a self-hosted 
    environment to the official Ubuntu 22.04 ARM64 runner. This 
    ensures better compatibility and support for the build process, 
    leveraging the latest features and updates provided by the 
    Ubuntu environment.
    Changes the runner for the build-and-push-arm64 job from 
    Ubuntu 22.04 ARM64 to Ubuntu 24.04 ARM. This update ensures 
    compatibility with the latest features and improvements 
    available in the newer Ubuntu version.
    Adds a checkout step to the GitHub Actions workflow for the 
    Metasploit Framework. This change ensures that the repository 
    is available at the specified release version, enabling 
    subsequent steps to access necessary code and resources 
    for building and testing the Docker image.
    Copy link

    sonarqubecloud bot commented Feb 4, 2025

    Copy link

    sonarqubecloud bot commented Feb 4, 2025

    Copy link

    sonarqubecloud bot commented Feb 4, 2025

    Copy link

    sonarqubecloud bot commented Feb 4, 2025

    Copy link

    sonarqubecloud bot commented Feb 4, 2025

    @github-advanced-security
    Copy link

    This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

    @matusso matusso merged commit 781fc15 into main Feb 4, 2025
    29 of 31 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant