-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/pip/cryptography-41.0.6
- Loading branch information
Showing
38 changed files
with
455 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[bandit] | ||
skips = B101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.github/CODEOWNERS merge=ours | ||
global_helpers/panther_config_overrides.py merge=ours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[MAIN] | ||
disable= | ||
missing-docstring, | ||
duplicate-code, | ||
import-error, | ||
fixme, | ||
consider-iterating-dictionary, | ||
global-variable-not-assigned, | ||
broad-exception-raised | ||
|
||
load-plugins= | ||
pylint.extensions.mccabe, | ||
pylint_print | ||
|
||
max-line-length=100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import panther_event_type_helpers as event_type | ||
|
||
ADMIN_EVENTS = { | ||
"business.add_admin", | ||
"business.invite_admin", | ||
"team.promote_maintainer", | ||
} | ||
|
||
def get_admin_role(_): | ||
# github doesn't record the admin role in the event | ||
return "<UNKNOWN_ROLE>" | ||
|
||
def get_admin_role(event): | ||
action = event.get("action", "") | ||
return action if action in ADMIN_EVENTS else "<UNKNOWN_ADMIN_ROLE>" | ||
|
||
|
||
def get_event_type(event): | ||
if event.get("action") == "team.promote_maintainer": | ||
if event.get("action", "") in ADMIN_EVENTS: | ||
return event_type.ADMIN_ROLE_ASSIGNED | ||
if event.get("action") == "org.disable_two_factor_requirement": | ||
if event.get("action", "") == "org.disable_two_factor_requirement": | ||
return event_type.MFA_DISABLED | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import Any | ||
|
||
import panther_config_defaults | ||
import panther_config_overrides | ||
|
||
|
||
class Config: # pylint: disable=too-few-public-methods | ||
def __getattr__(self, name) -> Any: | ||
if hasattr(panther_config_overrides, name): | ||
return getattr(panther_config_overrides, name) | ||
return getattr(panther_config_defaults, name, None) | ||
|
||
|
||
config = Config() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AnalysisType: global | ||
GlobalID: "panther_config" | ||
Filename: panther_config.py | ||
Description: Configuration values for Panther |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Here, default values for `panther_config.config` are defined | ||
""" | ||
|
||
# A list of public DNS domain names that fall under the administrative domain of | ||
# the Panther installation | ||
ORGANIZATION_DOMAINS = ["example.com"] | ||
|
||
DROPBOX_ALLOWED_SHARE_DOMAINS = ORGANIZATION_DOMAINS | ||
DROPBOX_TRUSTED_OWNERSHIP_DOMAINS = ORGANIZATION_DOMAINS | ||
GSUITE_TRUSTED_FORWARDING_DESTINATION_DOMAINS = ORGANIZATION_DOMAINS | ||
GSUITE_TRUSTED_OWNERSHIP_DOMAINS = ORGANIZATION_DOMAINS | ||
MS_EXCHANGE_ALLOWED_FORWARDING_DESTINATION_DOMAINS = ORGANIZATION_DOMAINS | ||
MS_EXCHANGE_ALLOWED_FORWARDING_DESTINATION_EMAILS = ["postmaster@" + ORGANIZATION_DOMAINS[0]] | ||
TELEPORT_ORGANIZATION_DOMAINS = ORGANIZATION_DOMAINS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AnalysisType: global | ||
GlobalID: "panther_config_defaults" | ||
Filename: panther_config_defaults.py | ||
Description: Default Configuration values for Panther |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
Here, you can override the default, example configuration values from `panther_config_defaults` | ||
Any attribute found to be defined in here will take precedence at lookup time. | ||
For example, we can totally re-define a value: | ||
# Total Override | ||
panther_config_defaults.py | ||
``` | ||
SUSPICIOUS_DOMAINS = [ "evil.example.com" ] | ||
``` | ||
panther_config_overrides.py | ||
``` | ||
SUSPICIOUS_DOMAINS = [ "betrug.example.com" ] | ||
``` | ||
and at lookup-time: | ||
``` | ||
from panther_config import config | ||
print(config.SUSPICIOUS_DOMAINS) | ||
``` | ||
prints ["betrug.example.com"] | ||
# Mixing Values | ||
panther_config_defaults.py | ||
``` | ||
INTERNAL_NETWORKS = [ "10.0.0.0/8" ] | ||
``` | ||
panther_config_overrides.py | ||
``` | ||
import panther_config_defaults | ||
INTERNAL_NETWORKS = panther_config_defaults.INTERNAL_NETWORKS + [ "192.0.2.0/24" ] | ||
``` | ||
and at lookup-time: | ||
``` | ||
from panther_config import config | ||
print(config.INTERNAL_NETWORKS) | ||
``` | ||
prints ["10.0.0.0/8", "192.0.2.0/24" ] | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AnalysisType: global | ||
GlobalID: "panther_config_overrides" | ||
Filename: panther_config_overrides.py | ||
Description: Overridden Configuration values for Panther |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[tool.black] | ||
line-length = 100 | ||
target-version = ['py39'] | ||
include = '\.pyi?$' | ||
|
||
[tool.isort] | ||
line_length = 100 | ||
profile = "black" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.