pcasteran/terraform-graph-beautifier

Prebuilt binaries for darwin don't work

Opened this issue · 3 comments

Hi, I downloaded prebuilt binaries for darwin from GitHub Releases but they don't work on my laptops.

Prebuilt binaries

My laptops

  • macOS 13.6 Apple M1
  • macOS Ventura 13.5.2 Intel Core i5

macOS 13.6 Apple M1

I tried both prebuilt binaries for darwin/amd64 and darwin/arm64.

darwin/arm64

$ ./terraform-graph-beautifier_0.3.3_darwin_arm64.tar.gz/terraform-graph-beautifier --help
zsh: killed      --help

darwin/amd64

$ ./terraform-graph-beautifier_0.3.3_darwin_amd64.tar.gz/terraform-graph-beautifier --help
zsh: segmentation fault   --help

macOS Ventura 13.5.2 Intel Core i5

darwin/amd64

./terraform-graph-beautifier_0.3.3_darwin_amd64.tar.gz/terraform-graph-beautifier --help
zsh: segmentation fault   --help

Prebuilt binary for linux/arm64 works well

On the other hand, the prebuilt binary for linux/arm64 works well on linux/arm64 (lima).

$ ./terraform-graph-beautifier_0.3.3_linux_arm64.tar.gz/terraform-graph-beautifier --help
Usage of /home/shunsukesuzuki.linux/.local/share/aquaproj-aqua/pkgs/github_release/github.com/pcasteran/terraform-graph-beautifier/v0.3.3/terraform-graph-beautifier_0.3.3_linux_arm64.tar.gz/terraform-graph-beautifier:
  -cyto-html-template string
    	Path of the HTML template to use for Cytoscape.js rendering (output-type="cyto-html"), if not set a default one is used
  -debug
    	Print debugging information to stderr
  -embed-modules
    	Embed a module subgraph inside its parent if true; otherwise the two modules are drawn at the same level and an edge is drawn from the parent to the child (default true)
  -exclude value
    	Pattern (regexp) of the resource to filter out (can be repeated multiple times)
  -graph-name string
    	Name of the output graph, defaults to working directory name (default "aqua-registry")
  -input string
    	Path of the input Graphviz file to read, if not set 'stdin' is used
  -keep-tf-junk
    	Do not remove the "junk" nodes and edges generated by 'terraform graph' (default false)
  -output string
    	Path of the output file to write, if not set 'stdout' is used
  -output-type string
    	Type of output, can be one the following : cyto-json, cyto-html, graphviz (default "cyto-html")
  -v	Print command version and exit

So this is the issue of prebuilt binaries for darwin.

Build a binary on my laptop works well

I tried to build terraform-graph-beautifier from source code by go install, then it works well.

$ go install github.com/pcasteran/terraform-graph-beautifier@latest
go: downloading github.com/pcasteran/terraform-graph-beautifier v0.3.3
go: downloading github.com/awalterschulze/gographviz v2.0.3+incompatible

$ ~/go/bin/terraform-graph-beautifier --help
Usage of /Users/shunsukesuzuki/go/bin/terraform-graph-beautifier:
  -cyto-html-template string
    	Path of the HTML template to use for Cytoscape.js rendering (output-type="cyto-html"), if not set a default one is used
  -debug
    	Print debugging information to stderr
  -embed-modules
    	Embed a module subgraph inside its parent if true; otherwise the two modules are drawn at the same level and an edge is drawn from the parent to the child (default true)
  -exclude value
    	Pattern (regexp) of the resource to filter out (can be repeated multiple times)
  -graph-name string
    	Name of the output graph, defaults to working directory name (default "aqua-registry")
  -input string
    	Path of the input Graphviz file to read, if not set 'stdin' is used
  -keep-tf-junk
    	Do not remove the "junk" nodes and edges generated by 'terraform graph' (default false)
  -output string
    	Path of the output file to write, if not set 'stdout' is used
  -output-type string
    	Type of output, can be one the following : cyto-json, cyto-html, graphviz (default "cyto-html")
  -v	Print command version and exit

v0.3.2 has the same issue.

darwin/arm64

$ ./terraform-graph-beautifier_0.3.2_darwin_arm64.tar.gz/terraform-graph-beautifier
zsh: killed     terraform-graph-beautifier --help

Hmm. The prebuilt binary for darwin/amd64 works on GitHub Actions macos-latest.

---
name: test terraform-graph-beautifier on darwin
on: pull_request
jobs:
  test:
    runs-on: macos-latest
    steps:
      - run: curl -LqO https://github.com/pcasteran/terraform-graph-beautifier/releases/download/v0.3.3/terraform-graph-beautifier_0.3.3_darwin_amd64.tar.gz
      - run: tar xvzf terraform-graph-beautifier_0.3.3_darwin_amd64.tar.gz
      - run: ls
      - run: ./terraform-graph-beautifier --help
Current runner version: '2.309.0'
Operating System
  macOS
  1[2](https://github.com/suzuki-shunsuke/test-github-action/actions/runs/6413318506/job/17412051232?pr=174#step:1:2).7
  21G816
Runner Image
  Image: macos-12
  Version: 202[3](https://github.com/suzuki-shunsuke/test-github-action/actions/runs/6413318506/job/17412051232?pr=174#step:1:3)0921.[4](https://github.com/suzuki-shunsuke/test-github-action/actions/runs/6413318506/job/17412051232?pr=174#step:1:4)
  Included Software: https://github.com/actions/runner-images/blob/macOS-12/20230[9](https://github.com/suzuki-shunsuke/test-github-action/actions/runs/6413318506/job/17412051232?pr=174#step:1:10)21.4/images/macos/macos-12-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20230921.4
Runner Image Provisioner
  2.0.3[10](https://github.com/suzuki-shunsuke/test-github-action/actions/runs/6413318506/job/17412051232?pr=174#step:1:11).1

Same issue here, MacOS 13.5.1, SentinelOne detects the binary as malicious and mitigates the risk by killing it.