From 98bb1004a409769e65379ddd1da6e2c58ef0795b Mon Sep 17 00:00:00 2001 From: carnal0wnage Date: Fri, 23 Jun 2017 08:56:07 -0400 Subject: [PATCH] config stuff --- config/__init__.py | 1 + config/__init__.pyc | Bin 0 -> 142 bytes config/config.py | 33 +++++++++++++++ config/config.pyc | Bin 0 -> 1439 bytes logging_list_monitoring_configuration.py | 50 +++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 config/__init__.py create mode 100644 config/__init__.pyc create mode 100644 config/config.py create mode 100644 config/config.pyc create mode 100644 logging_list_monitoring_configuration.py diff --git a/config/__init__.py b/config/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/config/__init__.py @@ -0,0 +1 @@ + diff --git a/config/__init__.pyc b/config/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13ae580f25b9aed5c45ce03d04c7bf14c863a72d GIT binary patch literal 142 zcmZSn%*&;COD{5+0SXv_v;zCcZ!7m<5O= z8iEESLz)FN1XJ=M4Z|BgqG3cF(WF8$A_-b0S)&&e4#C_axkhrGWS!&&$xV`5B)3W4 zCb>g$m*ht@+N5EPJ&U*QMkxZtlYkl z4$U@fNwJsZ+K#VNf1rBfW%Bv^UT;;0X@pp=$u*odj(G_(BD#ubaX^-6as$Q^2t~An zSfOP|FM{X_Oob-kz5kQ!52{!X(4bq`QYL(=DDZ_xyp ztsxWzzx_k+xvhJ*KOLe-{prJ>K6KgeE`Pn_0_YJ4?pZ)jmk}`DLPsT%smIvvLXljU zI7w4BCZ6&l2BdecwT4s8cExBnV9`8Mc@}5M8T%#ZYK`$%U}@))t=pqscAm_XY|j*6 zJ;|q>^`!X%hLbUi){}wwx%*7?2BP=q*Va+5voE@r%BpN+9r!I@ONTSX(tHcWeIp(S znX?gDZpAn`XHk|f%Ch%GM@g~B=OP_*Iu*~AHueYK#cHhXWy*y`>Bg1#IOEHLQ_E7Y zYv6&nZyIjZd{3vj&A;|5pZXrGfJL%NwL0av%s$tNixz86b1fM;-R8KPklEHD@SBu= za^*bAc{yLrra(E2O>w`!@k3;cqT%+?gM(qkt#-RR7{r)a-0PHWK|AQS``wcjqc67v zr|)p>yJ6Y@gc~5_iTMUx^RYp>&Gy4)Cr{^Rz{oTUQ2d|G3szdTT1U;Y$?MO4vFN+y zxs78!2ce)AM8TKgPH-pqEZD(WhwN#%6*gRVSZbm;mU$Y-eYZG$_iOqpi$bf+S{Lyc xqq2)*C$qL8G)3WWmYo=%_HF(Dvk4E;cW1er&-i;kbvLA1xEbIL??zum{{fRvShoNG literal 0 HcmV?d00001 diff --git a/logging_list_monitoring_configuration.py b/logging_list_monitoring_configuration.py new file mode 100644 index 0000000..2d95f95 --- /dev/null +++ b/logging_list_monitoring_configuration.py @@ -0,0 +1,50 @@ +''' +list config and other logging info +port of https://gist.github.com/cktricky/f19e8d55ea5dcb1fdade6ede588c6576 +''' + +from config.config import * + +#from http://docs.aws.amazon.com/general/latest/gr/rande.html +regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ] + + + + + + + + +def print_section_header_and_footer(text, end=False): + print("-" * 50) + print(text) + print("-" * 50) + + if end: + print("\n\n") + +def print_config_text(text): + print("#" * len(text)) + + +print_section_header_and_footer("BEGINNING OF CONFIG SERVICE REVIEW") + +for region in regions: + response = describe_configuration_recorders(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, region) + + config_service_text = "Config Service Recorders" + print_config_text(config_service_text) + print(config_service_text) + print("Region:" + region) + print_config_text(config_service_text) + + print response + print len(response['ConfigurationRecorders']) + + if len(response['ConfigurationRecorders']) <= 0: + print("NO CONFIGURATION DETECTED") + else: + for group in response['ConfigurationRecorders']: + pp.pprint(group['recordingGroup']) + +print_section_header_and_footer("END OF CONFIG SERVICE REVIEW", True) \ No newline at end of file