Repository: aporeto-inc/trireme Branch: master Commit: e77251373ca9 Files: 549 Total size: 3.9 MB Directory structure: gitextract_oai4eol3/ ├── .github/ │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .lint.windows.sh ├── .test.sh ├── .test.windows.sh ├── .travis.yml ├── CONTRIBUTING.md ├── Gopkg.toml ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── buildflags/ │ ├── buildflags.go │ └── buildflags_rhel.go ├── cmd/ │ └── systemdutil/ │ ├── exec.go │ ├── exec_windows.go │ └── systemdutil.go ├── collector/ │ ├── default.go │ ├── default_test.go │ ├── interfaces.go │ └── mockcollector/ │ └── mockcollector.go ├── common/ │ ├── events.go │ ├── hooks.go │ ├── oauthtokens.go │ └── service.go ├── controller/ │ ├── config.go │ ├── config_nonwindows.go │ ├── config_windows.go │ ├── constants/ │ │ ├── constants.go │ │ ├── constants_nonrhel6.go │ │ ├── constants_rhel6.go │ │ └── constants_test.go │ ├── controller.go │ ├── helpers.go │ ├── interfaces.go │ ├── internal/ │ │ ├── enforcer/ │ │ │ ├── acls/ │ │ │ │ ├── acl.go │ │ │ │ ├── acl_test.go │ │ │ │ ├── aclcache.go │ │ │ │ ├── aclcache_test.go │ │ │ │ ├── icmpacl.go │ │ │ │ ├── ports.go │ │ │ │ ├── ports_test.go │ │ │ │ ├── utils.go │ │ │ │ └── utils_test.go │ │ │ ├── apiauth/ │ │ │ │ ├── apiauth.go │ │ │ │ ├── apiauth_test.go │ │ │ │ └── types.go │ │ │ ├── applicationproxy/ │ │ │ │ ├── applicationproxy.go │ │ │ │ ├── common/ │ │ │ │ │ └── common.go │ │ │ │ ├── http/ │ │ │ │ │ ├── error_handler.go │ │ │ │ │ ├── http.go │ │ │ │ │ ├── ping_http.go │ │ │ │ │ └── transport.go │ │ │ │ ├── markedconn/ │ │ │ │ │ ├── mark_linux.go │ │ │ │ │ ├── mark_windows.go │ │ │ │ │ ├── markedconn.go │ │ │ │ │ ├── markedconn_darwin.go │ │ │ │ │ ├── markedconn_test.go │ │ │ │ │ ├── markedconn_windows_test.go │ │ │ │ │ ├── origdest_linux.go │ │ │ │ │ ├── origdest_windows.go │ │ │ │ │ ├── platformdata.go │ │ │ │ │ ├── platformdata_test.go │ │ │ │ │ └── platformdata_windows.go │ │ │ │ ├── pingrequest/ │ │ │ │ │ └── pingrequest.go │ │ │ │ ├── protomux/ │ │ │ │ │ ├── protomux.go │ │ │ │ │ └── protomux_test.go │ │ │ │ ├── servicecache/ │ │ │ │ │ ├── servicecache.go │ │ │ │ │ └── servicecache_test.go │ │ │ │ ├── serviceregistry/ │ │ │ │ │ ├── serviceregistry.go │ │ │ │ │ └── serviceregistry_test.go │ │ │ │ ├── tcp/ │ │ │ │ │ ├── lookup.go │ │ │ │ │ ├── ping_tcp.go │ │ │ │ │ ├── tcp.go │ │ │ │ │ ├── tcp_test.go │ │ │ │ │ └── verifier/ │ │ │ │ │ ├── testdata/ │ │ │ │ │ │ ├── generate-certs.sh │ │ │ │ │ │ ├── myca-cert.pem │ │ │ │ │ │ ├── myclient-bad-cert.pem │ │ │ │ │ │ ├── myclient-dns-cert.pem │ │ │ │ │ │ ├── myclient-ip-cert.pem │ │ │ │ │ │ └── myserver-cert.pem │ │ │ │ │ ├── verifier.go │ │ │ │ │ └── verifier_test.go │ │ │ │ └── tlshelper/ │ │ │ │ └── tlshelper.go │ │ │ ├── constants/ │ │ │ │ └── constants.go │ │ │ ├── dnsproxy/ │ │ │ │ ├── common.go │ │ │ │ ├── dns.go │ │ │ │ ├── dns_darwin.go │ │ │ │ ├── dns_linux.go │ │ │ │ ├── dns_linux_test.go │ │ │ │ ├── dns_report.go │ │ │ │ ├── dns_test.go │ │ │ │ ├── dns_unsupported.go │ │ │ │ ├── dns_windows.go │ │ │ │ ├── dns_windows_test.go │ │ │ │ ├── dnsproxy.go │ │ │ │ ├── mockdnsproxy/ │ │ │ │ │ └── mockdnsproxy.go │ │ │ │ └── mutex_map.go │ │ │ ├── enforcer.go │ │ │ ├── envoyauthorizer/ │ │ │ │ ├── envoyauthorizerenforcer.go │ │ │ │ └── envoyproxy/ │ │ │ │ ├── auth_server.go │ │ │ │ └── sds_server.go │ │ │ ├── flowstats/ │ │ │ │ └── state.go │ │ │ ├── lookup/ │ │ │ │ ├── lookup.go │ │ │ │ └── lookup_test.go │ │ │ ├── metadata/ │ │ │ │ └── metadata.go │ │ │ ├── mockenforcer/ │ │ │ │ └── mockenforcer.go │ │ │ ├── nfqdatapath/ │ │ │ │ ├── afinetrawsocket/ │ │ │ │ │ ├── afinetrawsocket.go │ │ │ │ │ ├── afinetrawsocket_osx.go │ │ │ │ │ └── afinetrawsocket_windows.go │ │ │ │ ├── autoport.go │ │ │ │ ├── autoport_nonwindows.go │ │ │ │ ├── autoport_windows.go │ │ │ │ ├── countererrors.go │ │ │ │ ├── datapath.go │ │ │ │ ├── datapath_common_test.go │ │ │ │ ├── datapath_darwin.go │ │ │ │ ├── datapath_icmp.go │ │ │ │ ├── datapath_linux.go │ │ │ │ ├── datapath_tcp.go │ │ │ │ ├── datapath_test.go │ │ │ │ ├── datapath_udp.go │ │ │ │ ├── datapath_windows.go │ │ │ │ ├── diagnostics_tcp.go │ │ │ │ ├── interfaces.go │ │ │ │ ├── nflog/ │ │ │ │ │ ├── nflog_common.go │ │ │ │ │ ├── nflog_darwin.go │ │ │ │ │ ├── nflog_linux.go │ │ │ │ │ ├── nflog_test.go │ │ │ │ │ └── nflog_windows.go │ │ │ │ ├── nfq_darwin.go │ │ │ │ ├── nfq_linux.go │ │ │ │ ├── nfq_windows.go │ │ │ │ ├── nfq_windows_test.go │ │ │ │ ├── ping_tcp.go │ │ │ │ ├── ping_test.go │ │ │ │ ├── test_utils.go │ │ │ │ ├── test_utils_linux.go │ │ │ │ ├── tokenaccessor/ │ │ │ │ │ ├── interfaces.go │ │ │ │ │ ├── mocktokenaccessor/ │ │ │ │ │ │ └── mocktokenaccessor.go │ │ │ │ │ ├── tokenaccessor.go │ │ │ │ │ └── tokenaccessor_test.go │ │ │ │ ├── utils.go │ │ │ │ └── utils_test.go │ │ │ ├── proxy/ │ │ │ │ ├── enforcerproxy.go │ │ │ │ ├── enforcerproxy_test.go │ │ │ │ └── rpcserver.go │ │ │ ├── secretsproxy/ │ │ │ │ ├── secretsproxy.go │ │ │ │ ├── secretsproxy_windows.go │ │ │ │ └── transformer.go │ │ │ └── utils/ │ │ │ ├── ephemeralkeys/ │ │ │ │ ├── ephemeralkeys.go │ │ │ │ ├── interfaces.go │ │ │ │ └── mockephemeralkeys/ │ │ │ │ └── mockephemeralkeys.go │ │ │ ├── nsenter/ │ │ │ │ ├── nsenter.c │ │ │ │ ├── nsenter.go │ │ │ │ └── nsenter_linux.go │ │ │ ├── packetgen/ │ │ │ │ ├── interfaces.go │ │ │ │ ├── packet_gen.go │ │ │ │ ├── packet_gen_test.go │ │ │ │ └── packet_templates.go │ │ │ └── rpcwrapper/ │ │ │ ├── interfaces.go │ │ │ ├── mockrpcwrapper/ │ │ │ │ └── mockrpcwrapper.go │ │ │ ├── rpc_handle.go │ │ │ ├── rpc_handlemock.go │ │ │ ├── rpc_handletest.go │ │ │ ├── rpc_testhelper.go │ │ │ └── types.go │ │ ├── processmon/ │ │ │ ├── interfaces.go │ │ │ ├── mockprocessmon/ │ │ │ │ └── mockprocessmon.go │ │ │ ├── processmon.go │ │ │ ├── processmon_linux_test.go │ │ │ ├── processmon_test.go │ │ │ ├── processmon_windows.go │ │ │ └── testbinary/ │ │ │ └── testbinary.go │ │ ├── supervisor/ │ │ │ ├── interfaces.go │ │ │ ├── iptablesctrl/ │ │ │ │ ├── acls.go │ │ │ │ ├── acls_darwin.go │ │ │ │ ├── acls_linux.go │ │ │ │ ├── acls_nonwindows.go │ │ │ │ ├── acls_rhel6.go │ │ │ │ ├── acls_windows.go │ │ │ │ ├── acls_windows_test.go │ │ │ │ ├── comparators.go │ │ │ │ ├── constants_nonwindows.go │ │ │ │ ├── constants_windows.go │ │ │ │ ├── icmp_linux.go │ │ │ │ ├── icmp_linux_test.go │ │ │ │ ├── icmp_rhel6.go │ │ │ │ ├── icmp_windows.go │ │ │ │ ├── instance.go │ │ │ │ ├── ipsets.go │ │ │ │ ├── iptables.go │ │ │ │ ├── iptablesV4_test.go │ │ │ │ ├── iptablesV6_test.go │ │ │ │ ├── iptables_linux_test.go │ │ │ │ ├── iptables_rhel6_test.go │ │ │ │ ├── iptables_windows_test.go │ │ │ │ ├── ipv4.go │ │ │ │ ├── ipv6.go │ │ │ │ ├── ipv6_nonwindows.go │ │ │ │ ├── ipv6_windows.go │ │ │ │ ├── legacyacls.go │ │ │ │ ├── portset.go │ │ │ │ ├── rules.go │ │ │ │ ├── rules_rhel6.go │ │ │ │ ├── rules_windows.go │ │ │ │ ├── templates.go │ │ │ │ └── templates_test.go │ │ │ ├── mocksupervisor/ │ │ │ │ └── mocksupervisor.go │ │ │ ├── noop/ │ │ │ │ └── supervisornoop.go │ │ │ ├── supervisor.go │ │ │ └── supervisor_test.go │ │ └── windows/ │ │ ├── rulespec_windows.go │ │ ├── rulespec_windows_test.go │ │ └── utils.go │ ├── mockcontroller/ │ │ └── mocktrireme.go │ ├── pkg/ │ │ ├── aclprovider/ │ │ │ ├── ipsetprovider.go │ │ │ ├── ipsetprovider_windows.go │ │ │ ├── ipsetprovidermock.go │ │ │ ├── iptablesprovider.go │ │ │ ├── iptablesprovider_test.go │ │ │ ├── iptablesprovider_windows.go │ │ │ └── iptablesprovidermock.go │ │ ├── auth/ │ │ │ └── auth.go │ │ ├── bufferpool/ │ │ │ └── bufferpool.go │ │ ├── claimsheader/ │ │ │ ├── bytes.go │ │ │ ├── bytes_test.go │ │ │ ├── claimsheader.go │ │ │ ├── claimsheader_test.go │ │ │ ├── constants.go │ │ │ ├── ct.go │ │ │ ├── datapath_version.go │ │ │ ├── options.go │ │ │ ├── ping_type.go │ │ │ └── types.go │ │ ├── cleaner/ │ │ │ └── cleaner.go │ │ ├── connection/ │ │ │ ├── connection.go │ │ │ ├── connection_test.go │ │ │ └── connectioncache.go │ │ ├── counters/ │ │ │ ├── counters.go │ │ │ ├── counters_test.go │ │ │ ├── countertype_string.go │ │ │ ├── default.go │ │ │ ├── default_test.go │ │ │ └── types.go │ │ ├── dmesgparser/ │ │ │ └── dmesgparser.go │ │ ├── ebpf/ │ │ │ ├── bpfbuild/ │ │ │ │ └── socket-filter-bpf.go │ │ │ ├── ebpf_darwin.go │ │ │ ├── ebpf_linux.go │ │ │ ├── ebpf_rhel6.go │ │ │ ├── ebpf_windows.go │ │ │ └── interface.go │ │ ├── env/ │ │ │ └── parameters.go │ │ ├── flowtracking/ │ │ │ ├── flowtracking.go │ │ │ ├── flowtracking_nonlinux.go │ │ │ ├── interfaces.go │ │ │ └── mockflowclient/ │ │ │ └── mockflowclient.go │ │ ├── fqconfig/ │ │ │ ├── fqconfig.go │ │ │ └── fqconfig_test.go │ │ ├── ipsetmanager/ │ │ │ ├── constants_nonwindows.go │ │ │ ├── constants_windows.go │ │ │ ├── helpers.go │ │ │ ├── ipsetmanager.go │ │ │ ├── ipsetmanager_test.go │ │ │ ├── ipsetprovider.go │ │ │ ├── ipsetprovider_windows.go │ │ │ ├── ipsetprovidermock.go │ │ │ ├── ipsets.go │ │ │ └── mock_ipsetmanager/ │ │ │ └── ipsetmanagermock.go │ │ ├── packet/ │ │ │ ├── constants.go │ │ │ ├── helpers.go │ │ │ ├── packet.go │ │ │ ├── packet_test.go │ │ │ └── types.go │ │ ├── packetprocessor/ │ │ │ └── packetprocessor.go │ │ ├── packettracing/ │ │ │ └── packettracing.go │ │ ├── pingconfig/ │ │ │ ├── pingconfig.go │ │ │ └── pingconfig_test.go │ │ ├── pkiverifier/ │ │ │ ├── pkiverifier.go │ │ │ └── pkiverifier_test.go │ │ ├── pucontext/ │ │ │ ├── pucontext.go │ │ │ └── pucontext_test.go │ │ ├── remoteenforcer/ │ │ │ ├── interfaces.go │ │ │ ├── internal/ │ │ │ │ ├── client/ │ │ │ │ │ ├── interfaces.go │ │ │ │ │ ├── mockclient/ │ │ │ │ │ │ └── mockclient.go │ │ │ │ │ ├── reportsclient/ │ │ │ │ │ │ └── client.go │ │ │ │ │ └── statsclient/ │ │ │ │ │ └── client.go │ │ │ │ ├── statscollector/ │ │ │ │ │ ├── collector.go │ │ │ │ │ ├── collector_reader.go │ │ │ │ │ ├── collector_test.go │ │ │ │ │ ├── collector_trireme.go │ │ │ │ │ ├── interfaces.go │ │ │ │ │ └── mockstatscollector/ │ │ │ │ │ └── mockstatscollector.go │ │ │ │ └── tokenissuer/ │ │ │ │ ├── mocktokenclient/ │ │ │ │ │ └── mocktokenclient.go │ │ │ │ └── tokenissuer.go │ │ │ ├── mockremoteenforcer/ │ │ │ │ └── mockremoteenforcer.go │ │ │ ├── remoteenforcer_linux.go │ │ │ ├── remoteenforcer_stub.go │ │ │ ├── remoteenforcer_test.go │ │ │ └── type.go │ │ ├── secrets/ │ │ │ ├── compactpki/ │ │ │ │ ├── compactpki.go │ │ │ │ └── compactpki_test.go │ │ │ ├── compactpki.go │ │ │ ├── compactpki_test.go │ │ │ ├── interfaces.go │ │ │ ├── mocksecrets/ │ │ │ │ └── mocksecrets.go │ │ │ ├── null.go │ │ │ ├── rpc/ │ │ │ │ └── rpc.go │ │ │ ├── secrets.go │ │ │ ├── test_utils.go │ │ │ └── testhelper/ │ │ │ └── testhelper.go │ │ ├── servicetokens/ │ │ │ └── servicetokens.go │ │ ├── tokens/ │ │ │ ├── binarycodec.go │ │ │ ├── binaryjwt.go │ │ │ ├── binaryjwt314.go │ │ │ ├── binaryjwt500.go │ │ │ ├── binaryjwt_test.go │ │ │ ├── binaryjwtclaimtypes.go │ │ │ ├── errors.go │ │ │ ├── jwt.go │ │ │ ├── jwt_test.go │ │ │ ├── mocktokens/ │ │ │ │ └── mocktokens.go │ │ │ └── tokens.go │ │ ├── urisearch/ │ │ │ ├── urisearch.go │ │ │ └── urisearch_test.go │ │ └── usertokens/ │ │ ├── common/ │ │ │ ├── common.go │ │ │ └── common_test.go │ │ ├── mockusertokens/ │ │ │ └── mockusertokens.go │ │ ├── oidc/ │ │ │ └── oidc.go │ │ ├── pkitokens/ │ │ │ ├── jwt.go │ │ │ ├── jwt_test.go │ │ │ ├── publickeys.go │ │ │ └── publickeys_test.go │ │ └── usertokens.go │ └── runtime/ │ └── runtime.go ├── doc.go ├── docs/ │ ├── README.md │ ├── docker_host_networks.md │ ├── linux_processes.md │ ├── policy_design.md │ ├── secure-application_segmentation.md │ └── trireme_architecture.md ├── fix_bpf ├── mockgen.sh ├── monitor/ │ ├── api/ │ │ └── spec/ │ │ ├── Makefile │ │ └── protos/ │ │ ├── monitor.pb.go │ │ └── monitor.proto │ ├── config/ │ │ └── config.go │ ├── constants/ │ │ └── constants.go │ ├── external/ │ │ ├── interfaces.go │ │ └── mockexternal/ │ │ └── mockinterfaces.go │ ├── extractors/ │ │ ├── constants.go │ │ ├── constants_windows.go │ │ ├── docker.go │ │ ├── docker_test.go │ │ ├── error.go │ │ ├── error_test.go │ │ ├── interface.go │ │ ├── kubernetes.go │ │ ├── kubernetes_test.go │ │ ├── linux.go │ │ ├── linux_test.go │ │ ├── ssh.go │ │ ├── ssh_test.go │ │ ├── testdata/ │ │ │ └── curl │ │ ├── uid.go │ │ ├── uid_test.go │ │ ├── util.go │ │ ├── windows.go │ │ └── windows_test.go │ ├── interfaces.go │ ├── internal/ │ │ ├── cni/ │ │ │ ├── extractor.go │ │ │ ├── monitor.go │ │ │ └── processor.go │ │ ├── docker/ │ │ │ ├── config.go │ │ │ ├── helpers.go │ │ │ ├── helpers_test.go │ │ │ ├── mockdocker/ │ │ │ │ └── mockdocker.go │ │ │ ├── monitor.go │ │ │ ├── monitor_linux_test.go │ │ │ ├── monitor_test.go │ │ │ └── types.go │ │ ├── k8s/ │ │ │ ├── config.go │ │ │ ├── event_handler.go │ │ │ ├── event_handler_test.go │ │ │ ├── event_retry_handler.go │ │ │ ├── event_retry_handler_test.go │ │ │ ├── helpers_test.go │ │ │ ├── mocks_pod_cache_test.go │ │ │ ├── mocks_runtime_cache_test.go │ │ │ ├── monitor.go │ │ │ ├── monitor_test.go │ │ │ ├── on_startup.go │ │ │ ├── on_startup_test.go │ │ │ ├── pod_cache.go │ │ │ ├── pod_cache_test.go │ │ │ ├── runtime_cache.go │ │ │ ├── runtime_cache_linux.go │ │ │ ├── runtime_cache_test.go │ │ │ ├── runtime_cache_unsupported.go │ │ │ ├── runtime_cache_windows.go │ │ │ └── testdata/ │ │ │ └── kubeconfig │ │ ├── kubernetes/ │ │ │ ├── DEPRECATED.txt │ │ │ ├── cache.go │ │ │ ├── cache_test.go │ │ │ ├── client.go │ │ │ ├── client_test.go │ │ │ ├── config.go │ │ │ ├── handler.go │ │ │ ├── handler_test.go │ │ │ ├── kubernetes.go │ │ │ ├── monitor.go │ │ │ └── monitor_test.go │ │ ├── linux/ │ │ │ ├── config.go │ │ │ ├── monitor.go │ │ │ ├── processor.go │ │ │ └── processor_test.go │ │ ├── pod/ │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── controller.go │ │ │ ├── controller_test.go │ │ │ ├── delete_controller.go │ │ │ ├── delete_controller_test.go │ │ │ ├── mockcache_test.go │ │ │ ├── mockclient_test.go │ │ │ ├── mockinformer_test.go │ │ │ ├── mockmanager_test.go │ │ │ ├── mockzapcore_test.go │ │ │ ├── monitor.go │ │ │ ├── monitor_test.go │ │ │ ├── resync.go │ │ │ ├── resync_test.go │ │ │ ├── testdata/ │ │ │ │ └── kubeconfig │ │ │ ├── watcher.go │ │ │ └── watcher_test.go │ │ ├── uid/ │ │ │ ├── config.go │ │ │ ├── monitor.go │ │ │ └── processor.go │ │ └── windows/ │ │ ├── config.go │ │ ├── monitor.go │ │ ├── processor.go │ │ └── processor_test.go │ ├── mockmonitor/ │ │ └── mockmonitor.go │ ├── monitor.go │ ├── monitor_windows.go │ ├── options.go │ ├── options_windows.go │ ├── processor/ │ │ ├── interfaces.go │ │ └── mockprocessor/ │ │ └── mockprocessor.go │ ├── registerer/ │ │ ├── interfaces.go │ │ ├── registerer.go │ │ └── registerer_test.go │ ├── remoteapi/ │ │ ├── client/ │ │ │ ├── client.go │ │ │ ├── client_nonwindows.go │ │ │ ├── client_windows.go │ │ │ ├── interfaces.go │ │ │ └── mockclient/ │ │ │ └── mockclient.go │ │ └── server/ │ │ ├── interfaces.go │ │ ├── server.go │ │ ├── server_nonwindows.go │ │ ├── server_test.go │ │ ├── server_windows.go │ │ ├── uidlistener.go │ │ └── uidlistener_nonlinux.go │ └── server/ │ ├── pipe.go │ ├── pipe_windows.go │ └── server.go ├── plugins/ │ └── pam/ │ ├── README.md │ ├── uidmonitorpam.go │ └── uidmonitorpam_c.go ├── policy/ │ ├── apiservices.go │ ├── interfaces.go │ ├── mockpolicy/ │ │ └── mockpolicy.go │ ├── policy.go │ ├── policy_test.go │ ├── policyerror.go │ ├── policyerror_test.go │ ├── puinfo.go │ ├── runtime.go │ ├── runtime_test.go │ ├── tagstore.go │ ├── tagstore_test.go │ ├── types.go │ └── types_test.go ├── protogen.sh ├── scripts/ │ ├── fix_bpf │ ├── lint.sh │ ├── lint.windows.sh │ ├── test.sh │ └── test.windows.sh ├── third_party/ │ └── generated/ │ └── envoyproxy/ │ └── data-plane-api/ │ └── envoy/ │ ├── api/ │ │ └── v2/ │ │ ├── core/ │ │ │ ├── address.pb.go │ │ │ ├── base.pb.go │ │ │ └── http_uri.pb.go │ │ └── discovery.pb.go │ ├── service/ │ │ ├── auth/ │ │ │ └── v2/ │ │ │ ├── attribute_context.pb.go │ │ │ └── external_auth.pb.go │ │ └── discovery/ │ │ └── v2/ │ │ └── sds.pb.go │ └── type/ │ ├── http_status.pb.go │ └── percent.pb.go └── utils/ ├── README.md ├── allocator/ │ ├── allocator.go │ └── interfaces.go ├── cache/ │ ├── cache.go │ └── cache_test.go ├── cgnetcls/ │ ├── cgnetcls.go │ ├── cgnetcls_osx.go │ ├── cgnetcls_test.go │ ├── cgnetcls_windows.go │ ├── constants.go │ ├── constants_nonwindows.go │ ├── interfaces.go │ ├── mockcgnetcls/ │ │ └── mockcgnetcls.go │ └── netcls.go ├── constants/ │ ├── constants.go │ ├── constants_linux.go │ └── constants_rhel6.go ├── cri/ │ ├── common.go │ ├── cri_client_setup.go │ ├── cri_client_setup_linux.go │ ├── cri_client_setup_linux_test.go │ ├── cri_client_setup_unsupported.go │ ├── cri_client_setup_windows.go │ ├── cri_runtime_wrapper.go │ ├── cri_runtime_wrapper_test.go │ ├── interface.go │ └── mockcri/ │ ├── mock_runtime_service.go │ └── mockinterface.go ├── crypto/ │ ├── crypto.go │ └── crypto_test.go ├── fqdn/ │ ├── fqdn.go │ └── fqdn_test.go ├── frontman/ │ ├── driver_windows.go │ ├── driver_windows_test.go │ ├── rulecleanup_windows.go │ ├── rulecleanup_windows_test.go │ ├── utils_windows.go │ └── wrapper_windows.go ├── ipprefix/ │ ├── ipprefix.go │ └── ipprefix_test.go ├── netinterfaces/ │ └── netinterfaces.go ├── nfqparser/ │ ├── constants.go │ ├── nfqlayout.go │ ├── nfqparser.go │ └── nfqparser_test.go ├── portcache/ │ ├── portcache.go │ └── portcache_test.go └── portspec/ ├── portspec.go └── portspec_test.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ #### Actual behavior *Description of the actual behavior.* #### Expected behavior *Description of the expected behavior.* #### Steps to reproduce *Description of the various steps required to reproduce the error.* #### Solution proposal *Description of what you thingk would need to be done.* #### Installation type - [ ] console.aporeto.com - [ ] on-prem - [ ] dev > Version: ? > Customer: ? > ETA: ? ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ #### Description *Changes proposed in this pull request.* #### Test plan *Outline the test plan used to test this change before merging it.* > Fixes #. ================================================ FILE: .gitignore ================================================ .DS_Store example/example vendor coverage.txt controller/internal/processmon/testbinary/testbinary Gopkg.lock profile.out ================================================ FILE: .lint.windows.sh ================================================ #!/usr/bin/env bash # goimports and gofmt complain about cr-lf line endings, so don't run them on # a Windows machine where git is configured to auto-convert line endings OS=`uname -s` if [[ $OS == *"NT-"* ]]; then GOIMPORTS_OPTION= GOFMT_OPTION= else GOIMPORTS_OPTION=--enable=goimports GOFMT_OPTION=--enable=gofmt fi CGO_ENABLED=0 GOOS=windows GOARCH=amd64 golangci-lint run --deadline=10m --disable-all --exclude-use-default=false --enable=errcheck --enable=ineffassign --enable=govet --enable=golint --enable=unused --enable=structcheck --enable=varcheck --enable=deadcode --enable=unconvert --enable=goconst --enable=gosimple --enable=misspell --enable=staticcheck --enable=unparam --enable=prealloc --enable=nakedret --enable=typecheck $GOIMPORTS_OPTION $GOFMT_OPTION --skip-dirs=vendor/github.com/iovisor ./... ================================================ FILE: .test.sh ================================================ #!/usr/bin/env bash set -e echo "" > coverage.txt ./mockgen.sh ./fix_bpf ## FIX ME. go1.14 automatically enables unsafe ptr checks when doing race checks, ## and it is not clear if this is compatible (it is disabled on Windows) ## ## This needs to be revisited and maybe remove "-gcflags=all=-d=checkptr=0" below ## for go1.14 once we determine if there is a real pointer issue in the tests. ## ## this is the file that fails when ptr checking is enabled: ## go.aporeto.io/trireme-lib/controller/internal/enforcer/applicationproxy/markedconn_test.go ## ## to see the failure, test that package individually setting "checkptr=1" case "$(go version)" in *1.13*) CHECKPTR="" ;; *) CHECKPTR="-gcflags=all=-d=checkptr=0" ;; esac for d in $(go list ./... | grep -v 'mock|bpf'); do go test ${CHECKPTR} -race -tags test -coverprofile=profile.out -covermode=atomic $d if [ -f profile.out ]; then cat profile.out >> coverage.txt rm profile.out fi done ================================================ FILE: .test.windows.sh ================================================ #!/usr/bin/env bash # use wine to execute if not running tests on a Windows machine OS=`uname -s` if [[ $OS == *"NT-"* ]]; then WINE_EXEC= else WINE_EXEC="-exec wine" fi set -e echo "" > coverage.windows.txt for d in $(CGO_ENABLED=0 go list ./... | grep -v remoteenforcer | grep -v remoteapi | grep -v "plugins/pam"); do CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go test -tags test $WINE_EXEC -coverprofile=profile.windows.out -covermode=atomic $d if [ -f profile.windows.out ]; then cat profile.windows.out >> coverage.windows.txt rm profile.windows.out fi done ================================================ FILE: .travis.yml ================================================ language: go sudo: required dist: bionic go_import_path: go.aporeto.io/trireme-lib matrix: include: - go: "1.13.x" - go: "1.14.x" - go: master allow_failures: - go: master fast_finish: true addons: apt: packages: - libnetfilter-queue-dev - libnetfilter-log-dev - iptables - ipset - wine-stable env: global: - TOOLS_CMD=golang.org/x/tools/cmd - PATH=$GOROOT/bin:$PATH - SUDO_PERMITTED=1 before_install: - GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.21.0 - GO111MODULE=off go get github.com/golang/dep/cmd/dep - sudo apt-get -y install wine32 install: - dep ensure - ./fix_bpf - dep status || true script: - GO111MODULE=off ./.test.sh - golangci-lint run --deadline=10m --disable-all --exclude-use-default=false --enable=errcheck --enable=goimports --enable=ineffassign --enable=govet --enable=golint --enable=unused --enable=structcheck --enable=varcheck --enable=deadcode --enable=unconvert --enable=goconst --enable=gosimple --enable=misspell --enable=staticcheck --enable=unparam --enable=prealloc --enable=nakedret --enable=gofmt --enable=typecheck --skip-dirs=vendor/github.com/iovisor ./... - GO111MODULE=off ./.lint.windows.sh - GO111MODULE=off ./.test.windows.sh ================================================ FILE: CONTRIBUTING.md ================================================ Contributing ------------ As an open source project, your contributions are important to the future of Trireme. Whether you're looking to write code, add new documentation, or just report a bug, you'll be helping everyone who uses Trireme in the future. ### Reporting Bugs Filing issues is a simple but very important part of contributing to Trireme. It provides a metric for measuring progress and allows the community to know what is being worked on. "Issues" in the context of the project refer to everything from broken aspects of the framework, to regressions and unimplemented features. Trireme uses [GitHub Issues](https://github.com/aporeto-inc/trireme-lib/issues) for tracking issues! When opening an issue or a pull request, labels will be applied to it. You can check the Issue and Pull Request Lifecycle [here](https://github.com/aporeto-inc/trireme-lib/wiki/Issue-and-Pull-Request-Lifecycle). ### Contributing to the project There are always bugs to be fixed and features to be implemented, some large, some small. Fixing even the smallest bug is enormously helpful! If you have something in mind, don't hesitate to create a pull request [here](https://github.com/aporeto-inc/trireme-lib/pulls)! When contributing to a project you must propose a pull request for each modifications you do. To do a PR, please follow this instructions : ```bash git checkout master #make sure your base is the master git checkout -b nameOfYourNewBranch #create a new branch and start to work locally on this branch ... #do your change ./.test.sh git add yourFile* #add the files to the commit git commit #create a beautiful messages for the commit, please follow the guideline below git push origin nameOfYourNewBranch #push the branch on the remote origin ``` Then we advise to create your PR from the github website, make sure to read your changes again. More documentation here : https://git-scm.com/documentation Pull requests will not be accepted if the tests are not passing and if the coverage of the tests has dicreased. ### Coding Guidelines Go Coding Style Guidelines You must follow the golint, gofmt guide style when coding in Go. You must also know by heart Effective Go. Install the linter on your system and add it to your pre-commit hook. ### Do's and don'ts DO * Be consistent. * Use symmetry. If you provide a way to do something, provide a way to undo it. * All public methods and functions must be commented. * A comment has a space between // and the first letter. * A comment starts with a capitalized letter and ends with a final dot. * Be careful with the commenting. This could be released to GoDoc at anytime. * An interface or a struct Thing comment should be in the form of "// A Thing is a thing", not "// Thing is a thing" * Code must go straight to the point. Do not over engineer by thinking "maybe one day". If that day comes, update your code. * Use short explicit name for variables. "objectThatMayBeCreatedIfEverythingIsFine" is overkill. "obj" is enough. Use best judgement. * A function must do what its name says. "catchPokemon(pokeball) bool" should not get an int as parameters, and do an addition. * Organize your packages consistently. * Skip a line between the function declaration and the first line of code. * A constructor must use the "return &Struct{a: 1}" pattern, not "newthing:= &Struct{}; thing.a = 1; return a". * Always provide a way to understand what went wrong or what went well in a function/method. A log is useless. * A function or method that starts by "Is" or "Are" must return a boolean. * Order of appearance of methods should be consistent: * Imports * Constants (if any) * Variables (if any) * Helper functions (if any) * Main structure * Constructor (if any) * Implemented interface methods (if any) * Public methods (if any) * Private methods (if any) DON'T * Do not write more than a main structure per file. * Do not ignore returned errors. Never. Handle them, or pass them back. You can use github.com/kisielk/errcheck to help you find them. * Do not over log. Go philosophy is "no news, good news". Carefully minimize all logs above the "debug" level. * Do not put logs in a helper functions. Return an error and let the main program decide what to do. * Don't use new(). * Do not pass entire structure down, because at some point you need one value. Just pass the value. (see "maybe one day" point) * Do not export methods if they are not used outside of the package (see "maybe one day" point) * Do not let an unused function in the code, delete it. Use Go Oracle to find the referrers if needed. (if we need it later, git is our friend) * Do not let Todos hanging in the code forever. Fix them asap. * Do not overuse wrappers. If a library provides a structure that matches what you need, use it (see "maybe one day" point). * Do not store duplicate information: a.Name = b.Name, a.B = b. a.B.Name is enough * Don't use strings. Strings are bad for anything else than giving information to a human. Use a constant or a structure. * Do not copy and paste business logic code. If you need the same code twice, write a function. * Do not use map[string]map[string]chan map[string]bool, create a Type. * Do not pass information through maps. Maps content cannot be controlled by the compiler (see "don't use string" point) * Do not overused go routines. Remember that if someone wants to thread something, he can use "go" himself. Leave the guy a choice. * Do not let old naming. If a structure doesn't do what it did in the beginning, rename it. gorename is our friend here. * Do not paste StackOverflow code without understanding exactly what it does. You should also add a backlink. ### Commit Messages The style and format of your commit messages are very important to the health of the project. A good commit message helps not only users reading the release notes, but also your fellow developers as they review git log or git blame to figure out what you were doing. Commit messages should be in the following format: ``` #comments :