Skip to content

Commit

Permalink
Add --disable-ssh-ca-user and --disable-ssh-ca-host flags ...
Browse files Browse the repository at this point in the history
... for provisioner add and update. Only works for GCP IID provisioner
(for now).
  • Loading branch information
dopey committed Oct 28, 2024
1 parent dfb4907 commit 93eb7d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions command/ca/provisioner/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ SCEP
instanceAgeFlag,
disableCustomSANsFlag,
disableTOFUFlag,
disableSSHCAUserFlag,
disableSSHCAHostFlag,

// Claims
x509TemplateFlag,
Expand Down
10 changes: 10 additions & 0 deletions command/ca/provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,16 @@ with the same instance will be accepted. By default only the first request
will be accepted.`,
}

disableSSHCAUserFlag = cli.BoolFlag{
Name: "disable-ssh-ca-user",
Usage: `Disable ability to sign SSH user certificates`,
}

disableSSHCAHostFlag = cli.BoolFlag{
Name: "disable-ssh-ca-host",
Usage: `Disable ability to sign SSH host certificates`,
}

// Nebula provisioner flags
nebulaRootFlag = cli.StringFlag{
Name: "nebula-root",
Expand Down
5 changes: 5 additions & 0 deletions command/ca/provisioner/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ SCEP
instanceAgeFlag,
disableCustomSANsFlag,
disableTOFUFlag,
disableSSHCAUserFlag,
disableSSHCAHostFlag,

// Claims
x509TemplateFlag,
Expand Down Expand Up @@ -917,6 +919,7 @@ func updateGCPDetails(ctx *cli.Context, p *linkedca.Provisioner) error {
}
if ctx.IsSet("disable-ssh-ca-user") {
boolVal := ctx.Bool("disable-ssh-ca-user")
fmt.Printf("boolVal = %+v\n", boolVal)
details.DisableSshCaUser = &boolVal

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / govulncheck / govulncheck

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 923 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)
}
if ctx.IsSet("disable-ssh-ca-host") {
Expand All @@ -935,6 +938,8 @@ func updateGCPDetails(ctx *cli.Context, p *linkedca.Provisioner) error {
if ctx.IsSet("gcp-project") {
details.ProjectIds = append(details.ProjectIds, ctx.StringSlice("gcp-project")...)
}

fmt.Printf("*details.DisableSshCaUser = %+v\n", *details.DisableSshCaUser)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / govulncheck / govulncheck

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser) (typecheck)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (stable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)

Check failure on line 942 in command/ca/provisioner/update.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

details.DisableSshCaUser undefined (type *linkedca.GCPProvisioner has no field or method DisableSshCaUser)
return nil
}

Expand Down

0 comments on commit 93eb7d2

Please sign in to comment.