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

checksec FORTIFY detection (proccheck) again #244

Closed
wants to merge 10 commits into from
Closed

checksec FORTIFY detection (proccheck) again #244

wants to merge 10 commits into from

Conversation

teoberi
Copy link
Contributor

@teoberi teoberi commented May 13, 2024

Added detailed results for Fortify: 'N/A', 'Partial' in src/functions/proccheck.sh
Add cases for 'N/A' and 'Partial' in tests/hardening-checks.sh ('# process checks' section)
Update build_binaries.sh ('# Fortify source' section)
Change test files for Fortify
Fix for #241

Added detailed results for Fortify: 'N/A', 'Partial'
Add cases for 'N/A' and 'Partial'
Generating test files for Fortify (nolibc*, fszero*)
@teoberi
Copy link
Contributor Author

teoberi commented May 13, 2024

./build_binaries.sh: line 54: nasm: command not found

NASM can be added or I can add the object files (.o), i.e. nolibc.o and nolibc32.o generated with the commands:

nasm -f elf64 -o nolibc.o nolibc.asm
nasm -f elf32 -o nolibc32.o nolibc32.asm

I would still prefer the addition of NASM instead of the .o binary files that contain the machine code.

Required if NASM assembler is not installed.
@teoberi
Copy link
Contributor Author

teoberi commented May 17, 2024

If the addition of missing object files is accepted, does it go through a Draft pull requests?
If NASM is installed, the files are regenerated and therefore the added ones are overwritten.

@slimm609
Copy link
Owner

If the addition of missing object files is accepted, does it go through a Draft pull requests? If NASM is installed, the files are regenerated and therefore the added ones are overwritten.

If the addition of missing object files is accepted, does it go through a Draft pull requests? If NASM is installed, the files are regenerated and therefore the added ones are overwritten.

The Dockerfiles are not generated, its only the checksec script itself that is generated. The formatting/linters apply to all files though

@teoberi
Copy link
Contributor Author

teoberi commented May 20, 2024

So can NASM be installed or do I add the object files generated by me with NASM?

@slimm609
Copy link
Owner

yes, please add it to the test dockerfiles

Add files via upload *.o (object files)
…r installation.

Installing the NASM assembler leads to the regeneration of the object files (.o) from the .asm sources
…ec.sh into Fortify_proccheck

Fetching changes from remote repository (Fortify_proccheck) for object files (.o)
Copy link
Owner

Choose a reason for hiding this comment

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

Do these .o files need included? Wouldn't these be compiled by nasm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two variants:

  1. NASM is installed together with the other packages for ubuntu checksec + photon checksec, otherwise an error occurs due to the lack of the 2 files;
  2. NASM is not installed and the two files are delivered to pass the tests.
    If the two files are delivered but NASM is also installed, the files are overwritten, as I explained in the post here and here.
    I know from experience in other open-source projects that in general binary files are not accepted in the source code but should be generated. Without installing NASM I have no way to do this, that's why I added them.
    I asked in the first post after the description for Pull requests if NASM can be installed or if I should add the object files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be added:
nasm binutils
in the docker unbuntu and photon configuration files?
https://github.com/slimm609/checksec.sh/blob/9a7f5353af5ab714abb91c1d4aecfc10ce3af8e4/Dockerfile.ubuntu#L8
gcc clang gcc-multilib nasm binutils && apt-get clean \
https://github.com/slimm609/checksec.sh/blob/9a7f5353af5ab714abb91c1d4aecfc10ce3af8e4/Dockerfile.photon#L7
findutils gzip file which libxml2 python3 python3-pip jq clang nasm binutils && \

Copy link
Owner

Choose a reason for hiding this comment

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

We can add nasm to the images, thats just fine. The Dockerfile.photon and Dockerfile.ubuntu are only used for testing and not shipped as part of the checksec docker image. Anything added to those 2 images is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will do that. If it will be OK, I will make a new Pull Requests, this is a bit messy.

@teoberi teoberi closed this May 23, 2024
@teoberi teoberi deleted the Fortify_proccheck branch May 23, 2024 16: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