Skip to content

Commit

Permalink
Add SPDX license identifier to each file (#651)
Browse files Browse the repository at this point in the history
Add SPDX license short header to every source file. Also add any missing
copyrights if necessary.

Signed-off-by: Eric Brown <[email protected]>
  • Loading branch information
ericwb authored Oct 21, 2024
1 parent 24d5166 commit 3c79016
Show file tree
Hide file tree
Showing 161 changed files with 173 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
exclude: ^(docs|tests|mkdocs.yml)
repos:

Expand Down
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
version: 2

build:
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
mkdocs
mkdocstrings[python]
mkdocs-material
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
site_name: Precli Documentation
repo_url: https://github.com/securesauce/precli/
edit_uri: blob/main/docs/
Expand Down
1 change: 1 addition & 0 deletions precli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from datetime import datetime
from importlib import metadata

Expand Down
2 changes: 2 additions & 0 deletions precli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from precli.cli import main

main.main()
1 change: 1 addition & 0 deletions precli/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import argparse
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions precli/core/argument.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional

from tree_sitter import Node
Expand Down
1 change: 1 addition & 0 deletions precli/core/artifact.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional


Expand Down
1 change: 1 addition & 0 deletions precli/core/call.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional

from tree_sitter import Node
Expand Down
1 change: 1 addition & 0 deletions precli/core/comparison.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from tree_sitter import Node


Expand Down
1 change: 1 addition & 0 deletions precli/core/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from precli.core.level import Level


Expand Down
1 change: 1 addition & 0 deletions precli/core/cwe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1


class Cwe:
Expand Down
1 change: 1 addition & 0 deletions precli/core/fix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional

from precli.core.location import Location
Expand Down
1 change: 1 addition & 0 deletions precli/core/kind.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import enum


Expand Down
1 change: 1 addition & 0 deletions precli/core/level.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import enum


Expand Down
1 change: 1 addition & 0 deletions precli/core/linecache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import linecache


Expand Down
1 change: 1 addition & 0 deletions precli/core/loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import sys
from importlib.metadata import entry_points

Expand Down
1 change: 1 addition & 0 deletions precli/core/location.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional

from tree_sitter import Node
Expand Down
1 change: 1 addition & 0 deletions precli/core/metrics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1


class Metrics:
Expand Down
1 change: 1 addition & 0 deletions precli/core/redos.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2024 Secure Sauce LLC
# Copyright 2019 Duo Security
# SPDX-License-Identifier: BUSL-1.1
import collections
import itertools
import sys
Expand Down
1 change: 1 addition & 0 deletions precli/core/result.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional

from precli.core.artifact import Artifact
Expand Down
1 change: 1 addition & 0 deletions precli/core/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import datetime
import io
import logging
Expand Down
1 change: 1 addition & 0 deletions precli/core/status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import enum


Expand Down
1 change: 1 addition & 0 deletions precli/core/suppression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from typing import Optional

from precli.core.location import Location
Expand Down
1 change: 1 addition & 0 deletions precli/core/symtab.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import sys
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions precli/core/tool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
class Tool:
def __init__(
self,
Expand Down
1 change: 1 addition & 0 deletions precli/core/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1


def is_str(value) -> bool:
Expand Down
1 change: 1 addition & 0 deletions precli/parsers/go.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import ast
import re
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions precli/parsers/java.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import re
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions precli/parsers/node_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1


class NodeTypes:
Expand Down
1 change: 1 addition & 0 deletions precli/parsers/python.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import builtins
import codecs
import importlib
Expand Down
1 change: 1 addition & 0 deletions precli/renderers/detailed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from rich import box
from rich import syntax
from rich.table import Table
Expand Down
1 change: 1 addition & 0 deletions precli/renderers/json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import pathlib
import sys
import urllib.parse as urlparse
Expand Down
1 change: 1 addition & 0 deletions precli/renderers/markdown.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
import logging
import sys

Expand Down
1 change: 1 addition & 0 deletions precli/renderers/plain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
from rich.padding import Padding

from precli.core.level import Level
Expand Down
1 change: 1 addition & 0 deletions precli/rules/go/stdlib/crypto_weak_cipher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Use of a Broken or Risky Cryptographic Algorithm in `crypto` Package
Expand Down
1 change: 1 addition & 0 deletions precli/rules/go/stdlib/crypto_weak_hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Reversible One Way Hash in `crypto` Package
Expand Down
1 change: 1 addition & 0 deletions precli/rules/go/stdlib/crypto_weak_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Inadequate Encryption Strength Using Weak Keys in `crypto` Package
Expand Down
1 change: 1 addition & 0 deletions precli/rules/go/stdlib/syscall_setuid_root.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Execution with Unnecessary Privileges using `syscall` Package
Expand Down
1 change: 1 addition & 0 deletions precli/rules/java/stdlib/java_net_insecure_cookie.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Sensitive Cookie in HTTPS Session Without 'Secure' Attribute
Expand Down
1 change: 1 addition & 0 deletions precli/rules/java/stdlib/java_security_weak_hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Reversible One Way Hash in `java.security` Package
Expand Down
1 change: 1 addition & 0 deletions precli/rules/java/stdlib/java_security_weak_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Inadequate Encryption Strength Using Weak Keys in `java.security` Package
Expand Down
1 change: 1 addition & 0 deletions precli/rules/java/stdlib/java_security_weak_random.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Use of Cryptographically Weak Pseudo-Random Number Generator `SHA1PRNG`
Expand Down
1 change: 1 addition & 0 deletions precli/rules/java/stdlib/javax_crypto_weak_cipher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Use of a Broken or Risky Cryptographic Algorithm in `javax.crypto` Package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Sensitive Cookie in HTTPS Session Without 'Secure' Attribute
Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/argparse_sensitive_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Invocation of Process Using Visible Sensitive Information in `argparse`
Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/assert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Improper Check Using `assert` Function
Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/crypt_weak_hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Reversible One Way Hash in `crypt` Module
Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/ftplib_cleartext.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Cleartext Transmission of Sensitive Information in the `ftplib` Module

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/ftplib_no_timeout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Synchronous Access of `FTP` without Timeout

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/ftplib_unverified_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Improper Certificate Validation Using `ftplib`

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/hashlib_improper_prng.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Improper Randomness for Cryptographic `hashlib` Functions

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/hashlib_weak_hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Reversible One Way Hash in `hashlib` Module

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/hmac_timing_attack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
Observable Timing Discrepancy in `hmac` Module

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/hmac_weak_hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Reversible One Way Hash in `hmac` Module

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/hmac_weak_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Insufficient `hmac` Key Size

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Binding to an Unrestricted IP Address in `http.server` Module

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/http_url_secret.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Use of HTTP Request Method With Sensitive Query Strings

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/imaplib_cleartext.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Cleartext Transmission of Sensitive Information in the `imaplib` Module

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/imaplib_no_timeout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Synchronous Access of `IMAP4` without Timeout

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/imaplib_unverified_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Improper Certificate Validation Using `imaplib`

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/json_load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Deserialization of Untrusted Data in the `json` Module

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Code Injection in Logging Config

Expand Down
1 change: 1 addition & 0 deletions precli/rules/python/stdlib/marshal_load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2024 Secure Sauce LLC
# SPDX-License-Identifier: BUSL-1.1
r"""
# Deserialization of Untrusted Data in the `marshal` Module

Expand Down
Loading

0 comments on commit 3c79016

Please sign in to comment.