Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce apm-server.auth.anonymous config #5532

Closed
wants to merge 6 commits into from

Conversation

axw
Copy link
Member

@axw axw commented Jun 24, 2021

Motivation/summary

Generalise the ability for agents to send events unauthenticated (anonymous) but rate-limited. Until now this has been a RUM-only feature, but we now find ourselves needing it also for the iOS agent.

Anonymous auth is disabled by default, but is automatically enabled when RUM is enabled as long as apm-server.auth.anonymous hasn't been explicitly configured. The existing RUM config for allowed services and rate limiting are deprecated and replaced with equivalent config under apm-server.auth.anonymous.*.

Instead of restricting anonymous auth to requests going by endpoint (i.e. RUM intake and agent config), we now restrict based on the provided agent and service names. There was previously nothing stopping clients from spoofing RUM agents, e.g. sending events to the RUM intake with a non-RUM agent name, so this is not any less secure.

Checklist

How to test these changes

  1. Ensure existing config works as before: RUM should be allowed to send data without any auth token when secret_token or api_key auth is enabled; ensure no other agents can send data without an auth token.
  2. Define apm-server.auth.anonymous.allow_agent: [iOS/swift], check that the iOS/swift agent can send data without an auth token.
  3. Define apm-server.auth.anonymous.allow_service: [opbeans-rum], check that opbeans-rum can send data. Change it to something else and check that opbeans-rum cannot send data.

Related issues

Closes #5347

@axw axw added the v7.14.0 label Jun 24, 2021
@apmmachine
Copy link
Contributor

apmmachine commented Jun 24, 2021

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Branch indexing

  • Start Time: 2021-06-25T02:50:25.071+0000

  • Duration: 52 min 37 sec

  • Commit: acc1784

Test stats 🧪

Test Results
Failed 128
Passed 5840
Skipped 118
Total 6086

Trends 🧪

Image of Build Times

Image of Tests

Test errors 128

Expand to view the tests failures

> Show only the first 10 test failures

Build and Test / windows build-test / test_full_access – tests.system.test_auth.TestAccessDefault
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690D62F70>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_bad_json – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690DB31F0>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_deflate – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690E9AE50>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_deflate_error – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690E9AF70>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_empty – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690FCDCA0>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_expvar_default – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690FCD1F0>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_gzip – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x00000246910A8CA0>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_gzip_error – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x00000246910A81F0>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_healthcheck – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690F4AC10>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Build and Test / windows build-test / test_method_not_allowed – tests.system.test_requests.Test
    Expand to view the error details

     beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds. 
    

    Expand to view the stacktrace

     tests\system\apmserver.py:190: in setUp
        self.wait_until_started()
    tests\system\apmserver.py:203: in wait_until_started
        wait_until(lambda: self.log_contains("Starting apm-server"), name="apm-server started")
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    cond = <function ServerBaseTest.wait_until_started.<locals>.<lambda> at 0x0000024690F4AEE0>
    max_timeout = 10, poll_interval = 0.25, name = 'apm-server started'
    
        def wait_until(cond, max_timeout=10, poll_interval=0.25, name="cond"):
            """
            Like beat.beat.wait_until but catches exceptions
            In a ElasticTest `cond` will usually be a query, and we need to keep retrying
             eg. on 503 response codes
            """
            assert callable(cond), "First argument of wait_until must be a function"
        
            start = datetime.now()
            while datetime.now()-start < timedelta(seconds=max_timeout):
                try:
                    result = cond()
                    if result:
                        return result
                except AttributeError as ex:
                    raise ex
                except Exception as ex:
                    pass
                time.sleep(poll_interval)
    >       raise TimeoutError("Timeout waiting for '{}' to be true. ".format(name) +
                               "Waited {} seconds.".format(max_timeout))
    E       beat.beat.TimeoutError: Timeout waiting for 'apm-server started' to be true. Waited 10 seconds.
    
    tests\system\helper.py:39: TimeoutError 
    

Steps errors 4

Expand to view the steps failures

Run Window tests
  • Took 12 min 3 sec . View more details on here
Windows build
  • Took 0 min 3 sec . View more details on here
Run Linux tests
  • Took 30 min 53 sec . View more details on here
  • Description: ./.ci/scripts/linux-test.sh
Test Sync
  • Took 4 min 39 sec . View more details on here
  • Description: ./.ci/scripts/sync.sh

Log output

Expand to view the last 100 lines of log output

[2021-06-25T03:40:32.162Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip
[2021-06-25T03:40:33.342Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-06-25T03:40:33.396Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-06-25T03:40:34.597Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-06-25T03:40:34.662Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm
[2021-06-25T03:40:36.385Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-06-25T03:40:36.500Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm
[2021-06-25T03:40:37.812Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm.sha512
[2021-06-25T03:40:37.868Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb
[2021-06-25T03:40:39.320Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb.sha512
[2021-06-25T03:40:39.383Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb
[2021-06-25T03:40:40.701Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb.sha512
[2021-06-25T03:40:40.763Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz
[2021-06-25T03:40:41.941Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512
[2021-06-25T03:40:41.997Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb
[2021-06-25T03:40:43.387Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb.sha512
[2021-06-25T03:40:43.440Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm
[2021-06-25T03:40:44.817Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm.sha512
[2021-06-25T03:40:44.877Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-06-25T03:40:51.815Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-06-25T03:40:51.893Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz
[2021-06-25T03:40:53.314Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz.sha512
[2021-06-25T03:40:53.372Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz
[2021-06-25T03:40:54.776Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz.sha512
[2021-06-25T03:40:54.844Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2021-06-25T03:40:56.308Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-06-25T03:40:56.368Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip
[2021-06-25T03:40:57.343Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-06-25T03:40:57.405Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-06-25T03:40:58.437Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-06-25T03:40:58.823Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm
[2021-06-25T03:41:00.270Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-06-25T03:41:00.329Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-06-25T03:41:04.206Z] Warning: A secret was passed to "googleStorageUpload" using Groovy String interpolation, which is insecure.
[2021-06-25T03:41:04.206Z] 		 Affected argument(s) used the following variable(s): [JOB_GCS_BUCKET]
[2021-06-25T03:41:04.206Z] 		 See https://jenkins.io/redirect/groovy-string-interpolation for details.
[2021-06-25T03:41:04.217Z] [Google Cloud Storage Plugin] Found 54 files to upload from pattern: src/github.com/elastic/apm-server/build/distributions/**/*
[2021-06-25T03:41:04.277Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-aarch64.rpm
[2021-06-25T03:41:04.025Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-06-25T03:41:05.892Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-aarch64.rpm.sha512
[2021-06-25T03:41:05.951Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-amd64.deb
[2021-06-25T03:41:07.692Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-amd64.deb.sha512
[2021-06-25T03:41:07.764Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-arm64.deb
[2021-06-25T03:41:09.361Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-arm64.deb.sha512
[2021-06-25T03:41:09.438Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz
[2021-06-25T03:41:10.831Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512
[2021-06-25T03:41:10.904Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i386.deb
[2021-06-25T03:41:12.555Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i386.deb.sha512
[2021-06-25T03:41:12.613Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i686.rpm
[2021-06-25T03:41:14.317Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i686.rpm.sha512
[2021-06-25T03:41:14.383Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-06-25T03:41:21.668Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-06-25T03:41:21.749Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-arm64.tar.gz
[2021-06-25T03:41:23.308Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-arm64.tar.gz.sha512
[2021-06-25T03:41:23.362Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86.tar.gz
[2021-06-25T03:41:25.025Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86.tar.gz.sha512
[2021-06-25T03:41:25.135Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2021-06-25T03:41:26.881Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-06-25T03:41:26.965Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip
[2021-06-25T03:41:28.144Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-06-25T03:41:28.195Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-06-25T03:41:29.382Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-06-25T03:41:29.443Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm
[2021-06-25T03:41:31.141Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-06-25T03:41:31.199Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm
[2021-06-25T03:41:32.536Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm.sha512
[2021-06-25T03:41:32.600Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb
[2021-06-25T03:41:34.048Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb.sha512
[2021-06-25T03:41:34.145Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb
[2021-06-25T03:41:35.601Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb.sha512
[2021-06-25T03:41:35.673Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz
[2021-06-25T03:41:36.844Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512
[2021-06-25T03:41:36.904Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb
[2021-06-25T03:41:38.261Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb.sha512
[2021-06-25T03:41:38.314Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm
[2021-06-25T03:41:39.658Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm.sha512
[2021-06-25T03:41:39.721Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-06-25T03:41:46.840Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-06-25T03:41:46.913Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz
[2021-06-25T03:41:48.351Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz.sha512
[2021-06-25T03:41:48.408Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz
[2021-06-25T03:41:49.856Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz.sha512
[2021-06-25T03:41:49.923Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2021-06-25T03:41:51.428Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-06-25T03:41:51.516Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip
[2021-06-25T03:41:52.591Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-06-25T03:41:52.654Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-06-25T03:41:53.754Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-06-25T03:41:53.816Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm
[2021-06-25T03:41:55.283Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-06-25T03:41:55.362Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-06-25T03:42:00.753Z] Running on worker-854309 in /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-5532
[2021-06-25T03:42:00.806Z] [INFO] getVaultSecret: Getting secrets
[2021-06-25T03:42:00.867Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-06-25T03:41:59.041Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-06-25T03:42:03.015Z] + chmod 755 generate-build-data.sh
[2021-06-25T03:42:03.015Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5532/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5532/runs/4 FAILURE 3096536
[2021-06-25T03:42:03.015Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5532/runs/4/steps/?limit=10000 -o steps-info.json
[2021-06-25T03:42:05.297Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5532/runs/4/tests/?status=FAILED -o tests-errors.json
[2021-06-25T03:42:06.777Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5532/runs/4/log/ -o pipeline-log.txt

axw added 5 commits June 24, 2021 14:58
Also, remove AnonymousAuthorizationMiddleware.
We now use AuthorizationMiddleware with a single
auth builder that handles anonymous auth.
We also add a method to authorization.Handler to disable
anonymous auth for just that handler. This is used to
provide a handler that does not allow anonymous access
for a specific routes: sourcemap upload).
Use a single Authorization middleware for both
backend and RUM agents. For the RUM path, we rely
on the authorization.Builder's new support for
anonymous auth.
Also, use the new apm-server.auth config.
Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to test this through manually to get a better understanding, but always receive

{
  "accepted": 0,
  "errors": [
    {
      "message": "unauthorized: agent \"js-base\" not allowed"
    }
  ]
}

# When anonymous auth is enabled, only agents matching allow_agent and services
# matching allow_service are allowed. See below for details on default values for
# allow_agent.
#enabled:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a follow up - I think we should also deprecate apm-server.rum.enabled and derive it from anonymous.enabled in combination with anonymous.allow_agent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably:

  • deprecate apm-server.rum.enabled, and have it always enabled by default in 8.0
  • default apm-server.auth.anonymous.enabled: true

Which would be effectively the same I think

beater/api/mux.go Show resolved Hide resolved
result.Reason = fmt.Sprintf("agent %q not allowed", resource.AgentName)
case resource.ServiceName != "" && len(a.allowedServices) > 0 && !a.allowedServices[resource.ServiceName]:
result.Authorized = false
result.Reason = fmt.Sprintf("service %q not allowed", resource.ServiceName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this mean that empty agentName and empty serviceName is authorized? How about:

result := Result{Authorized: true, Anonymous: true}
case len(a.allowedAgents) > 0 && (resource.AgentName == "" || !a.allowedAgents[resource.AgentName]):
	result.Authorized = false
	result.Reason = fmt.Sprintf("agent %q not allowed", resource.AgentName)
case len(a.allowedServices) > 0 && (resource.ServiceName == "" || !a.allowedServices[resource.ServiceName]):
	result.Authorized = false
	result.Reason = fmt.Sprintf("service %q not allowed", resource.ServiceName)
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it's by design:

  • the initial auth check for requests uses Resource{}, to check if the client has some access before agent/service is known
  • for some endpoints (one endpoint -- agent config) the agent name isn't known, only service name is known

To prevent agents from bypassing the allowed agent/service checks we rely on agent and service name always being set where it matters. In agent config the service name is always set, and in intake both the agent name and service name are always set.

TBH I don't really feel 100% comfortable with this, so I'm open to alternatives.

Copy link
Contributor

@simitt simitt Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's indeed a tricky one!
How about we set a any (or * or something else) as agent name for the initial check, and give it a special meaning in the auth check, but ensure that this value is removed in case it is set by the requester?

for some endpoints (one endpoint -- agent config) the agent name isn't known, only service name is known

this means we would need to have dedicated auth logic per handler, defining which information needs to be passed via the request. Also not certain how we could integrate that well; will think a bit more about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another more radical option: introduce two different methods, Authenticate and Authorize.

Authenticate checks that a provided secret token or API Key is valid, or (if no auth token is provided) that anonymous access is allowed. If API Key auth is used, the API Key ID will be obtained so we can associate it with events.

If an agent authenticates, we assume it is allowed to send events and query agent config and we'll proceed to decoding events and parsing agent config queries. This is effectively like AuthorizedFor(Resource{}) succeeding. Once authenticated, Authorize will be used to check that that the agent is allowed to perform an action for a given agent name and/or service name.

The challenge with this is that we currently have the ability to create API Keys for sending events, querying agent config, and indexing source maps. Since source map uploading is moving to Kibana, I think we could simplify things by saying that if an agent has an API Key with some apm application privileges, then it's good enough for agent authentication.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that. It would generally be cleaner to distinguish between authentication and authorization.

},
"allow_agent_unspecified": {
allowAgent: []string{"iOS/swift"},
resource: authorization.Resource{ServiceName: "opbeans-ios"}, // AgentName not specified
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not denied? There is a set of allowed agents specified, which can be worked around by simply not sending an agent name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to not send an agent name.

},
"allow_service_unspecified": {
allowService: []string{"opbeans-ios"},
resource: authorization.Resource{AgentName: "iOS/swift"}, // ServiceName not specified
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above - why is an empty service name allowed when a list of allowlisted services is specified?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above :)

beater/authorization/builder.go Outdated Show resolved Hide resolved
@axw
Copy link
Member Author

axw commented Jun 29, 2021

I'll rebase and reopen once #5545 is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS intake support: auth handling and rate limiting
4 participants