Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Aug 22, 2023

Changes proposed by this PR

  • Adds a subcommand to allow extracting the default seccomp filter set

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

  • Add a cli sub-command to allow extracting the default seccomp filter set

@drahnr drahnr requested a review from a team as a code owner August 22, 2023 16:17
Copy link
Member

@taylorsilva taylorsilva left a 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."`
Copy link
Member

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.

Copy link
Member

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 {
Copy link
Member

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?

Copy link
Contributor Author

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()
Copy link
Member

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?

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants