diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c066f2f0..a63e9764 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,17 +19,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Build txt-suite - run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o txt-suite cmd/txt-suite/*.go + run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o txt-suite cmd/core/txt-suite/*.go - name: Build txt-prov - run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o txt-prov cmd/txt-prov/*.go + run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o txt-prov cmd/core/txt-prov/*.go - name: Build bg-suite - run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o bg-suite cmd/bg-suite/*.go + run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o bg-suite cmd/core/bg-suite/*.go - name: Build bg-prov - run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o bg-prov cmd/bg-prov/*.go + run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o bg-prov cmd/core/bg-prov/*.go - name: Build pcr0tool - run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o pcr0tool cmd/pcr0tool/*.go + run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o pcr0tool cmd/exp/pcr0tool/*.go - name: Build amd-suite - run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o amd-suite cmd/amd-suite/*.go + run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o amd-suite cmd/exp/amd-suite/*.go - name: Save artifacts uses: actions/upload-artifact@v4 with: diff --git a/cmd/bg-prov/README.md b/cmd/core/bg-prov/README.md similarity index 100% rename from cmd/bg-prov/README.md rename to cmd/core/bg-prov/README.md diff --git a/cmd/bg-prov/cmd.go b/cmd/core/bg-prov/cmd.go similarity index 100% rename from cmd/bg-prov/cmd.go rename to cmd/core/bg-prov/cmd.go diff --git a/cmd/bg-prov/main.go b/cmd/core/bg-prov/main.go similarity index 100% rename from cmd/bg-prov/main.go rename to cmd/core/bg-prov/main.go diff --git a/cmd/bg-suite/README.md b/cmd/core/bg-suite/README.md similarity index 100% rename from cmd/bg-suite/README.md rename to cmd/core/bg-suite/README.md diff --git a/cmd/bg-suite/TESTPLAN.md b/cmd/core/bg-suite/TESTPLAN.md similarity index 100% rename from cmd/bg-suite/TESTPLAN.md rename to cmd/core/bg-suite/TESTPLAN.md diff --git a/cmd/bg-suite/cmd.go b/cmd/core/bg-suite/cmd.go similarity index 100% rename from cmd/bg-suite/cmd.go rename to cmd/core/bg-suite/cmd.go diff --git a/cmd/bg-suite/main.go b/cmd/core/bg-suite/main.go similarity index 100% rename from cmd/bg-suite/main.go rename to cmd/core/bg-suite/main.go diff --git a/cmd/txt-prov/README.md b/cmd/core/txt-prov/README.md similarity index 100% rename from cmd/txt-prov/README.md rename to cmd/core/txt-prov/README.md diff --git a/cmd/txt-prov/cmd.go b/cmd/core/txt-prov/cmd.go similarity index 100% rename from cmd/txt-prov/cmd.go rename to cmd/core/txt-prov/cmd.go diff --git a/cmd/txt-prov/config.go b/cmd/core/txt-prov/config.go similarity index 100% rename from cmd/txt-prov/config.go rename to cmd/core/txt-prov/config.go diff --git a/cmd/txt-prov/lcp.json b/cmd/core/txt-prov/lcp.json similarity index 100% rename from cmd/txt-prov/lcp.json rename to cmd/core/txt-prov/lcp.json diff --git a/cmd/txt-prov/main.go b/cmd/core/txt-prov/main.go similarity index 100% rename from cmd/txt-prov/main.go rename to cmd/core/txt-prov/main.go diff --git a/cmd/txt-prov/tools.go b/cmd/core/txt-prov/tools.go similarity index 100% rename from cmd/txt-prov/tools.go rename to cmd/core/txt-prov/tools.go diff --git a/cmd/txt-suite/README.md b/cmd/core/txt-suite/README.md similarity index 100% rename from cmd/txt-suite/README.md rename to cmd/core/txt-suite/README.md diff --git a/cmd/txt-suite/TESTPLAN.md b/cmd/core/txt-suite/TESTPLAN.md similarity index 100% rename from cmd/txt-suite/TESTPLAN.md rename to cmd/core/txt-suite/TESTPLAN.md diff --git a/cmd/txt-suite/cmd.go b/cmd/core/txt-suite/cmd.go similarity index 100% rename from cmd/txt-suite/cmd.go rename to cmd/core/txt-suite/cmd.go diff --git a/cmd/txt-suite/main.go b/cmd/core/txt-suite/main.go similarity index 100% rename from cmd/txt-suite/main.go rename to cmd/core/txt-suite/main.go diff --git a/cmd/amd-suite/cmd.go b/cmd/exp/amd-suite/cmd.go similarity index 100% rename from cmd/amd-suite/cmd.go rename to cmd/exp/amd-suite/cmd.go diff --git a/cmd/amd-suite/main.go b/cmd/exp/amd-suite/main.go similarity index 100% rename from cmd/amd-suite/main.go rename to cmd/exp/amd-suite/main.go diff --git a/cmd/amd-suite/parse_amd_firmware_file.go b/cmd/exp/amd-suite/parse_amd_firmware_file.go similarity index 100% rename from cmd/amd-suite/parse_amd_firmware_file.go rename to cmd/exp/amd-suite/parse_amd_firmware_file.go diff --git a/cmd/pcr0tool/README.md b/cmd/exp/pcr0tool/README.md similarity index 100% rename from cmd/pcr0tool/README.md rename to cmd/exp/pcr0tool/README.md diff --git a/cmd/pcr0tool/commands/bruteforce_acm_policy_status/command.go b/cmd/exp/pcr0tool/commands/bruteforce_acm_policy_status/command.go similarity index 97% rename from cmd/pcr0tool/commands/bruteforce_acm_policy_status/command.go rename to cmd/exp/pcr0tool/commands/bruteforce_acm_policy_status/command.go index 8c0f92f7..cd1052bf 100644 --- a/cmd/pcr0tool/commands/bruteforce_acm_policy_status/command.go +++ b/cmd/exp/pcr0tool/commands/bruteforce_acm_policy_status/command.go @@ -11,8 +11,8 @@ import ( "hash" "os" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/dumpregisters/helpers" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/dumpregisters/helpers" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/actions/tpmactions" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/bootengine" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/datasources" diff --git a/cmd/pcr0tool/commands/command.go b/cmd/exp/pcr0tool/commands/command.go similarity index 100% rename from cmd/pcr0tool/commands/command.go rename to cmd/exp/pcr0tool/commands/command.go diff --git a/cmd/pcr0tool/commands/common.go b/cmd/exp/pcr0tool/commands/common.go similarity index 100% rename from cmd/pcr0tool/commands/common.go rename to cmd/exp/pcr0tool/commands/common.go diff --git a/cmd/pcr0tool/commands/diff/command.go b/cmd/exp/pcr0tool/commands/diff/command.go similarity index 97% rename from cmd/pcr0tool/commands/diff/command.go rename to cmd/exp/pcr0tool/commands/diff/command.go index a28a9bfa..b31f3b5f 100644 --- a/cmd/pcr0tool/commands/diff/command.go +++ b/cmd/exp/pcr0tool/commands/diff/command.go @@ -16,9 +16,9 @@ import ( pkgbytes "github.com/linuxboot/fiano/pkg/bytes" fianoUEFI "github.com/linuxboot/fiano/pkg/uefi" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/diff/format" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/dumpregisters/helpers" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/diff/format" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/dumpregisters/helpers" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/bootengine" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/flows" bfformat "github.com/9elements/converged-security-suite/v2/pkg/bootflow/lib/format" diff --git a/cmd/pcr0tool/commands/diff/format/format.go b/cmd/exp/pcr0tool/commands/diff/format/format.go similarity index 100% rename from cmd/pcr0tool/commands/diff/format/format.go rename to cmd/exp/pcr0tool/commands/diff/format/format.go diff --git a/cmd/pcr0tool/commands/displayeventlog/command.go b/cmd/exp/pcr0tool/commands/displayeventlog/command.go similarity index 96% rename from cmd/pcr0tool/commands/displayeventlog/command.go rename to cmd/exp/pcr0tool/commands/displayeventlog/command.go index a0276a7e..591455a1 100644 --- a/cmd/pcr0tool/commands/displayeventlog/command.go +++ b/cmd/exp/pcr0tool/commands/displayeventlog/command.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/displayeventlog/format" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/displayeventlog/format" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/subsystems/trustchains/tpm/pcr" "github.com/9elements/converged-security-suite/v2/pkg/tpmeventlog" ) diff --git a/cmd/pcr0tool/commands/displayeventlog/flag_format.go b/cmd/exp/pcr0tool/commands/displayeventlog/flag_format.go similarity index 100% rename from cmd/pcr0tool/commands/displayeventlog/flag_format.go rename to cmd/exp/pcr0tool/commands/displayeventlog/flag_format.go diff --git a/cmd/pcr0tool/commands/displayeventlog/format/event_log.go b/cmd/exp/pcr0tool/commands/displayeventlog/format/event_log.go similarity index 100% rename from cmd/pcr0tool/commands/displayeventlog/format/event_log.go rename to cmd/exp/pcr0tool/commands/displayeventlog/format/event_log.go diff --git a/cmd/pcr0tool/commands/displayfwinfo/command.go b/cmd/exp/pcr0tool/commands/displayfwinfo/command.go similarity index 100% rename from cmd/pcr0tool/commands/displayfwinfo/command.go rename to cmd/exp/pcr0tool/commands/displayfwinfo/command.go diff --git a/cmd/pcr0tool/commands/dumpfit/command.go b/cmd/exp/pcr0tool/commands/dumpfit/command.go similarity index 100% rename from cmd/pcr0tool/commands/dumpfit/command.go rename to cmd/exp/pcr0tool/commands/dumpfit/command.go diff --git a/cmd/pcr0tool/commands/dumpregisters/command.go b/cmd/exp/pcr0tool/commands/dumpregisters/command.go similarity index 93% rename from cmd/pcr0tool/commands/dumpregisters/command.go rename to cmd/exp/pcr0tool/commands/dumpregisters/command.go index b395dac5..e68001b7 100644 --- a/cmd/pcr0tool/commands/dumpregisters/command.go +++ b/cmd/exp/pcr0tool/commands/dumpregisters/command.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/dumpregisters/helpers" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/dumpregisters/helpers" "github.com/9elements/converged-security-suite/v2/pkg/registers" "gopkg.in/yaml.v3" @@ -70,7 +70,7 @@ func (cmd Command) Execute(ctx context.Context, args []string) { if err != nil { panic(fmt.Sprintf("failed to marshal registers into json, err: %v", err)) } - err = os.WriteFile(*cmd.outputFile, b, 0666) + err = os.WriteFile(*cmd.outputFile, b, 0o666) if err != nil { panic(fmt.Sprintf("failed to write data to file %s, err: %v", *cmd.outputFile, err)) } diff --git a/cmd/pcr0tool/commands/dumpregisters/helpers/flag_registers.go b/cmd/exp/pcr0tool/commands/dumpregisters/helpers/flag_registers.go similarity index 100% rename from cmd/pcr0tool/commands/dumpregisters/helpers/flag_registers.go rename to cmd/exp/pcr0tool/commands/dumpregisters/helpers/flag_registers.go diff --git a/cmd/pcr0tool/commands/dumpregisters/helpers/get_registers.go b/cmd/exp/pcr0tool/commands/dumpregisters/helpers/get_registers.go similarity index 100% rename from cmd/pcr0tool/commands/dumpregisters/helpers/get_registers.go rename to cmd/exp/pcr0tool/commands/dumpregisters/helpers/get_registers.go diff --git a/cmd/pcr0tool/commands/dumpregisters/helpers/print_registers.go b/cmd/exp/pcr0tool/commands/dumpregisters/helpers/print_registers.go similarity index 100% rename from cmd/pcr0tool/commands/dumpregisters/helpers/print_registers.go rename to cmd/exp/pcr0tool/commands/dumpregisters/helpers/print_registers.go diff --git a/cmd/pcr0tool/commands/pcrread/command.go b/cmd/exp/pcr0tool/commands/pcrread/command.go similarity index 100% rename from cmd/pcr0tool/commands/pcrread/command.go rename to cmd/exp/pcr0tool/commands/pcrread/command.go diff --git a/cmd/pcr0tool/commands/printnodes/command.go b/cmd/exp/pcr0tool/commands/printnodes/command.go similarity index 100% rename from cmd/pcr0tool/commands/printnodes/command.go rename to cmd/exp/pcr0tool/commands/printnodes/command.go diff --git a/cmd/pcr0tool/commands/sum/command.go b/cmd/exp/pcr0tool/commands/sum/command.go similarity index 98% rename from cmd/pcr0tool/commands/sum/command.go rename to cmd/exp/pcr0tool/commands/sum/command.go index 85e88018..b24f7790 100644 --- a/cmd/pcr0tool/commands/sum/command.go +++ b/cmd/exp/pcr0tool/commands/sum/command.go @@ -10,8 +10,8 @@ import ( "os" "strings" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/dumpregisters/helpers" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/dumpregisters/helpers" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/bootengine" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/flows" "github.com/9elements/converged-security-suite/v2/pkg/bootflow/lib/format" diff --git a/cmd/pcr0tool/commands/validate_security/inject_benign_corruption.go b/cmd/exp/pcr0tool/commands/validate_security/inject_benign_corruption.go similarity index 100% rename from cmd/pcr0tool/commands/validate_security/inject_benign_corruption.go rename to cmd/exp/pcr0tool/commands/validate_security/inject_benign_corruption.go diff --git a/cmd/pcr0tool/commands/validate_security/main.go b/cmd/exp/pcr0tool/commands/validate_security/main.go similarity index 100% rename from cmd/pcr0tool/commands/validate_security/main.go rename to cmd/exp/pcr0tool/commands/validate_security/main.go diff --git a/cmd/pcr0tool/main.go b/cmd/exp/pcr0tool/main.go similarity index 77% rename from cmd/pcr0tool/main.go rename to cmd/exp/pcr0tool/main.go index 2228ebf6..2b6ef4ea 100644 --- a/cmd/pcr0tool/main.go +++ b/cmd/exp/pcr0tool/main.go @@ -7,17 +7,17 @@ import ( "os" "sort" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands" - bruteforceacmpolicystatus "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/bruteforce_acm_policy_status" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/diff" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/displayeventlog" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/displayfwinfo" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/dumpfit" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/dumpregisters" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/pcrread" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/printnodes" - "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/sum" - validatesecurity "github.com/9elements/converged-security-suite/v2/cmd/pcr0tool/commands/validate_security" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands" + bruteforceacmpolicystatus "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/bruteforce_acm_policy_status" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/diff" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/displayeventlog" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/displayfwinfo" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/dumpfit" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/dumpregisters" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/pcrread" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/printnodes" + "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/sum" + validatesecurity "github.com/9elements/converged-security-suite/v2/cmd/exp/pcr0tool/commands/validate_security" "github.com/9elements/converged-security-suite/v2/pkg/log" "github.com/facebookincubator/go-belt/tool/logger" "github.com/facebookincubator/go-belt/tool/logger/implementation/logrus"