In case you missed it, check out Part 1: Monocle: How Chime creates a proactive security & engineering culture (Part 1)
At Chime, we’re big fans of Gitops, where all application and infrastructure changes are done via pull requests. In this article, we’ll share the guardrails and tooling we’ve put in place to prevent mistakes before pull requests are merged.
When a pull request is merged, there’s a chance the new code will introduce bugs, misconfiguration, or vulnerabilities. Following security best practices should be made easy for developers, so we created tooling that gives security feedback on pull requests, where it’s simple to make edits.
Chime’s guidelines for pull requests
We expect all production repositories and pull requests to follow a few rules to reduce the risk of defects, with an emphasis on reliable and secure software.
For now, we want all pull requests (PRs) to satisfy the following prior to being merged (this changes over time):
PRs must have 1 or more code reviews
PRs to Ruby repositories must not introduce dependency confusion vulnerabilities
Repositories must use security-approved base images, which we patch automatically on a cadence
New code does not introduce critical or high vulnerabilities (keep an eye out for our upcoming article on Overwatch, with details on how we find and fix these)
How we apply rules to production pull requests with Risk Advisor
Here’s a demo of how we set up the Monocle GitHub app to receive pull request events and post an informative Risk Advisor status to pull requests. If a person merges a pull request while failing a Risk Advisor rule, then a Risk Acceptance JIRA ticket is created. Their team channel is informed, as well as the security team’s on-call person, making it easy for everyone to follow up and see when the engineer resolves the risk.
Watch a demo here.
Education and Reporting
We are very happy with how Risk Advisor interacts with engineers. Risk Advisor is not a blocking check, which allows engineers to get their work done even during an incident. We realize that we don’t always have the context of why something is being done. For example, our security scanners might be down, and if an engineer responds to an incident they might merge a Pull Request without having our scanner successfully complete. We let them go through with the change and follow up later to make sure the code was written safely.
As engineers work in Github they get real-time feedback from Risk Advisor statuses at the bottom of their pull requests, where they can click through to learn about the rules and why they’re important.
![[CC] MONOCLE MERGE - media](/_ctf-img/ao7gxs2zk32d/kprp9zuOehEWzzlw5xlVa/ab7c7c64d788cf5377db4a44c7adb250/Monocle_part_2_-_1.webp?fm=webp&w=800&fit=fill&q=50)
![[CC] Monocle Part 2 - Media - 2](/_ctf-img/ao7gxs2zk32d/26Z6IhEABkCd43BjTiXjn0/b3a42c6594415a4a12177fd02691c4f2/Monocle_Part_2_-_2.webp?fm=webp&w=800&fit=fill&q=50)
Reporting is simple because Risk Advisor creates JIRA tickets. JIRA tickets can be easily transitioned, resolved, and put into dashboards for the Security team and Compliance team to monitor.

![[CC] Monocle - Media - 3](/_ctf-img/ao7gxs2zk32d/4RsgUcqOZSMkoJcDW5Xokv/2e7faa7d6ab449c57f917f7074ded00e/Monocle_Part_2_-_3.webp?fm=webp&w=800&fit=fill&q=50)
![[CC] Monocle - Media - 4](/_ctf-img/ao7gxs2zk32d/2XPRoVekLIeL2POhfBW8Lu/fce601879c036e873f71ac1784786303/Monocle_Part_2_-_4.webp?fm=webp&w=800&fit=fill&q=50)
![[CC] Monocle - Media - 5](/_ctf-img/ao7gxs2zk32d/7MdLNiXjTvfMaNxAMgc867/b95f945814d94a477a446a1f4689cb10/Monocle_Part_2_-_5.webp?fm=webp&w=800&fit=fill&q=50)
![[CC] Monocle - Media - 6](/_ctf-img/ao7gxs2zk32d/5721Zv6gKqCAobdHVNktzg/86360b589b4800156131409b37b4ea1d/Monocle_Part_2_-_6.webp?fm=webp&w=800&fit=fill&q=50)