How to use mitmdump inside AWS CodeBuild?

Viewed 36

I need to log all HTTPS traffic from an AWS CodeBuild into a file. I'm trying to do this by using mitmdump (mitmproxy cli)

This is my current buildspec.yml

version: 0.2

phases:
  build:
    on-failure: CONTINUE
    commands:
      - sudo apt-get update
      - sudo apt-get -y install mitmproxy
      - mitmdump -w mitmdump.txt > mitmlog.txt &
      - sleep 5 # just to be sure
      - curl https://github.com/
      # there will be a lot of other https requests from this point which I can't control
      # they will simply be placed here and executed
artifacts:
  files:
    - 'mitmdump.txt'
    - 'mitmlog.txt'

The results are, mitmdump.txt empty and mitmlog.txt has only one line written:

Proxy server listening at http://*:8080

I've also tried:

- mitmdump --listen-port 443 -w mitmdump.txt > mitmlog.txt &

and

- mitmdump --listen-port 80 -w mitmdump.txt > mitmlog.txt &

But still same results.

What is the correct way of using mitmdump in this scenario?

0 Answers
Related