This repository was archived by the owner on Aug 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +188
-2
lines changed Expand file tree Collapse file tree 2 files changed +188
-2
lines changed Original file line number Diff line number Diff line change 317317 " signalfd" ,
318318 " signalfd4" ,
319319 " sigreturn" ,
320- " socket" ,
321320 " socketcall" ,
322321 " socketpair" ,
323322 " splice" ,
769768 ]
770769 },
771770 "excludes" : {}
771+ },
772+ {
773+ "names" : [
774+ " socket"
775+ ],
776+ "action" : " SCMP_ACT_ERRNO" ,
777+ "args" : [
778+ {
779+ "index" : 0 ,
780+ "value" : 16 ,
781+ "valueTwo" : 0 ,
782+ "op" : " SCMP_CMP_EQ"
783+ },
784+ {
785+ "index" : 2 ,
786+ "value" : 9 ,
787+ "valueTwo" : 0 ,
788+ "op" : " SCMP_CMP_EQ"
789+ }
790+ ],
791+ "comment" : " " ,
792+ "includes" : {},
793+ "excludes" : {
794+ "caps" : [
795+ " CAP_AUDIT_WRITE"
796+ ]
797+ },
798+ "errnoRet" : 22
799+ },
800+ {
801+ "names" : [
802+ " socket"
803+ ],
804+ "action" : " SCMP_ACT_ALLOW" ,
805+ "args" : [
806+ {
807+ "index" : 2 ,
808+ "value" : 9 ,
809+ "valueTwo" : 0 ,
810+ "op" : " SCMP_CMP_NE"
811+ }
812+ ],
813+ "comment" : " " ,
814+ "includes" : {},
815+ "excludes" : {
816+ "caps" : [
817+ " CAP_AUDIT_WRITE"
818+ ]
819+ }
820+ },
821+ {
822+ "names" : [
823+ " socket"
824+ ],
825+ "action" : " SCMP_ACT_ALLOW" ,
826+ "args" : [
827+ {
828+ "index" : 0 ,
829+ "value" : 16 ,
830+ "valueTwo" : 0 ,
831+ "op" : " SCMP_CMP_NE"
832+ }
833+ ],
834+ "comment" : " " ,
835+ "includes" : {},
836+ "excludes" : {
837+ "caps" : [
838+ " CAP_AUDIT_WRITE"
839+ ]
840+ }
841+ },
842+ {
843+ "names" : [
844+ " socket"
845+ ],
846+ "action" : " SCMP_ACT_ALLOW" ,
847+ "args" : [
848+ {
849+ "index" : 2 ,
850+ "value" : 9 ,
851+ "valueTwo" : 0 ,
852+ "op" : " SCMP_CMP_NE"
853+ }
854+ ],
855+ "comment" : " " ,
856+ "includes" : {},
857+ "excludes" : {
858+ "caps" : [
859+ " CAP_AUDIT_WRITE"
860+ ]
861+ }
862+ },
863+ {
864+ "names" : [
865+ " socket"
866+ ],
867+ "action" : " SCMP_ACT_ALLOW" ,
868+ "args" : null ,
869+ "comment" : " " ,
870+ "includes" : {
871+ "caps" : [
872+ " CAP_AUDIT_WRITE"
873+ ]
874+ },
875+ "excludes" : {}
772876 }
773877 ]
774878}
Original file line number Diff line number Diff line change 77package seccomp // import "github.com/seccomp/containers-golang"
88
99import (
10+ "syscall"
11+
1012 "golang.org/x/sys/unix"
1113)
1214
@@ -45,6 +47,8 @@ func arches() []Architecture {
4547
4648// DefaultProfile defines the whitelist for the default seccomp profile.
4749func DefaultProfile () * Seccomp {
50+ einval := uint (syscall .EINVAL )
51+
4852 syscalls := []* Syscall {
4953 {
5054 Names : []string {
@@ -313,7 +317,6 @@ func DefaultProfile() *Seccomp {
313317 "signalfd" ,
314318 "signalfd4" ,
315319 "sigreturn" ,
316- "socket" ,
317320 "socketcall" ,
318321 "socketpair" ,
319322 "splice" ,
@@ -652,6 +655,85 @@ func DefaultProfile() *Seccomp {
652655 Caps : []string {"CAP_SYS_TTY_CONFIG" },
653656 },
654657 },
658+ {
659+ Names : []string {
660+ "socket" ,
661+ },
662+ Action : ActErrno ,
663+ ErrnoRet : & einval ,
664+ Args : []* Arg {
665+ {
666+ Index : 0 ,
667+ Value : syscall .AF_NETLINK ,
668+ Op : OpEqualTo ,
669+ },
670+ {
671+ Index : 2 ,
672+ Value : syscall .NETLINK_AUDIT ,
673+ Op : OpEqualTo ,
674+ },
675+ },
676+ Excludes : Filter {
677+ Caps : []string {"CAP_AUDIT_WRITE" },
678+ },
679+ },
680+ {
681+ Names : []string {
682+ "socket" ,
683+ },
684+ Action : ActAllow ,
685+ Args : []* Arg {
686+ {
687+ Index : 2 ,
688+ Value : syscall .NETLINK_AUDIT ,
689+ Op : OpNotEqual ,
690+ },
691+ },
692+ Excludes : Filter {
693+ Caps : []string {"CAP_AUDIT_WRITE" },
694+ },
695+ },
696+ {
697+ Names : []string {
698+ "socket" ,
699+ },
700+ Action : ActAllow ,
701+ Args : []* Arg {
702+ {
703+ Index : 0 ,
704+ Value : syscall .AF_NETLINK ,
705+ Op : OpNotEqual ,
706+ },
707+ },
708+ Excludes : Filter {
709+ Caps : []string {"CAP_AUDIT_WRITE" },
710+ },
711+ },
712+ {
713+ Names : []string {
714+ "socket" ,
715+ },
716+ Action : ActAllow ,
717+ Args : []* Arg {
718+ {
719+ Index : 2 ,
720+ Value : syscall .NETLINK_AUDIT ,
721+ Op : OpNotEqual ,
722+ },
723+ },
724+ Excludes : Filter {
725+ Caps : []string {"CAP_AUDIT_WRITE" },
726+ },
727+ },
728+ {
729+ Names : []string {
730+ "socket" ,
731+ },
732+ Action : ActAllow ,
733+ Includes : Filter {
734+ Caps : []string {"CAP_AUDIT_WRITE" },
735+ },
736+ },
655737 }
656738
657739 return & Seccomp {
You can’t perform that action at this time.
0 commit comments