Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clarify arch is the builder and pull go ver from runtime #2

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

06kellyjac
Copy link
Contributor

buildVersion is the Go tree's version string at build time.

https://cs.opensource.google/go/go/+/refs/tags/go1.18.3:src/runtime/extern.go;l=251-266

uname -m still needs to be injected by the build host

make it clear the arch is the builder's arch, not the current system's arch

@mtardy
Copy link
Collaborator

mtardy commented Jun 16, 2022

Thanks 😊! Good idea to clarify and remove the injection of the Go version since the string was already injected in the binary at build time by the compiler! I saw you wanted to create a nix package, if you need a release with some changes tell me!

@mtardy mtardy merged commit 96ccb9d into quarkslab:master Jun 16, 2022
@06kellyjac 06kellyjac deleted the version_tweaks branch June 16, 2022 12:52
@06kellyjac
Copy link
Contributor Author

Yeah it builds just fine, I've packaged it for a while on my NUR but I thought it was about time to migrate it to nixpkgs.

only things were what was already raised in #3 :)

@06kellyjac
Copy link
Contributor Author

As a note this is how you could build a container using nix (once kdigger hits the right channels)

container.nix

{ pkgs ? import <nixpkgs> { system = "x86_64-linux"; } }:

pkgs.dockerTools.buildLayeredImage {
  "kdigger-image";
  tag = "latest";
  contents = [ pkgs.kdigger ];
}

build it with:
nix-build container.nix

load the resulting tar.gz image:
docker load -i ./result

running:
docker run -it kdigger-image kdigger --help

there's also nixery.dev which is very cool, you can just create a pod with nixery.dev/shell/git/hello and have both git and hello available so nixery.dev/shell/kdigger should automatically work in the future but the hosted nixery.dev hasn't updated channels in a while

@mtardy
Copy link
Collaborator

mtardy commented Jun 16, 2022

Thanks a lot for taking the time :)!! I will surely try when your merge request in NixOS/nixpkgs is merged and add these instructions to the readme! It would be truly awesome that nixery.dev/shell/kdigger works! Thanks again!

@06kellyjac
Copy link
Contributor Author

kdigger is in unstable now and will make it to stable some time soon

https://search.nixos.org/packages?channel=unstable&query=kdigger
https://nixpk.gs/pr-tracker.html?pr=177868


λ kdigger --help
zsh: command not found: kdigger

# stable cli
λ nix-shell -p kdigger

[nix-shell:~]$ kdigger --help
kdigger is an extensible CLI tool to dig around when you are in a Kubernetes
cluster. For that you can use multiples buckets. Buckets are plugins that can
scan specific aspects of a cluster or bring expertise to automate the Kubernetes
pentest process.

Usage:
  kdigger [command]

# ...
  -w, --width int       Width for the human output (default 140)

Use "kdigger [command] --help" for more information about a command.

[nix-shell:~]$
exit

# unstable new cli
λ nix shell nixpkgs#kdigger

[nix-shell:~]$ kdigger --help
kdigger is an extensible CLI tool to dig around when you are in a Kubernetes
cluster. For that you can use multiples buckets. Buckets are plugins that can
scan specific aspects of a cluster or bring expertise to automate the Kubernetes
pentest process.

Usage:
  kdigger [command]

# ...
  -w, --width int       Width for the human output (default 140)

Use "kdigger [command] --help" for more information about a command.

Also nixery was updated but its still not on the commit with kdigger on it just yet

https://nixery.dev/#which-revision-of-nixpkgs-is-used-for-the-builds

@mtardy
Copy link
Collaborator

mtardy commented Jul 25, 2022

Thanks again @06kellyjac, being able to build images like this is amazing for POC and stuff: docker run -it nixery.dev/kubectl/kdigger/bash /bin/bash!

@06kellyjac
Copy link
Contributor Author

Glad you like it :D

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants