INNER CODE UNIT · Python
get_deprecated_ids
panther-labs/panther-analysis · .scripts/deleted_rules.py:40
def get_deprecated_ids() -> set[str]:
"""Returns all the IDs listed in `deprecated.txt`."""
with open("deprecated.txt", "r") as f:
return set(f.read().split("\n"))
def check():
"""Check if any items have been removed and not added to deprecated.txt"""
if ids := get_deleted_ids() - get_deprecated_ids():
print("❌ The following rule IDs may have been deleted:")
for id_ in ids:
print(f"\t{id_}")
raise typer.Exit(code=1)
else:
print("✅ No unaccounted deletions found! You're in the clear! 👍")
def remove(