PacBot - Policy as Code from T-Mobile OSS

Speaker: Setu Parimi Policy as Code Bot (PacBot) is a platform for continuous compliance monitoring, compliance reporting and security automation for the cloud. In PacBot, security and compliance policies are implemented as code. All resources discovered by PacBot are evaluated against these policies to gauge policy conformance. The PacBot auto-fix framework provides the ability to automatically respond to policy violations by taking predefined actions. PacBot packs in powerful visualization features, giving a simplified view of compliance and making it easy to analyze and remediate policy violations. PacBot is more than a tool to manage cloud misconfiguration, it is a generic platform that can be used to do continuous compliance monitoring and reporting for any domain.

8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 1/15
PacBot – Open Source Compliance
Automation Tool
Published by Setu on February 24, 2019
What is PacBot?
PacBot is Policy as Code Bot which does continuous compliance monitoring, compliance reporting
and security automation for AWS(as of the date I am writing this post) from T-Mobile. In PacBot,
security and compliance policies are implemented as a code. All resources discovered by PacBot are
evaluated against a set of policies to gauge policy conformance.
How to Install PacBot?
Installation instructions for PacBot are located here on their o cial GitHub repo. However, there are
some prerequisites that needs to be installed and you can use this EC2 User Data script to automate
the prerequisites installation process as well. I initially faced several deployment errors during
deploying PacBot and nally was able to deploy the application successfully in using Centos 7 AMI
with a t2.medium instance.
1. #!/bin/bash
2. #EC2 user script to install Pacbot prerequisites for CentOS 7 in /opt directory
3.
4. #Setting up Prereqs
5.
6. cd /opt
7. yum update -y
8. yum install git -y
9. yum install wget -y
10.

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 2/15
Once the EC2 server is ready to use, you need to update the local.py settings le with the Access Keys,
VPC ID, Subnets(different regions), etc and other requested information. The nal steps are to laugh
the UI and kick off the terraform build script.
It will take up to 20mins to complete the terraform build. Once the build is completed you should be
able to access the Internal ELB URL using a windows server launched within the same VPC or using a
11. #Install and setup Python3.6
12.
13. yum install epel-release -y
14. yum install python36-pip -y
15. echo alias python3=python3.6 >> ~/.bashrc
16. echo alias pip3=pip3.6 >> ~/.bashrc
17. source ~/.bashrc
18.
19. #Clone Repo
20.
21. git clone https://github.com/tmobile/pacbot.git
22.
23. #Other Prereqs
24. yum -y install java-1.8.0-openjdk docker maven unzip mysql
25. systemctl start docker
26. wget https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip
27. unzip terraform_0.11.8_linux_amd64.zip
28. mv terraform /usr/bin/
29. pip3.6 install -r /opt/pacbot/installer/requirements.txt
30.
31. #Setup UI components
32. sudo yum install nodejs npm -y
33. cd /opt/pacbot/webapp
34. npm install -g @angular/cli@1.6.8
35. sudo npm install -g bower
36. sudo npm install
37. bower install --allow-root
38.
39. #Copy the default Settings file and create a local.py
40. cp /opt/pacbot/installer/settings/default.local.py
/opt/pacbot/installer/settings/local.py
1. vim /opt/pacbot/installer/settings/local.py <<EOL
2.
3. AWS_ACCESS_KEY = "<>"
4. AWS_SECRET_KEY = "<>"
5. AWS_REGION = "<>"
6. VPC ID: "<>",
7. CIDR_BLOCKS: ["<>"],
8. SUBNETS": ["<>", "<>"]
9. }
10. # Launch UI
11. ng serve &>/dev/null
12. python3.6 /opt/pacbot/installer/manager.py install

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 3/15
VPN tunnel between the VPC and your on-prem network. Don’t forget to update the security group
rules to use the Pacbot Internal ELB from you on-prem network. Note the summary of the build
success message to access Kibana and Elastisearch cluster URLs that were generated as a part of
the build process.
What are the services that the PacBot Installer script deployed?
IAM Roles, IAM Policies, S3 Bucket, RDS, MySQL 5.6.X, Elasticsearch Service, Elasticsearch version
5.5, Redshift, Single Node, Batch, Compute environments, Job De nitions and Job Queues, Elastic
Container Registry, Repositories – for batch job, API and UI, Elastic Container Service – AWS Fargate,
Clusters – for APIs, UI and Batch, Task De nitions – for APIs and UI, Lambda Functions,
SubmitBatchJob and SubmitRuleJob, CloudWatch Rules
How does PacBot does Compliance Automation?
Pacbot discovers resources using AWS Batch Jobs and these assets are evaluated against prede ned
policies(~60) to gauge policy conformance. We can also create and write custom policies as per our
organizational compliance needs. There are two main batch jobs that are responsible to achieve
compliance monitoring
1. PacBot Rule Engine – Runs a prede ned set of rules aganist the assets discovered by PacBot
data collector
2. PacBot Data Collector – Set of batch jobs that run and discover resources in an AWS Account
and stores the information
Screenshots from my PacBot Deployment in a sandbox environment:
PacBot Batch Jobs
PacBot Compute Environment for running the Batch Jobs

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 4/15
batch Jobs Dashboard
Snippet of a few PacBot CloudWatch Rules
Logs for PacBot Application

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 5/15
Asset Overview Board
Tagging Compliance Dashboard(Facing Issues here, working on troubleshooting)
Policy Knowledge base

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 6/15
Assets Dashboard
Policy Violation Search Wizard
Admin – Panel – Compliance Rules

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 7/15
Invoking Ad-Hoc Rules
What are the currently available admin features?
Create Asset Group
Update Asset Group
Delete Asset Group
RulePolicy Con guration
Rule Troubleshooting
How to add multiple AWS Accounts to be monitored PacBot?
1. IAM Role Changes The account where PacBot is installed is called base account. The accounts
that are monitored by PacBot is called client account.
Client Account Change: Create an IAM role named pacbot_ro and attach ReadOnlyAccess,
AmazonGuardDutyReadOnlyAccess & AWSSupportAccess policies. Allow pacbot_ro from
the base account to assume this role. Sample trust con guration for pacbot_ro role is here
1. Base Account Change: Fetch client account pacbot_ro role arn and update / add pacbot_ro
policy which is associated with pacbot_ro role in Base account. Sample pacbot_ro policy
1. Cloudwatch Rule Changes
1. { "Version":"2012-10-17", "Statement":[ {"Effect":"Allow", "Principal":{
"AWS":["arn:aws:iam::Base_Account_ID:role/pacbot_ro"] },
"Action":"sts:AssumeRole" }] }
1. { "Version":"2012-10-17", "Statement":[ {"Sid":"", "Effect":"Allow",
"Action":"sts:AssumeRole", "Resource":
["arn:aws:iam::Client_Account_ID_1:role/pacbot_ro","arn:aws:iam::Client_Account_ID_2:role/
pacbot_ro"] }] }

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 8/15
Update “accountinfo” value (in Constant (JSON text) of cloudwatch rule) with new client account
ids in cloudwatch rule named “AWS-Data-Collector“. Sample con guration
is {"encrypt":false,"value":"Base_Account_ID,Client_Account_ID_1,Client_Accoun
t_ID_2","key":"accountinfo"}
References:
https://github.com/tmobile/pacbot/wiki
My Personal Experiences:
Batch Jobs fail several times while running policy engine rule, and asset collection. The x would
be going ahead and manually invoking the PacBot asset collector lambda function with the
using the cloudwatch rule JSON payload
Create a private hosted zone in AWS and map the internal ELB URL as a CNAME
Add SSL certi cate to Internal ELB and Map the targets with appropriate PacBot Services using
Target Rules in ELB
There will be a need for reverse DNS resolver that needs to be added to AWS Route 53 to access
PacBot private hosted zone CNAME from you internal on-prem network.
Change the default password of PacBot admin by performing a simple CRUD to PacBot RDS
database, instructions are available in PacBot Wiki
The instance which was used to build PacBot setup can be converted to a t2.micro for cost
optimization. Rules can be con gured based to run as per your organization time requirements
to save the cost related to AWS Fargate/ECS/Batch Jobs.
Several issues can occur during the deployment and during the bild destroy process, you can
reach PacBot team and they are “VERY” good at providing some valuable suggestions to resolve
the issues. Their Gitter chat URL: https://gitter.im/TMO-OSS/PacBot
Thank you for reading! – Setu Parimi & Steve George
Sign up for the blog directly here.
Check out our professional services here.
Feedback is welcome! For professional services, fan mail, hate mail, or whatever else,
contact setu@cloudsecops.com
Share this:
      

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 9/15
Related
Security audit using Cloud
Custodian for compliance in AWS
Post Exploitation in AWS using
Nimbostratus
Auditing AWS Environments for
HIPAA Compliance
Like this:
Loading...
June 15, 2018
In “Amazon Web Services”
June 23, 2018
In “Cloud Penetration Testing”
July 16, 2018
In “Cloud Security”
Categories: CLOUD SECURITY TOOLS
Tags: #compliance awssecurity monitoring
  
Leave a Reply
Notify me of follow-up comments by email.
Name *
Email *
Website
What's on your mind?

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 10/15
Notify me of new posts by email.
I'm not a spammer.
POST COMMENT
Subscribe
Categories
Amazon Web Services
Cloud Penetration Testing
Cloud Security
Cloud Security Tools
Cloud Security Tutorial
Uncategorized
Recent Posts
PacBot – Open Source Compliance Automation Tool
Automated Remediation for CloudTrail Disruption
Search … 
Always be the rst to know news related to Cloud Security. We will never spam you.
Email Address
SUBSCRIBE

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 11/15
Shifting strategy from DevOps to DevSecOps
Auditing AWS Environments for HIPAA Compliance
AWS Post Exploitation – Part 1
Related Posts

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 12/15
CLOUD SECURITY
Auditing AWS Environments for HIPAA Compliance
Introduction CloudSploit is an AWS compliance, security and con guration monitoring scanner which is the
rst of its kind. It is an open source project designed to detect security risks in AWS. The CloudSploit Scans
is built Read more…

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 13/15
CLOUD PENETRATION TESTING
Post Exploitation in AWS using Nimbostratus
Introduction Nimbostratus is a tool developed by Andres Riancho for ngerprinting and exploiting Amazon
cloud infrastructures. Nimbostratus uses any application level HTTP proxy vulnerability to enumerate the
instance and credentials from the metadata service which Read more…

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 14/15
AMAZON WEB SERVICES
Security audit using Cloud Custodian for compliance in AWS
Introduction In this article, we will be talking about Cloud Custodian, an open source rules engine for eet
management in AWS. The simple YAML DSL allows you to easily de ne rules to enable a well-managed
Read more…

Kathy
Welcome to CloudSecOps! What brought you here
to check us out?
Type your message…
Chat by Drift
8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations
https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 15/15

Recommended

Build to Hack, Hack to Build by
Build to Hack, Hack to BuildBuild to Hack, Hack to Build
Build to Hack, Hack to BuildCloudVillage
4.6K views46 slides
Phishing in the cloud era by
Phishing in the cloud eraPhishing in the cloud era
Phishing in the cloud eraCloudVillage
4.4K views33 slides
Mining Malevolence: Cryptominers in the Cloud by
Mining Malevolence: Cryptominers in the CloudMining Malevolence: Cryptominers in the Cloud
Mining Malevolence: Cryptominers in the CloudCloudVillage
4.1K views40 slides
Using Splunk or ELK for Auditing AWS/GCP/Azure Security posture by
Using Splunk or ELK for Auditing AWS/GCP/Azure Security postureUsing Splunk or ELK for Auditing AWS/GCP/Azure Security posture
Using Splunk or ELK for Auditing AWS/GCP/Azure Security postureCloudVillage
5.5K views41 slides
ATT&CKing the Sentinel – deploying a threat hunting capability on Azure Senti... by
ATT&CKing the Sentinel – deploying a threat hunting capability on Azure Senti...ATT&CKing the Sentinel – deploying a threat hunting capability on Azure Senti...
ATT&CKing the Sentinel – deploying a threat hunting capability on Azure Senti...CloudVillage
6.2K views25 slides
Battle in the Clouds - Attacker vs Defender on AWS by
Battle in the Clouds - Attacker vs Defender on AWSBattle in the Clouds - Attacker vs Defender on AWS
Battle in the Clouds - Attacker vs Defender on AWSCloudVillage
4.2K views28 slides

More Related Content

Recently uploaded

Multi-objective distributed generation integration in radial distribution sy... by
Multi-objective distributed generation integration in radial  distribution sy...Multi-objective distributed generation integration in radial  distribution sy...
Multi-objective distributed generation integration in radial distribution sy...IJECEIAES
15 views14 slides
Activated sludge process .pdf by
Activated sludge process .pdfActivated sludge process .pdf
Activated sludge process .pdf8832RafiyaAltaf
8 views32 slides
Plumbing by
PlumbingPlumbing
PlumbingIwiss Tools Co.,Ltd
15 views14 slides
DevOps-ITverse-2023-IIT-DU.pptx by
DevOps-ITverse-2023-IIT-DU.pptxDevOps-ITverse-2023-IIT-DU.pptx
DevOps-ITverse-2023-IIT-DU.pptxAnowar Hossain
8 views45 slides
Electrical Crimping by
Electrical CrimpingElectrical Crimping
Electrical CrimpingIwiss Tools Co.,Ltd
25 views22 slides
Codes and Conventions.pptx by
Codes and Conventions.pptxCodes and Conventions.pptx
Codes and Conventions.pptxIsabellaGraceAnkers
7 views5 slides

Recently uploaded(20)

Multi-objective distributed generation integration in radial distribution sy... by IJECEIAES
Multi-objective distributed generation integration in radial  distribution sy...Multi-objective distributed generation integration in radial  distribution sy...
Multi-objective distributed generation integration in radial distribution sy...
IJECEIAES15 views
_MAKRIADI-FOTEINI_diploma thesis.pptx by fotinimakriadi
_MAKRIADI-FOTEINI_diploma thesis.pptx_MAKRIADI-FOTEINI_diploma thesis.pptx
_MAKRIADI-FOTEINI_diploma thesis.pptx
fotinimakriadi7 views
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,... by AakashShakya12
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...
AakashShakya1263 views
fakenews_DBDA_Mar23.pptx by deepmitra8
fakenews_DBDA_Mar23.pptxfakenews_DBDA_Mar23.pptx
fakenews_DBDA_Mar23.pptx
deepmitra812 views
Update 42 models(Diode/General ) in SPICE PARK(DEC2023) by Tsuyoshi Horigome
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L... by Anowar Hossain
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...
Anowar Hossain12 views
Thermal aware task assignment for multicore processors using genetic algorithm by IJECEIAES
Thermal aware task assignment for multicore processors using genetic algorithm Thermal aware task assignment for multicore processors using genetic algorithm
Thermal aware task assignment for multicore processors using genetic algorithm
IJECEIAES31 views
Design of machine elements-UNIT 3.pptx by gopinathcreddy
Design of machine elements-UNIT 3.pptxDesign of machine elements-UNIT 3.pptx
Design of machine elements-UNIT 3.pptx
gopinathcreddy29 views
Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th... by ahmedmesaiaoun
Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th...Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th...
Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th...
ahmedmesaiaoun12 views

Featured

ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
22K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
5.3K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
6.1K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
4.6K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.2K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.7K views42 slides

Featured(20)

ChatGPT and the Future of Work - Clark Boyd by Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd22K views
Getting into the tech field. what next by Tessa Mero
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero5.3K views
Google's Just Not That Into You: Understanding Core Updates & Search Intent by Lily Ray
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray6.1K views
Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.7K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.6K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.6K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.4K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.6K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.2K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.3K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views

PacBot - Policy as Code from T-Mobile OSS

  • 1. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 1/15 PacBot – Open Source Compliance Automation Tool Published by Setu on February 24, 2019 What is PacBot? PacBot is Policy as Code Bot which does continuous compliance monitoring, compliance reporting and security automation for AWS(as of the date I am writing this post) from T-Mobile. In PacBot, security and compliance policies are implemented as a code. All resources discovered by PacBot are evaluated against a set of policies to gauge policy conformance. How to Install PacBot? Installation instructions for PacBot are located here on their o cial GitHub repo. However, there are some prerequisites that needs to be installed and you can use this EC2 User Data script to automate the prerequisites installation process as well. I initially faced several deployment errors during deploying PacBot and nally was able to deploy the application successfully in using Centos 7 AMI with a t2.medium instance. 1. #!/bin/bash 2. #EC2 user script to install Pacbot prerequisites for CentOS 7 in /opt directory 3. 4. #Setting up Prereqs 5. 6. cd /opt 7. yum update -y 8. yum install git -y 9. yum install wget -y 10.  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 2. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 2/15 Once the EC2 server is ready to use, you need to update the local.py settings le with the Access Keys, VPC ID, Subnets(different regions), etc and other requested information. The nal steps are to laugh the UI and kick off the terraform build script. It will take up to 20mins to complete the terraform build. Once the build is completed you should be able to access the Internal ELB URL using a windows server launched within the same VPC or using a 11. #Install and setup Python3.6 12. 13. yum install epel-release -y 14. yum install python36-pip -y 15. echo alias python3=python3.6 >> ~/.bashrc 16. echo alias pip3=pip3.6 >> ~/.bashrc 17. source ~/.bashrc 18. 19. #Clone Repo 20. 21. git clone https://github.com/tmobile/pacbot.git 22. 23. #Other Prereqs 24. yum -y install java-1.8.0-openjdk docker maven unzip mysql 25. systemctl start docker 26. wget https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip 27. unzip terraform_0.11.8_linux_amd64.zip 28. mv terraform /usr/bin/ 29. pip3.6 install -r /opt/pacbot/installer/requirements.txt 30. 31. #Setup UI components 32. sudo yum install nodejs npm -y 33. cd /opt/pacbot/webapp 34. npm install -g @angular/cli@1.6.8 35. sudo npm install -g bower 36. sudo npm install 37. bower install --allow-root 38. 39. #Copy the default Settings file and create a local.py 40. cp /opt/pacbot/installer/settings/default.local.py /opt/pacbot/installer/settings/local.py 1. vim /opt/pacbot/installer/settings/local.py <<EOL 2. 3. AWS_ACCESS_KEY = "<>" 4. AWS_SECRET_KEY = "<>" 5. AWS_REGION = "<>" 6. VPC ID: "<>", 7. CIDR_BLOCKS: ["<>"], 8. SUBNETS": ["<>", "<>"] 9. } 10. # Launch UI 11. ng serve &>/dev/null 12. python3.6 /opt/pacbot/installer/manager.py install  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 3. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 3/15 VPN tunnel between the VPC and your on-prem network. Don’t forget to update the security group rules to use the Pacbot Internal ELB from you on-prem network. Note the summary of the build success message to access Kibana and Elastisearch cluster URLs that were generated as a part of the build process. What are the services that the PacBot Installer script deployed? IAM Roles, IAM Policies, S3 Bucket, RDS, MySQL 5.6.X, Elasticsearch Service, Elasticsearch version 5.5, Redshift, Single Node, Batch, Compute environments, Job De nitions and Job Queues, Elastic Container Registry, Repositories – for batch job, API and UI, Elastic Container Service – AWS Fargate, Clusters – for APIs, UI and Batch, Task De nitions – for APIs and UI, Lambda Functions, SubmitBatchJob and SubmitRuleJob, CloudWatch Rules How does PacBot does Compliance Automation? Pacbot discovers resources using AWS Batch Jobs and these assets are evaluated against prede ned policies(~60) to gauge policy conformance. We can also create and write custom policies as per our organizational compliance needs. There are two main batch jobs that are responsible to achieve compliance monitoring 1. PacBot Rule Engine – Runs a prede ned set of rules aganist the assets discovered by PacBot data collector 2. PacBot Data Collector – Set of batch jobs that run and discover resources in an AWS Account and stores the information Screenshots from my PacBot Deployment in a sandbox environment: PacBot Batch Jobs PacBot Compute Environment for running the Batch Jobs  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 4. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 4/15 batch Jobs Dashboard Snippet of a few PacBot CloudWatch Rules Logs for PacBot Application  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 5. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 5/15 Asset Overview Board Tagging Compliance Dashboard(Facing Issues here, working on troubleshooting) Policy Knowledge base  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 6. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 6/15 Assets Dashboard Policy Violation Search Wizard Admin – Panel – Compliance Rules  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 7. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 7/15 Invoking Ad-Hoc Rules What are the currently available admin features? Create Asset Group Update Asset Group Delete Asset Group RulePolicy Con guration Rule Troubleshooting How to add multiple AWS Accounts to be monitored PacBot? 1. IAM Role Changes The account where PacBot is installed is called base account. The accounts that are monitored by PacBot is called client account. Client Account Change: Create an IAM role named pacbot_ro and attach ReadOnlyAccess, AmazonGuardDutyReadOnlyAccess & AWSSupportAccess policies. Allow pacbot_ro from the base account to assume this role. Sample trust con guration for pacbot_ro role is here 1. Base Account Change: Fetch client account pacbot_ro role arn and update / add pacbot_ro policy which is associated with pacbot_ro role in Base account. Sample pacbot_ro policy 1. Cloudwatch Rule Changes 1. { "Version":"2012-10-17", "Statement":[ {"Effect":"Allow", "Principal":{ "AWS":["arn:aws:iam::Base_Account_ID:role/pacbot_ro"] }, "Action":"sts:AssumeRole" }] } 1. { "Version":"2012-10-17", "Statement":[ {"Sid":"", "Effect":"Allow", "Action":"sts:AssumeRole", "Resource": ["arn:aws:iam::Client_Account_ID_1:role/pacbot_ro","arn:aws:iam::Client_Account_ID_2:role/ pacbot_ro"] }] }  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 8. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 8/15 Update “accountinfo” value (in Constant (JSON text) of cloudwatch rule) with new client account ids in cloudwatch rule named “AWS-Data-Collector“. Sample con guration is {"encrypt":false,"value":"Base_Account_ID,Client_Account_ID_1,Client_Accoun t_ID_2","key":"accountinfo"} References: https://github.com/tmobile/pacbot/wiki My Personal Experiences: Batch Jobs fail several times while running policy engine rule, and asset collection. The x would be going ahead and manually invoking the PacBot asset collector lambda function with the using the cloudwatch rule JSON payload Create a private hosted zone in AWS and map the internal ELB URL as a CNAME Add SSL certi cate to Internal ELB and Map the targets with appropriate PacBot Services using Target Rules in ELB There will be a need for reverse DNS resolver that needs to be added to AWS Route 53 to access PacBot private hosted zone CNAME from you internal on-prem network. Change the default password of PacBot admin by performing a simple CRUD to PacBot RDS database, instructions are available in PacBot Wiki The instance which was used to build PacBot setup can be converted to a t2.micro for cost optimization. Rules can be con gured based to run as per your organization time requirements to save the cost related to AWS Fargate/ECS/Batch Jobs. Several issues can occur during the deployment and during the bild destroy process, you can reach PacBot team and they are “VERY” good at providing some valuable suggestions to resolve the issues. Their Gitter chat URL: https://gitter.im/TMO-OSS/PacBot Thank you for reading! – Setu Parimi & Steve George Sign up for the blog directly here. Check out our professional services here. Feedback is welcome! For professional services, fan mail, hate mail, or whatever else, contact setu@cloudsecops.com Share this:         Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 9. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 9/15 Related Security audit using Cloud Custodian for compliance in AWS Post Exploitation in AWS using Nimbostratus Auditing AWS Environments for HIPAA Compliance Like this: Loading... June 15, 2018 In “Amazon Web Services” June 23, 2018 In “Cloud Penetration Testing” July 16, 2018 In “Cloud Security” Categories: CLOUD SECURITY TOOLS Tags: #compliance awssecurity monitoring    Leave a Reply Notify me of follow-up comments by email. Name * Email * Website What's on your mind?  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 10. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 10/15 Notify me of new posts by email. I'm not a spammer. POST COMMENT Subscribe Categories Amazon Web Services Cloud Penetration Testing Cloud Security Cloud Security Tools Cloud Security Tutorial Uncategorized Recent Posts PacBot – Open Source Compliance Automation Tool Automated Remediation for CloudTrail Disruption Search …  Always be the rst to know news related to Cloud Security. We will never spam you. Email Address SUBSCRIBE  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 11. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 11/15 Shifting strategy from DevOps to DevSecOps Auditing AWS Environments for HIPAA Compliance AWS Post Exploitation – Part 1 Related Posts  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 12. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 12/15 CLOUD SECURITY Auditing AWS Environments for HIPAA Compliance Introduction CloudSploit is an AWS compliance, security and con guration monitoring scanner which is the rst of its kind. It is an open source project designed to detect security risks in AWS. The CloudSploit Scans is built Read more…  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 13. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 13/15 CLOUD PENETRATION TESTING Post Exploitation in AWS using Nimbostratus Introduction Nimbostratus is a tool developed by Andres Riancho for ngerprinting and exploiting Amazon cloud infrastructures. Nimbostratus uses any application level HTTP proxy vulnerability to enumerate the instance and credentials from the metadata service which Read more…  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 14. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 14/15 AMAZON WEB SERVICES Security audit using Cloud Custodian for compliance in AWS Introduction In this article, we will be talking about Cloud Custodian, an open source rules engine for eet management in AWS. The simple YAML DSL allows you to easily de ne rules to enable a well-managed Read more…  Kathy Welcome to CloudSecOps! What brought you here to check us out? Type your message… Chat by Drift
  • 15. 8/19/2019 PacBot - Open Source Compliance Automation Tool - Cloud Security Operations https://cloudsecops.com/pacbot-open-source-compliance-automation-tool/ 15/15