Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Policy Engines

ttffdd
August 23, 2023

Policy Engines

ttffdd

August 23, 2023
Tweet

More Decks by ttffdd

Other Decks in Programming

Transcript

  1. Whoami • Denis ttffdd Rybin • 9 years of security

    experience • A fan of security conferences • Currently working as a tech lead at InDrive (3 million deals per day)
  2. Agenda 1. What do we want to achieve as a

    security team? 2. What is the concept of a policy engine? 3. What has already been done in this direction?
  3. The main objective of security A lot of people would

    say Confidentiality, Integrity And Availability – The CIA Triad
  4. The main objective of security Confidentiality, Integrity And Availability –

    The CIA Triad Maybe? Generally yes, but let's discuss something more tangible)
  5. The main objective of security Let's keep it simple and

    choose an easier thesis Allow what is necessary, forbid what is not.
  6. The main objective of security Yeah, it’s Principle of least

    privilege If we could comply with it, we wouldn't have to do anything else
  7. The main objective of security Just look at AppSec trends:

    • Bug Bounty program • Defence in depth • SOC
  8. The main objective of security Just look at AppSec trends:

    • Bug Bounty program • Defence in depth • SOC We don't believe our policies work
  9. The main objective of security Why? Сlap who thinks that

    IT department is to blame. Their systems are too unstructured, too volatile, too dependent on people etc
  10. The main objective of security Why? Сlap who thinks that

    IT department is to blame. Their systems are too unstructured, too volatile, too dependent on people etc
  11. The main objective of security But they are constantly evolving:

    - Infrastructure as code - Modern CI/CD (gitops, devops, etc) - Automated QA testing - Scrum and Kanban And now we have a lot more opportunities
  12. What is the concept of a policy engine? • Policy

    Decoupling • Policy as Code • Not just a single-purpose tool, but a new big trend
  13. Policy Decoupling What are we used to? • Iptables rules

    • Windows ACL • Jira/gitlab roles and permissions
  14. Policy Decoupling What Policy Decoupling offers us? • Universal rule

    language • A single point of decision-making Policy Engine
  15. Policy as Code Everything we love about code: • Version

    Control • High flexibility • Programmer friendly • Declarative • Easy to test • Etc
  16. OPA != Kubernetes security Let's end this quickly! OPA is

    not about Kubernetes, OPA gatekeeper is. You could (and even maybe should) use policy engine like OPA gatekeeper/kyverno/kubeWarden in K8S. But OPA is much more than that.
  17. BTW the reference architecture can be seen in the OPA

    gatekeeper architecture PEP PDP Polices + PAP Part of PIP
  18. Some examples of interesting uses of OPA. Conftest Write tests

    against structured configuration data using the Open Policy Agent Rego query language
  19. Some examples of interesting uses of OPA. OPToggles It enables

    you to create user targeted feature flags/toggles based on Open Policy managed authorization rules.
  20. Some examples of interesting uses of OPA. Opa-iptables opa-iptables extension

    provides the management of IPTables rules with Rego policy. Here OPA is used as a centralized location for storing rules and write a context-aware policy to insert/delete rules to Linux host.