orchestrating security tooling with aws step functions
play

Orchestrating Security Tooling With AWS Step Functions 1 - PowerPoint PPT Presentation

Orchestrating Security Tooling With AWS Step Functions 1 Background Jules Denardou Justin Massey @Pod_Sec @jmassey09 @JulesDT @th3r3p0 Security Engineers at Datadog Product Security team Improve security of product without


  1. Orchestrating Security Tooling With AWS Step Functions 1

  2. Background Jules Denardou Justin Massey @Pod_Sec @jmassey09 @JulesDT @th3r3p0 Security Engineers at Datadog ● Product Security team ● Improve security of product without detrimental impact to the developers ● workflows 2

  3. 3

  4. Goals: Developers own the security of their app 4

  5. Goals: Developers own the security of their app Find bugs early. Fix bugs early. 5

  6. Security Tooling and CI/CD A Love/Hate Relationship 6

  7. Security tooling and CI/CD ● Security tools often don’t integrate with CI/CD Long running jobs ○ False positives ○ Each tool has its own way of giving a report ○ 7

  8. Security tooling and CI/CD ● Security tools often don’t integrate with CI/CD Long running jobs ○ False positives ○ Each tool has its own way of giving a report ○ 8

  9. Security tooling and CI/CD ● Security tools often don’t integrate with Dev Workflows Blocking deployment pipelines ○ Reports in a third party website ○ 9

  10. Security tooling and CI/CD ● Security tools often don’t integrate with Dev Workflows Blocking deployment pipelines ○ Reports in a third party website ○ 10

  11. Plugin Based Workflow 11

  12. Plugin Based Workflow Triggers 12

  13. Plugin Based Workflow Triggers Processors 13

  14. Plugin Based Workflow Triggers Processors Outputs 14

  15. Our Solution 15

  16. Our Solution Github PR 16

  17. Our Solution Webhook Github PR API Gateway 17

  18. Our Solution Webhook Github PR Lambda Function API Gateway 18

  19. Our Solution API Security Scanning Webhook Github PR Lambda Function API Gateway 19

  20. Our Solution API Security Scanning API Webhook Github PR Lambda Function API Gateway 20 Github PR Comment

  21. Issues With This Solution Time Some scans take > 30 min ● Lambdas timeout out after 300 seconds ● 21

  22. Issues with 1st Solution Time Some scans take > 30 min ● Lambdas timeout out after 300 seconds ● 22

  23. Issues with 1st Solution Time Some scans take > 30 min ● Lambdas timeout out after 300 seconds ● Notifications Some scans have no way to notify you when complete ● 23

  24. Design ● First implementation 24

  25. Design ● First implementation AWS Lambdas 25

  26. Design First implementation ● 26

  27. Design ● First implementation AWS Lambdas ○ 27

  28. Design ● Alternative: AWS Step Functions 28

  29. Design ● Alternative: AWS Step Functions State Machine ○ Amazon States Language ◻ Individual States ○ Step Function console = State Machine GUI ○ 29

  30. Design ● States Task ○ Choice ○ Pass ○ Delay ○ Parallel ○ Success or Failure ○ 30

  31. Design Individual State State Machine 31

  32. Design 32

  33. Demo ! 33

  34. 34

  35. Design 35

  36. Design ● Integrating Github & AWS: Incompatible by default 36

  37. Design ● Integrating Github & AWS: Incompatible by default Github uses HMAC signed events ○ 37

  38. Design ● Integrating Github & AWS: Incompatible by default Github uses HMAC signed events ○ AWS API Gateway uses an “Authorizer” ○ 38

  39. Design ● Integrating Github & AWS: Incompatible by default Implement a custom authorizer as a first step of the Step function ○ Yes No 39

  40. Design ● Integrating Github & AWS: Incompatible by default Implement a custom authorizer as a first step of the Step function ○ 40

  41. Design 41

  42. Design 42

  43. Design 43

  44. Design 44

  45. Design 45

  46. Design 46

  47. Design 47

  48. Design 48

  49. Design 49

  50. Design 50

  51. Design 51

  52. Design 52

  53. Design 53

  54. Design 54

  55. Design 55

  56. Sifting through logs... 56

  57. 57

  58. 58

  59. Searching for an ID unique to the state machine: print(event) print(context) 59

  60. It 60

  61. It doesn’t 61

  62. It doesn’t exist 62

  63. 63

  64. Solution 1. Generate a Unique ID in the first lambda (state_id) 64

  65. Solution 1. Generate a Unique ID in the first lambda (state_id) 2. Override `logging.Filter.filter()` 65

  66. Solution 1. Generate a Unique ID in the first lambda 2. Override `logging.Filter.filter()` 3. Use custom filter 66

  67. Design and Implement 67

  68. 68

  69. Developer feedback 69

  70. Developer feedback ● Important part of the project: the developer Developer engagement is crucial ○ 70

  71. Developer feedback ● Important part of the project: the developer Developer engagement is crucial ○ We need to give the results in the best way possible ○ 71

  72. Developer feedback ● Important part of the project: the developer Developer engagement is crucial ○ We need to give the results in the best way possible ○ Low-noise, easy to read, where the developer is ○ 72

  73. Developer feedback ● Important part of the project: the developer Developer engagement is crucial ○ We need to give the results in the best way possible ○ Low-noise, easy to read, where the developer is ○ Make issues found actionable ○ 73

  74. Developer feedback ● Important part of the project: the developer Developer engagement is crucial ○ We need to give the results in the best way possible ○ Low-noise, easy to read, where the developer is ○ Make issues found actionable ○ ● The developer is our “customer” 74

  75. Developer feedback ● We reach out to them Send organization wide emails asking for feedback ○ Application Security focus group ○ Direct discussion with developers ○ 75

  76. Developer feedback ● We reach out to them Send organization wide emails asking for feedback ○ Application Security focus group ○ Direct discussion with developers ○ 76

  77. Developer feedback ● Follow their workflows Use the same CI/CD tools ○ Try to use the same technologies ○ ● Helps understanding their constraints 77

  78. Developer feedback ● Our current solution Comment on the PR ○ This is where the dev is looking 78

  79. Developer feedback ● Our current solution Comment on the PR ○ This is where the dev is looking ● Our plan for the future All the scans in a single comment ○ “Auto-fix” PR (when possible) created and linked for review ○ 79

  80. Deployment 80

  81. Deployment GitHub Authorizer ● GitHub Trigger ● Plugin that uses Go Security Scanner ● GitHub PR Commenter ● Slack Output ● 81

  82. Deployment ● Lambdas Serverless framework ○ 82

  83. Deployment ● Lambdas Serverless framework ○ ● IAM, Step Function, API Gateway Terraform ○ 83

  84. Thank you! Questions? Jules Denardou Justin Massey @Pod_Sec @jmassey09 @JulesDT @th3r3p0 We are hiring: Paris, New York, and remote! 84

Recommend


More recommend