openappsec icon indicating copy to clipboard operation
openappsec copied to clipboard

ARM64 Support

Open ccben87 opened this issue 3 years ago • 16 comments

Hi,

I'm looking to use your application but I run exclusively ARM64. I've tried to run it in Kubernetes and I get the following error: exec /cp-nano-agent: exec format error

I'm very familiar with this sort of error and immediately realise it's because an AMD64 image is being used rather than ARM64. I'm looking into a way to compile this myself but am unsure on how to do this.

ccben87 avatar Apr 04 '23 08:04 ccben87

Hi, 

supporting ARM is part of the roadmap and will hopefully be officially supported later this year. In the meantime, we're looking for a solution so you can run open-appsec. We'll keep you posted if we have any news.

orianelou avatar Apr 04 '23 14:04 orianelou

Hi,

I don't suppose there has been any progress on this front? You spoke of perhaps a way to have a solution to run this on ARM64 prior to official support? I'm very keen on this and not having this is holding me back on my deployment currently. I'm happy to do any compiling if required.

ccben87 avatar Jun 21 '23 05:06 ccben87

Hi @ccben87,

While official support in ARM64, which will require us to provide compatible artifacts, isn't something that I have an ETA for. There is nothing that prevents the code from being compiled to ARM64. If you want compile your own artifacts to ARM64 I'll be happy to assist you with that.

WrightNed avatar Jun 21 '23 20:06 WrightNed

I can't find the source that was used to build the container ghcr.io/openappsec/kong-gateway-attachment so that I can build it in ARM64. Could you please point me in the right direction for this? I'd like to ideally use Kong/Kong Ingress Controller on Kubernetes. In the meantime, I'll look at using Ingress NGINX instead and might need some assistance with that too potentially.

ccben87 avatar Jun 22 '23 08:06 ccben87

I'm having trouble compiling the attachment container. I get the below error:

./configure: error: can not detect int size

I'm not really sure why it downloads NGINX source code and I don't really understand how the attachment container is meant to work.

I'm building on Ubuntu Jammy.

ccben87 avatar Jun 22 '23 09:06 ccben87

Hi @ccben87,

You can find instructions for compilation instructions here. Could you please let me know at what stage of the compilation and installation did you get the attached error? Also, did you follow the instructions for "Compiling and creating a Docker Image" or for "Compiling for an existing Nginx server"? Thanks!

orianelou avatar Jun 22 '23 10:06 orianelou

Ahh, I see my mistake. I missed the bit where it said I needed to compile in Alpine! The compile for attachment worked. Could you please advise how I can go about getting the source files so I can compile an ARM64 version of ghcr.io/openappsec/kong-gateway-attachment ? I'd much prefer to use Kong Gateway and Kong Ingress Controller with openappsec

ccben87 avatar Jun 22 '23 12:06 ccben87

Unfortunately, the script that automatically extracts the version from a docker image doesn't support doing so from a kong image yet. So at the moment it needs to be done by hand.

First get the NGINX configuration from the image: docker run -it kong:latest /usr/local/openresty/nginx/sbin/nginx -V &> /tmp/nginx.ver

Then you can configure the compilation to build an attachment based on that configuration: ./attachments/nginx/ngx_module/nginx_version_configuration.sh --conf /tmp/nginx.ver build_out

After that make install should build for you the attachment you want.

WrightNed avatar Jun 22 '23 18:06 WrightNed

Hi all,

I will try Kong later as I think I'll want that in a different cluster at a later date. In the meantime, with my NGINX Ingress build attempts, I've managed to compile it to ARM64 without issue. The issue I mentioned before was an issue on my end so I deleted my posts below. Still need to test it properly but looks to be working.

ccben87 avatar Jun 23 '23 05:06 ccben87

Glad to hear it! There are come additional complication with working in Kong (specifically in regard to how it manages the NGINX), so we'll be happy to try and help when you get there.

WrightNed avatar Jun 26 '23 15:06 WrightNed

Okay so when running it with nginx ingress, I get the error "Cannot install x86 installation package on a non compatible host"

ccben87 avatar Jun 28 '23 04:06 ccben87

Hi @ccben87, Could you please share the steps that led to the error? As we need some more information to recreate this.

Thanks, and I appreciate your patience with the deployment!

orianelou avatar Jun 28 '23 14:06 orianelou

Hi, Any luck installation for linux/arm64/v8 ?

rasulovk avatar Nov 19 '23 17:11 rasulovk

Is there an update on ARM compatibility?

peaklabs-dev avatar Dec 17 '23 21:12 peaklabs-dev

hello, I know you cannot support for arm64 but I thought it's possible compile it. I can do all stepts but the last (make package) fails #93 . The problem is make package uses some librarys/tools from x86 platform. I don't know if there is some workaround.

Regards

lockevod avatar Jan 17 '24 14:01 lockevod

compiled on ARM64 Ubuntu 24, with:

sudo apt update

sudo apt install -y libboost-dev libssl-dev libpcre2-dev \
  libxml2-dev libgtest-dev libcurl4-openssl-dev \
  libhiredis-dev redis libmaxminddb-dev yq cmake \
  build-essential zlib1g-dev libgmock-dev \
  libboost-regex-dev libboost-context-dev \
  libboost-filesystem-dev 

using a fresh c7g.xlarge on AWS with 16GB disk. Took ~ 40 minutes

neilmcguigan avatar Aug 20 '24 23:08 neilmcguigan