twtiger / gosecco

Go seccomp parser and compiler
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Include policy file in another and combine prior to compilation #37

Closed dma closed 8 years ago

dma commented 8 years ago

Is there a way to include the contents of a file in a policy?

For example, this file: https://github.com/twtiger/gosecco/blob/master/profiles/shared.seccomp

Could be shared between multiple application whitelists.

I could have sworn this capability existed in gosecco, but I can't find it. Did I dream this or something?

chelseakomlo commented 8 years ago

You definitely did not dream this!

@olabini can expand more on this, but applying variables/constants/macros from a separate file into a policy file is done here:

https://github.com/twtiger/gosecco/blob/master/seccomp.go#L41

Which is used here:

https://github.com/twtiger/gosecco/blob/master/seccomp.go#L67

dma commented 8 years ago

Ah yes, now I remember, it's in the configuration object where you specify 'includes' and not as a directive in the policy file itself. Thanks, and sorry for the noise!

chelseakomlo commented 8 years ago

No worries. We can specify this better in the documentation as well.