qontract-reconcile 0.10.1rc99__py3-none-any.whl → 0.10.1rc101__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/METADATA +1 -1
- {qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/RECORD +6 -7
- reconcile/cli.py +0 -16
- reconcile/github_scanner.py +0 -74
- {qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/WHEEL +0 -0
- {qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/entry_points.txt +0 -0
- {qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/top_level.txt +0 -0
{qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: qontract-reconcile
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1rc101
|
4
4
|
Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
|
5
5
|
Home-page: https://github.com/app-sre/qontract-reconcile
|
6
6
|
Author: Red Hat App-SRE Team
|
@@ -7,7 +7,7 @@ reconcile/aws_iam_password_reset.py,sha256=NwErtrqgBiXr7eGCAHdtGGOx0S7-4JnSc29Ie
|
|
7
7
|
reconcile/aws_support_cases_sos.py,sha256=i6bSWnlH9fh14P14PjVhFLwNl-q3fD733_rXKM_O51c,2992
|
8
8
|
reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=W_VJagnsJR1v5oqjlI3RJJE0_nhtJ0m81RS8zWA5u5c,3538
|
9
9
|
reconcile/checkpoint.py,sha256=figtZRuWUvdpdSnkhAqeGvO5dI02TT6J3heyeFhlwqM,5016
|
10
|
-
reconcile/cli.py,sha256=
|
10
|
+
reconcile/cli.py,sha256=aWQIjLA2O8Xm_SyywdC0RbmyXl_j4g7EXlm30kGqxxY,71691
|
11
11
|
reconcile/closedbox_endpoint_monitoring_base.py,sha256=0xg_d8dwd36Y8GY1mE-LLO1LQpPEMM77bzAfc_KdgzU,4870
|
12
12
|
reconcile/cluster_deployment_mapper.py,sha256=2Ah-nu-Mdig0pjuiZl_XLrmVAjYzFjORR3dMlCgkmw0,2352
|
13
13
|
reconcile/dashdotdb_base.py,sha256=Ca75-OQiu5HeA8Q6zQpEYuhyCSjeuWe99K4y9ipTORM,4032
|
@@ -22,7 +22,6 @@ reconcile/github_org.py,sha256=t0oEk4XPMiOLpVvPockMVeBVdmZShXj6Ol7wUISFrT4,13479
|
|
22
22
|
reconcile/github_owners.py,sha256=QWX-BX3-sHAPnVAR2fZXUTgIdWnfMDDyalcZINr6i1s,2949
|
23
23
|
reconcile/github_repo_invites.py,sha256=n5_gUcGotBBnvx3F41auCqX_gbZKut_XRTWGlsrKE8U,2697
|
24
24
|
reconcile/github_repo_permissions_validator.py,sha256=dcbXdUx6imjNchjp3pg9-z1i7lFEGOr_28GvsiwO5Xw,1734
|
25
|
-
reconcile/github_scanner.py,sha256=kjOzyTpyHQHCaGbEnVY-1rO51Iuqrx9xBtm3TL7dui0,2404
|
26
25
|
reconcile/github_users.py,sha256=nfTq78QRONIfDVj-5O3bD6psllJjzWFnog-EJ1WqFPU,3672
|
27
26
|
reconcile/github_validator.py,sha256=cVTVxJIGR4a1Jz8wrdXEAb_CMpXUzvykVmUURX4cook,917
|
28
27
|
reconcile/gitlab_fork_compliance.py,sha256=aJy4dZ01P-4yf6I8uxFujiJJGamhr4Gfb0YwOIWAJCg,4247
|
@@ -598,8 +597,8 @@ tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y
|
|
598
597
|
tools/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
599
598
|
tools/test/test_qontract_cli.py,sha256=awwTHEc2DWlykuqGIYM0WOBoSL0KRnOraCLk3C7izis,1401
|
600
599
|
tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
|
601
|
-
qontract_reconcile-0.10.
|
602
|
-
qontract_reconcile-0.10.
|
603
|
-
qontract_reconcile-0.10.
|
604
|
-
qontract_reconcile-0.10.
|
605
|
-
qontract_reconcile-0.10.
|
600
|
+
qontract_reconcile-0.10.1rc101.dist-info/METADATA,sha256=_kJQYrBFs0qQ6bCuhoKvJ6eJJ26Lmnk99COXLTTQDIQ,2291
|
601
|
+
qontract_reconcile-0.10.1rc101.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
602
|
+
qontract_reconcile-0.10.1rc101.dist-info/entry_points.txt,sha256=Af70EWPJxsTiCNF6gA-pWdw1A0Heqn-PZF-oBc5NmiU,302
|
603
|
+
qontract_reconcile-0.10.1rc101.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
|
604
|
+
qontract_reconcile-0.10.1rc101.dist-info/RECORD,,
|
reconcile/cli.py
CHANGED
@@ -640,22 +640,6 @@ def github_users(ctx, gitlab_project_id, thread_pool_size, enable_deletion, send
|
|
640
640
|
)
|
641
641
|
|
642
642
|
|
643
|
-
@integration.command(
|
644
|
-
short_help="Scan GitHub repositories for leaked keys "
|
645
|
-
"and remove them (only submits PR)."
|
646
|
-
)
|
647
|
-
@gitlab_project_id
|
648
|
-
@threaded()
|
649
|
-
@binary(["git", "git-secrets"])
|
650
|
-
@click.pass_context
|
651
|
-
def github_scanner(ctx, gitlab_project_id, thread_pool_size):
|
652
|
-
import reconcile.github_scanner
|
653
|
-
|
654
|
-
run_integration(
|
655
|
-
reconcile.github_scanner, ctx.obj, gitlab_project_id, thread_pool_size
|
656
|
-
)
|
657
|
-
|
658
|
-
|
659
643
|
@integration.command(short_help="Validates GitHub organization settings.")
|
660
644
|
@click.pass_context
|
661
645
|
def github_validator(ctx):
|
reconcile/github_scanner.py
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
|
3
|
-
from github.GithubException import UnknownObjectException
|
4
|
-
from sretoolbox.utils import (
|
5
|
-
retry,
|
6
|
-
threaded,
|
7
|
-
)
|
8
|
-
|
9
|
-
import reconcile.aws_support_cases_sos as aws_sos
|
10
|
-
from reconcile import queries
|
11
|
-
from reconcile.github_users import init_github
|
12
|
-
from reconcile.utils import git_secrets
|
13
|
-
from reconcile.utils.aws_api import AWSApi
|
14
|
-
|
15
|
-
QONTRACT_INTEGRATION = "github-scanner"
|
16
|
-
|
17
|
-
|
18
|
-
def strip_repo_url(repo_url):
|
19
|
-
return repo_url.rstrip("/").replace(".git", "")
|
20
|
-
|
21
|
-
|
22
|
-
@retry(max_attempts=6)
|
23
|
-
def get_all_repos_to_scan(repos):
|
24
|
-
logging.info("getting full list of repos")
|
25
|
-
all_repos = []
|
26
|
-
all_repos.extend([strip_repo_url(r) for r in repos])
|
27
|
-
g = init_github()
|
28
|
-
for r in repos:
|
29
|
-
logging.debug("getting forks: {}".format(r))
|
30
|
-
repo_name = r.replace("https://github.com/", "")
|
31
|
-
try:
|
32
|
-
repo = g.get_repo(repo_name)
|
33
|
-
forks = repo.get_forks()
|
34
|
-
all_repos.extend([strip_repo_url(f.clone_url) for f in forks])
|
35
|
-
except UnknownObjectException:
|
36
|
-
logging.error("not found {}".format(r))
|
37
|
-
|
38
|
-
return all_repos
|
39
|
-
|
40
|
-
|
41
|
-
def run(dry_run, gitlab_project_id=None, thread_pool_size=10):
|
42
|
-
accounts = queries.get_aws_accounts()
|
43
|
-
settings = queries.get_app_interface_settings()
|
44
|
-
with AWSApi(thread_pool_size, accounts, settings=settings) as aws:
|
45
|
-
existing_keys = aws.get_users_keys()
|
46
|
-
existing_keys_list = [
|
47
|
-
key
|
48
|
-
for user_key in existing_keys.values()
|
49
|
-
for keys in user_key.values()
|
50
|
-
for key in keys
|
51
|
-
]
|
52
|
-
logging.info("found {} existing keys".format(len(existing_keys_list)))
|
53
|
-
|
54
|
-
app_int_github_repos = queries.get_repos(server="https://github.com")
|
55
|
-
all_repos = get_all_repos_to_scan(app_int_github_repos)
|
56
|
-
logging.info("about to scan {} repos".format(len(all_repos)))
|
57
|
-
|
58
|
-
results = threaded.run(
|
59
|
-
git_secrets.scan_history,
|
60
|
-
all_repos,
|
61
|
-
thread_pool_size,
|
62
|
-
existing_keys=existing_keys_list,
|
63
|
-
)
|
64
|
-
all_leaked_keys = [key for keys in results for key in keys]
|
65
|
-
|
66
|
-
deleted_keys = aws_sos.get_deleted_keys(accounts)
|
67
|
-
keys_to_delete = [
|
68
|
-
{"account": account, "key": key}
|
69
|
-
for key in all_leaked_keys
|
70
|
-
for account, user_keys in existing_keys.items()
|
71
|
-
if key in [uk for uks in user_keys.values() for uk in uks]
|
72
|
-
and key not in deleted_keys[account]
|
73
|
-
]
|
74
|
-
aws_sos.act(dry_run, gitlab_project_id, accounts, keys_to_delete)
|
File without changes
|
File without changes
|
{qontract_reconcile-0.10.1rc99.dist-info → qontract_reconcile-0.10.1rc101.dist-info}/top_level.txt
RENAMED
File without changes
|