New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/cli: allow to extract the default seccomp profile #8800
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Bernhard Schuster <bernhard@ahoi.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty low-stakes PR, but implementation is a bit hacky. Can see some bits were copied and the whole thing was quickly put together. If this PR gets cleaned up I don't mind merging it in.
@@ -74,3 +78,27 @@ func (cmd *GenerateKeyCommand) Execute(args []string) error { | |||
|
|||
return nil | |||
} | |||
|
|||
type ExtractInternalConfigCommand struct { | |||
FilePath string `short:"f" long:"filename" required:"true" description:"File path where the key shall be created. When generating ssh keys, the public key will be stored in a file with the same name but with '.pub' appended."` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description
here appears to not be updated. It talks about ssh keys but it looks like it's actually the destination you want the seccomp profile written to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change the longname
to something else to, like output-file
.
@@ -74,3 +78,27 @@ func (cmd *GenerateKeyCommand) Execute(args []string) error { | |||
|
|||
return nil | |||
} | |||
|
|||
type ExtractInternalConfigCommand struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels weird having this sub-command in this file. Would make more sense to have it in its own file. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
func (cmd *ExtractInternalConfigCommand) Execute(args []string) error { | ||
var dest = cmd.FilePath | ||
if cmd.Seccomp { | ||
seccompfilter := bespec.GetDefaultSeccompProfile() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the whole point of this command is to print the seccomp
variable from https://github.com/concourse/concourse/blob/master/worker/runtime/spec/seccomp.go in json format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because that's what then could be modified and re-used as baseline for custom trim down or extension based on use case and re-supplied to the containerd runner
Changes proposed by this PR
Notes to reviewer
The main use-case is to extend/modify/limit these based on requirements, but provide them as a reasonable baseline for custom modifications. Prime use case is performance counters.
Release Note