Skip to content

Commit 22dc71c

Browse files
author
Kinnaird McQuade
committed
Update access levels, add Makefile, update IAM definition, update dependencies
1 parent b61864f commit 22dc71c

File tree

11 files changed

+3015
-1004
lines changed

11 files changed

+3015
-1004
lines changed

Makefile

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
SHELL:=/bin/bash
2+
3+
PROJECT := policy-sentry
4+
PROJECT_UNDERSCORE := policy_sentry
5+
6+
.PHONY: setup-env
7+
setup-env:
8+
python3 -m venv ./venv && source venv/bin/activate
9+
python3 -m pip install -r requirements.txt
10+
11+
.PHONY: setup-dev
12+
setup-dev: setup-env
13+
python3 -m pip install -r requirements-dev.txt
14+
15+
.PHONY: build-docs
16+
build-docs: setup-dev
17+
mkdocs build
18+
19+
.PHONY: serve-docs
20+
serve-docs: setup-dev
21+
mkdocs serve --dev-addr "127.0.0.1:8001"
22+
23+
.PHONY: build
24+
build: setup-env clean
25+
python3 -m pip install --upgrade setuptools wheel
26+
python3 -m setup -q sdist bdist_wheel
27+
28+
.PHONY: install
29+
install: build
30+
python3 -m pip install -q ./dist/${PROJECT}*.tar.gz
31+
${PROJECT} --help
32+
33+
.PHONY: uninstall
34+
uninstall:
35+
python3 -m pip uninstall ${PROJECT} -y
36+
python3 -m pip uninstall -r requirements.txt -y
37+
python3 -m pip uninstall -r requirements-dev.txt -y
38+
python3 -m pip freeze | xargs python3 -m pip uninstall -y
39+
40+
.PHONY: clean
41+
clean:
42+
rm -rf dist/
43+
rm -rf build/
44+
rm -rf *.egg-info
45+
find . -name '*.pyc' -delete
46+
find . -name '*.pyo' -delete
47+
find . -name '*.egg-link' -delete
48+
find . -name '*.pyc' -exec rm --force {} +
49+
find . -name '*.pyo' -exec rm --force {} +
50+
51+
.PHONY: test
52+
test: setup-dev
53+
python3 -m coverage run -m pytest -v
54+
55+
.PHONY: security-test
56+
security-test: setup-dev
57+
bandit -r ./${PROJECT_UNDERSCORE}/
58+
59+
.PHONY: fmt
60+
fmt: setup-dev
61+
black ${PROJECT_UNDERSCORE}/
62+
63+
.PHONY: lint
64+
lint: setup-dev
65+
pylint ${PROJECT_UNDERSCORE}/
66+
67+
.PHONY: publish
68+
publish: build
69+
python3 -m pip install --upgrade twine
70+
python3 -m twine upload dist/*
71+
python3 -m pip install ${PROJECT}
72+
73+
.PHONY: count-loc
74+
count-loc:
75+
echo "If you don't have tokei installed, you can install it with 'brew install tokei'"
76+
echo "Website: https://github.com/XAMPPRocky/tokei#installation'"
77+
tokei ./* --exclude --exclude '**/*.html' --exclude '**/*.json' --exclude "docs/*" --exclude "examples/*" --exclude "test/*"
78+
79+
.PHONY: update-iam-data
80+
update-iam-data:
81+
python3 ./utils/download_docs.py

docs/requirements.txt

Lines changed: 6 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,10 @@ atomicwrites==1.4.0
33
distlib==0.3.1
44
filelock==3.0.12
55
mkdocs==1.1.2
6-
mkdocs-material==6.2.3
6+
mkdocs-material==7.0.6
77
mkdocs-material-extensions==1.0.1
8-
mkdocstrings==0.13.6
9-
Pygments==2.7.4
10-
pymdown-extensions==8.1
11-
pytkdocs==0.9.0
12-
virtualenv==20.2.2
13-
virtualenv-clone==0.5.4
14-
# From the rest of requirements-dev.txt... not sure what is required in order for RTD to auto-include the Python Classes in the library reference section
15-
appdirs==1.4.4
16-
astroid==2.4.2
17-
attrs==20.3.0
18-
bandit==1.7.0
19-
beautifulsoup4==4.9.3
20-
black==20.8b1
21-
boto3==1.16.43
22-
botocore==1.19.43
23-
certifi==2020.12.5
24-
chardet==4.0.0
25-
click==7.1.2
26-
contextlib2==0.6.0.post1
27-
coverage==5.4
28-
docutils==0.16
29-
dparse==0.5.1
30-
future==0.18.2
31-
gitdb==4.0.5
32-
GitPython==3.1.11
33-
idna==2.10
34-
importlib-metadata==3.3.0
35-
invoke==1.4.1
36-
isort==5.7.0
37-
Jinja2==2.11.3
38-
jmespath==0.10.0
39-
joblib==1.0.0
40-
lazy-object-proxy==1.4.*
41-
livereload==2.6.3
42-
lunr==0.5.8
43-
markdown==3.3.3
44-
MarkupSafe==1.1.1
45-
mccabe==0.6.1
46-
more-itertools==8.6.0
47-
nltk==3.5
48-
nose==1.3.7
49-
packaging==20.8
50-
pathspec==0.8.1
51-
pbr==5.5.1
52-
pluggy==0.13.1
53-
py==1.10.0
54-
pylint==2.6.1
55-
pyparsing==2.4.7
56-
pytest==6.2.2
57-
python-dateutil==2.8.1
58-
PyYAML==5.4.1
59-
regex==2020.11.13
60-
requests==2.25.1
61-
s3transfer==0.3.3
62-
safety==1.10.0
63-
schema==0.7.3
64-
six==1.15.0
65-
smmap==3.0.4
66-
soupsieve==2.1
67-
stevedore==3.3.0
68-
toml==0.10.2
69-
tornado==6.1
70-
tqdm==4.56.0
71-
typed-ast==1.4.1
72-
urllib3==1.26.4
73-
wcwidth==0.2.5
74-
wrapt==1.12.1
75-
zipp==3.4.0
8+
mkdocstrings==0.15.0
9+
Pygments==2.8.1
10+
pymdown-extensions==8.1.1
11+
pytkdocs==0.11.0
12+

policy_sentry/bin/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# pylint: disable=missing-module-docstring
2-
__version__ = "0.11.5"
2+
__version__ = "0.11.6"

policy_sentry/shared/awsdocs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def create_database(destination_directory, access_level_overrides_file):
248248
continue
249249
else:
250250
api_documentation_link = link.attrs.get('href')
251-
print(api_documentation_link)
251+
logger.debug(api_documentation_link)
252252
priv = chomp(link.text)
253253
if priv == "":
254254
priv = chomp(cells[0].text)

policy_sentry/shared/data/access-level-overrides.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ ecr:
109109
# AWS documentation lists this as Write
110110
Permissions management:
111111
- deleterepositorypolicy
112+
- putregistrypolicy
113+
- deleteregistrypolicy
112114
es:
113115
Permissions management:
114116
- createelasticsearchdomain
@@ -357,7 +359,9 @@ rds:
357359
- createdbsubnetgroup
358360
- createeventsubscription
359361
- createoptiongroup
360-
# AWS documentation lists this as "Permissions management"
362+
Permissions management:
363+
- modifydbsnapshotattribute
364+
- modifydbclustersnapshotattribute
361365
redshift:
362366
# AWS documentation lists this as "Permissions management"
363367
Write:
@@ -383,6 +387,10 @@ securityhub:
383387
Tagging:
384388
- untagresource
385389
- tagresource
390+
ses:
391+
Permissions management:
392+
- putidentitypolicy
393+
- deleteidentitypolicy
386394
sns:
387395
Permissions management:
388396
- settopicattributes

0 commit comments

Comments
 (0)