kubearmor / KubeArmor

Runtime Security Enforcement System. Workload hardening/sandboxing and implementing least-permissive policies made easy leveraging LSMs (BPF-LSM, AppArmor).
https://kubearmor.io/
Apache License 2.0
1.45k stars 335 forks source link

add proper license headers (GPL, Apache) #280

Closed geyslan closed 3 years ago

geyslan commented 3 years ago

When bpf (kernel side) let's define the file as GPL. The rest can continue as Apache.

geyslan commented 3 years ago

@nam-jaehyun @seungsoo-lee

For the rest of the project (Go Code = Apache), should the SPDX license identifier also be added in the first line as instructed by Kernel Coding Style (ebpf)? I know that those are different worlds, but I'm asking just for the sake of symmetry since we're doing this for ebpf.

nam-jaehyun commented 3 years ago

Let's use GPL and Apache licenses like these.

geyslan commented 3 years ago

I think it's important to emphasize:

As per https://www.kernel.org/doc/html/v5.0/process/license-rules.html, the SPDX license identifier should be added in the first possible line and follow different comment styles based on the file type.

C source: // SPDX-License-Identifier: <SPDX License Expression>
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
ASM:      /* SPDX-License-Identifier: <SPDX License Expression> */

P.S. The checkpatch.pl kernel script can be incorporated into CI to check these coding style rules. E.g.: ./checkpatch.pl --no-tree -f file.c

There's also vscode extension for that matter.

Name: checkpatch Id: idanp.checkpatch Description: Using linux kernel checkpatch tool to lint code. VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=idanp.checkpatch