From d395dbee943550a1b637e3b7551c9d166620cea6 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Sat, 12 Aug 2023 13:54:11 +0200 Subject: [PATCH] ssm-agent: 3.0.755.0 -> 3.2.1297.0 Release notes: https://github.com/aws/amazon-ssm-agent/blob/3.2.1297.0/RELEASENOTES.md Fixes #226907 --- .../networking/cluster/ssm-agent/default.nix | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index baf85847875c..5a0dc0d2d97e 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -3,7 +3,6 @@ , buildGoPackage , makeWrapper , fetchFromGitHub -, fetchpatch , coreutils , nettools , dmidecode @@ -28,7 +27,7 @@ let in buildGoPackage rec { pname = "amazon-ssm-agent"; - version = "3.0.755.0"; + version = "3.2.1297.0"; goPackagePath = "github.com/aws/${pname}"; @@ -38,7 +37,7 @@ buildGoPackage rec { rev = version; owner = "aws"; repo = "amazon-ssm-agent"; - hash = "sha256-yVQJL1MJ1JlAndlrXfEbNLQihlbLhSoQXTKzJMRzhao="; + hash = "sha256-zRs7RsShZPH3hb5MsADUNrTfHbJVwCELE9mCqEWaTng="; }; patches = [ @@ -48,16 +47,25 @@ buildGoPackage rec { # They used constants from another package that I couldn't figure # out how to resolve, so hardcoded the constants. ./0002-version-gen-don-t-use-unnecessary-constants.patch + ]; - (fetchpatch { - name = "CVE-2022-29527.patch"; - url = "https://github.com/aws/amazon-ssm-agent/commit/0fe8ae99b2ff25649c7b86d3bc05fc037400aca7.patch"; - sha256 = "sha256-5g14CxhsHLIgs1Vkfw8FCKEJ4AebNqZKf3ZzoAN/T9U="; - }) + # See the list https://github.com/aws/amazon-ssm-agent/blob/3.2.1297.0/makefile#L120-L138 + # The updater is not built because it cannot work on NixOS + subPackages = [ + "core" + "agent" + "agent/cli-main" + "agent/framework/processor/executer/outofproc/worker" + "agent/session/logging" + "agent/framework/processor/executer/outofproc/sessionworker" + ]; + + ldflags = [ + "-s" + "-w" ]; preConfigure = '' - rm -r ./Tools/src/goreportcard printf "#!/bin/sh\ntrue" > ./Tools/src/checkstyle.sh substituteInPlace agent/platform/platform_unix.go \ @@ -78,8 +86,6 @@ buildGoPackage rec { ''; preBuild = '' - cp -r go/src/${goPackagePath}/vendor/src go - pushd go/src/${goPackagePath} # Note: if this step fails, please patch the code to fix it! Please only skip @@ -95,8 +101,6 @@ buildGoPackage rec { postBuild = '' pushd go/bin - rm integration-cli versiongenerator generator - mv core amazon-ssm-agent mv agent ssm-agent-worker mv cli-main ssm-cli