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

Enable Context-based Restriction service Private Endpoint support #4268

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

zhenwan
Copy link
Contributor

@zhenwan zhenwan commented Jan 5, 2023

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

@hkantare
Copy link
Collaborator

hkantare commented Jan 9, 2023

Can you add test case results by running both public and private endpoint

@soohoowoohoo
Copy link
Contributor

@zhenwan I think we'll want to update these docs to allow for a CBR custom endpoint and we should see if there is anything extra we need to do in order to support this type of specification: https://github.com/IBM-Cloud/terraform-provider-ibm/blob/9b27de8849c954c6b751ba3f69d47fd093f3f306/website/docs/guides/custom-service-endpoints.html.md#supported-endpoint-customizations

@zhenwan
Copy link
Contributor Author

zhenwan commented Feb 1, 2023

@hkantare here is the test result for the private endpoint using my local build linux_amd64:
Rule request input:

{
  "_tag": [
    "iam-am-staging-us-south-dal10"
  ],
  "_account": "9a6d11d936",
  "_cluster": "ld21",
  "_host": "network-policy-app-689b855df5-rlz2r",
  "_ingester": "supertenant",
  "_logtype": "json",
  "_file": "/var/log/containers/network-policy-app-689b855df5-rlz2r_network-policy_network-policy-app-3926cfaf464c0a5e483945fed3016287dde41ed5ae5168930c67dd288283b4f4.log",
  "_line": "{\"level\":\"info\",\"ts\":\"2023-02-01T17:01:29.331518201Z\",\"caller\":\"logging/middlewares.go:96\",\"message\":\"Request input\",\"environment\":\"staging\",\"instance_name\":\"network-policy-app-689b855df5-rlz2r\",\"service\":\"context-based-restrictions\",\"transaction_id\":\"96060a0f-5228-4e8c-bb16-5dc6811d9dd6\",\"internal_tx_id\":\"1a3973d8-0139-443a-a271-a80470060a0b\",\"method\":\"POST\",\"path\":\"/v1/rules\",\"client_ip\":\"10.221.217.230\",\"headers\":{\"X-Envoy-Internal\":[\"true\"],\"X-Envoy-Decorator-Operation\":[\"network-policy-service.network-policy.svc.cluster.local:8080/v1/rules*\"],\"X-Original-User-Agent\":[\"terraform-provider-ibm/1.49.0\"],\"X-B3-Traceid\":[\"3efc15cf9e3ee16df909f977de436268\"],\"Gateway-Id\":[\"iam-gateway-8.1-421-fp6ds\"],\"User-Agent\":[\"platform-services-go-sdk/0.31.0 (lang=go; arch=amd64; os=linux; go.version=go1.18.9)\"],\"Accept-Encoding\":[\"gzip\"],\"X-Forwarded-Proto\":[\"https\"],\"Host\":[\"cbr.test.cloud.ibm.com\"],\"Cse-Ipaddress\":[\"166.9.250.68\"],\"Origin-Host\":[\"private.cbr.test.cloud.ibm.com\"],\"X-Request-Id\":[\"2f1c27a5-7f0d-4fee-b9d8-343a422f4533\"],\"X-Envoy-Peer-Metadata\":[\"ChQKDkFQUF9DT05UQUlORVJTEgIaAAoaCgpDTFVTVEVSX0lEEgwaCkt1YmVybmV0ZXMKHwoMSU5TVEFOQ0VfSVBTEg8aDTE3Mi4zMC4xODkuNTcKGQoNSVNUSU9fVkVSU0lPThIIGgYxLjE1LjQKhwMKBkxBQkVMUxL8Air5AgodCgNhcHASFhoUaXN0aW8taW5ncmVzc2dhdGV3YXkKNgopaW5zdGFsbC5vcGVyYXRvci5pc3Rpby5pby9vd25pbmctcmVzb3VyY2USCRoHdW5rbm93bgogCgVpc3RpbxIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXkKGQoMaXN0aW8uaW8vcmV2EgkaB2RlZmF1bHQKMAobb3BlcmF0b3IuaXN0aW8uaW8vY29tcG9uZW50EhEaD0luZ3Jlc3NHYXRld2F5cwogChFwb2QtdGVtcGxhdGUtaGFzaBILGgliZDc3NDlmNjgKOgofc2VydmljZS5pc3Rpby5pby9jYW5vbmljYWwtbmFtZRIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXkKLwojc2VydmljZS5pc3Rpby5pby9jYW5vbmljYWwtcmV2aXNpb24SCBoGbGF0ZXN0CiIKF3NpZGVjYXIuaXN0aW8uaW8vaW5qZWN0EgcaBWZhbHNlChoKB01FU0hfSUQSDxoNY2x1c3Rlci5sb2NhbAovCgROQU1FEicaJWN1c3RvbS1pbmdyZXNzZ2F0ZXdheS1iZDc3NDlmNjgtaHRqc2sKHgoJTkFNRVNQQUNFEhEaD2N1c3RvbS1nYXRld2F5cwphCgVPV05FUhJYGlZrdWJlcm5ldGVzOi8vYXBpcy9hcHBzL3YxL25hbWVzcGFjZXMvY3VzdG9tLWdhdGV3YXlzL2RlcGxveW1lbnRzL2N1c3RvbS1pbmdyZXNzZ2F0ZXdheQoXChFQTEFURk9STV9NRVRBREFUQRICKgAKKAoNV09SS0xPQURfTkFNRRIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXk=\"],\"X-B3-Sampled\":[\"0\"],\"Accept\":[\"application/json\"],\"X-Envoy-Peer-Metadata-Id\":[\"router~172.30.189.57~custom-ingressgateway-bd7749f68-htjsk.custom-gateways~custom-gateways.svc.cluster.local\"],\"X-Envoy-Attempt-Count\":[\"1\"],\"True-Client-Ip\":[\"10.22.79.233\"],\"Gateway-Cluster\":[\"iam-cse-test-us-south-dal10\"],\"X-Real-Ip\":[\"10.22.79.233\"],\"X-Forwarded-For\":[\"10.221.217.230\"],\"X-B3-Spanid\":[\"f909f977de436268\"],\"Endpoint-Type\":[\"private\"],\"X-Global-K8fdic-Transaction-Id\":[\"1f0d1f79dd978dc9c4fd404881ed97ab\"],\"Content-Type\":[\"application/json\"],\"Content-Length\":[\"484\"]},\"query\":{},\"params\":{},\"req_body\":{\"contexts\":[{\"attributes\":[{\"name\":\"networkZoneId\",\"value\":\"96529ff0b45889d5b57f2b6e51c1606b\"},{\"name\":\"endpointType\",\"value\":\"private\"},{\"name\":\"networkZoneId\",\"value\":\"92ed5a175da9ca1704da051794c62c33\"}]}],\"description\":\"A terraform example of rule\",\"enforcement_mode\":\"disabled\",\"resources\":[{\"attributes\":[{\"name\":\"accountId\",\"value\":\"82cbc8dcd1ab4112b7272b----------\"},{\"name\":\"serviceName\",\"value\":\"network-policy-enabled\"}],\"tags\":[{\"name\":\"tag_name\",\"value\":\"tag_value\"}]}]},\"log_type\":\"request\"}",
  "_rawline": null,
  "_ts": 1675270889486,
  "_app": "network-policy-app",
  "_ip": "52.117.188.100",
  "__key": "logline:9a6d11d936:network-policy-app:network-policy-app-689b855df5-rlz2r:ld21",
  "pod": "network-policy-app-689b855df5-rlz2r",
  "namespace": "network-policy",
  "container": "network-policy-app",
  "containerid": "3926cfaf464c0a5e483945fed3016287dde41ed5ae5168930c67dd288283b4f4",
  "node": "kube-btuvnchd0emnido183eg-iamamstagin-service-00000665\n",
  "_bid": "9ad3ae84-8479-40b0-89b2-62a43e02339a:13742:ld21",
  "level": "info",
  "ts": "2023-02-01T17:01:29.331518201Z",
  "caller": "logging/middlewares.go:96",
  "message": "Request input",
  "environment": "staging",
  "instance_name": "network-policy-app-689b855df5-rlz2r",
  "transaction_id": "96060a0f-5228-4e8c-bb16-5dc6811d9dd6",
  "internal_tx_id": "1a3973d8-0139-443a-a271-a80470060a0b",
  "client_ip": "10.221.217.230",
  "log_type": "request",
  "_service": "context-based-restrictions",
  "_method": "POST",
  "_path": "/v1/rules",
  "_mezmo_line_size": 3819,
  "_id": "1574000192871563292",
  "headers": {
    "X-Envoy-Internal": [
      "true"
    ],
    "X-Envoy-Decorator-Operation": [
      "network-policy-service.network-policy.svc.cluster.local:8080/v1/rules*"
    ],
    "X-Original-User-Agent": [
      "terraform-provider-ibm/1.49.0"
    ],
    "X-B3-Traceid": [
      "3efc15cf9e3ee16df909f977de436268"
    ],
    "Gateway-Id": [
      "iam-gateway-8.1-421-fp6ds"
    ],
    "User-Agent": [
      "platform-services-go-sdk/0.31.0 (lang=go; arch=amd64; os=linux; go.version=go1.18.9)"
    ],
    "Accept-Encoding": [
      "gzip"
    ],
    "X-Forwarded-Proto": [
      "https"
    ],
    "Host": [
      "cbr.test.cloud.ibm.com"
    ],
    "Cse-Ipaddress": [
      "166.9.250.68"
    ],
    "Origin-Host": [
      "private.cbr.test.cloud.ibm.com"
    ],
    "X-Request-Id": [
      "2f1c27a5-7f0d-4fee-b9d8-343a422f4533"
    ],
    "X-Envoy-Peer-Metadata": [
      "ChQKDkFQUF9DT05UQUlORVJTEgIaAAoaCgpDTFVTVEVSX0lEEgwaCkt1YmVybmV0ZXMKHwoMSU5TVEFOQ0VfSVBTEg8aDTE3Mi4zMC4xODkuNTcKGQoNSVNUSU9fVkVSU0lPThIIGgYxLjE1LjQKhwMKBkxBQkVMUxL8Air5AgodCgNhcHASFhoUaXN0aW8taW5ncmVzc2dhdGV3YXkKNgopaW5zdGFsbC5vcGVyYXRvci5pc3Rpby5pby9vd25pbmctcmVzb3VyY2USCRoHdW5rbm93bgogCgVpc3RpbxIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXkKGQoMaXN0aW8uaW8vcmV2EgkaB2RlZmF1bHQKMAobb3BlcmF0b3IuaXN0aW8uaW8vY29tcG9uZW50EhEaD0luZ3Jlc3NHYXRld2F5cwogChFwb2QtdGVtcGxhdGUtaGFzaBILGgliZDc3NDlmNjgKOgofc2VydmljZS5pc3Rpby5pby9jYW5vbmljYWwtbmFtZRIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXkKLwojc2VydmljZS5pc3Rpby5pby9jYW5vbmljYWwtcmV2aXNpb24SCBoGbGF0ZXN0CiIKF3NpZGVjYXIuaXN0aW8uaW8vaW5qZWN0EgcaBWZhbHNlChoKB01FU0hfSUQSDxoNY2x1c3Rlci5sb2NhbAovCgROQU1FEicaJWN1c3RvbS1pbmdyZXNzZ2F0ZXdheS1iZDc3NDlmNjgtaHRqc2sKHgoJTkFNRVNQQUNFEhEaD2N1c3RvbS1nYXRld2F5cwphCgVPV05FUhJYGlZrdWJlcm5ldGVzOi8vYXBpcy9hcHBzL3YxL25hbWVzcGFjZXMvY3VzdG9tLWdhdGV3YXlzL2RlcGxveW1lbnRzL2N1c3RvbS1pbmdyZXNzZ2F0ZXdheQoXChFQTEFURk9STV9NRVRBREFUQRICKgAKKAoNV09SS0xPQURfTkFNRRIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXk="
    ],
    "X-B3-Sampled": [
      "0"
    ],
    "Accept": [
      "application/json"
    ],
    "X-Envoy-Peer-Metadata-Id": [
      "router~172.30.189.57~custom-ingressgateway-bd7749f68-htjsk.custom-gateways~custom-gateways.svc.cluster.local"
    ],
    "X-Envoy-Attempt-Count": [
      "1"
    ],
    "True-Client-Ip": [
      "10.22.79.233"
    ],
    "Gateway-Cluster": [
      "iam-cse-test-us-south-dal10"
    ],
    "X-Real-Ip": [
      "10.22.79.233"
    ],
    "X-Forwarded-For": [
      "10.221.217.230"
    ],
    "X-B3-Spanid": [
      "f909f977de436268"
    ],
    "Endpoint-Type": [
      "private"
    ],
    "X-Global-K8fdic-Transaction-Id": [
      "1f0d1f79dd978dc9c4fd404881ed97ab"
    ],
    "Content-Type": [
      "application/json"
    ],
    "Content-Length": [
      "484"
    ]
  },
  "query": {},
  "params": {},
  "req_body": {
    "description": "A terraform example of rule",
    "enforcement_mode": "disabled",
    "contexts": [
      {
        "o_attributes": [
          "{\n  \"name\": \"networkZoneId\",\n  \"value\": \"96529ff0b45889d5b57f2b6e51c1606b\"\n}",
          "{\n  \"name\": \"endpointType\",\n  \"value\": \"private\"\n}",
          "{\n  \"name\": \"networkZoneId\",\n  \"value\": \"92ed5a175da9ca1704da051794c62c33\"\n}"
        ]
      }
    ],
    "resources": [
      {
        "o_attributes": [
          "{\n  \"name\": \"accountId\",\n  \"value\": \"82cbc8dcd1ab4112b7272b----------\"\n}",
          "{\n  \"name\": \"serviceName\",\n  \"value\": \"network-policy-enabled\"\n}"
        ],
        "o_tags": [
          "{\n  \"name\": \"tag_name\",\n  \"value\": \"tag_value\"\n}"
        ]
      }
    ]
  }
}

Response

{
  "_tag": [
    "iam-am-staging-us-south-dal10"
  ],
  "_account": "9a6d11d936",
  "_cluster": "ld21",
  "_host": "network-policy-app-689b855df5-rlz2r",
  "_ingester": "supertenant",
  "_logtype": "json",
  "_file": "/var/log/containers/network-policy-app-689b855df5-rlz2r_network-policy_network-policy-app-3926cfaf464c0a5e483945fed3016287dde41ed5ae5168930c67dd288283b4f4.log",
  "_line": "{\"level\":\"info\",\"ts\":\"2023-02-01T17:01:29.514695768Z\",\"caller\":\"logging/middlewares.go:136\",\"message\":\"Response output\",\"environment\":\"staging\",\"instance_name\":\"network-policy-app-689b855df5-rlz2r\",\"service\":\"context-based-restrictions\",\"transaction_id\":\"96060a0f-5228-4e8c-bb16-5dc6811d9dd6\",\"internal_tx_id\":\"1a3973d8-0139-443a-a271-a80470060a0b\",\"method\":\"POST\",\"path\":\"/v1/rules\",\"client_ip\":\"10.221.217.230\",\"headers\":{\"X-Ratelimit-Reset\":[\"1675270890\"],\"Etag\":[\"1-027058a8af8f75fd7219abe5eeb79ce0\"],\"Content-Type\":[\"application/json; charset=utf-8\"],\"X-Content-Type-Options\":[\"nosniff\"],\"Transaction-Id\":[\"96060a0f-5228-4e8c-bb16-5dc6811d9dd6\"],\"X-Correlation-Id\":[\"96060a0f-5228-4e8c-bb16-5dc6811d9dd6\"],\"X-Ratelimit-Limit\":[\"10\"],\"X-Ratelimit-Remaining\":[\"8\"]},\"status_code\":201,\"resp_body\":{\"contexts\":[{\"attributes\":[{\"name\":\"endpointType\",\"value\":\"private\"},{\"name\":\"networkZoneId\",\"value\":\"92ed5a175da9ca1704da051794c62c33\"}]}],\"created_at\":\"2023-02-01T17:01:29Z\",\"created_by_id\":\"iam-ServiceId-cffb74e9-efeb-4dc0-8085-85c5ead7e890\",\"crn\":\"crn:v1:staging:public:context-based-restrictions:global:a/82cbc8dcd1ab4112b7272b410ac9965c::rule:07c504d3be962404cf2b54e002c3e1a5\",\"description\":\"A terraform example of rule\",\"enforcement_mode\":\"disabled\",\"href\":\"https://private.cbr.test.cloud.ibm.com/v1/rules/07c504d3be962404cf2b54e002c3e1a5\",\"id\":\"07c504d3be962404cf2b54e002c3e1a5\",\"last_modified_at\":\"2023-02-01T17:01:29Z\",\"last_modified_by_id\":\"iam-ServiceId-cffb74e9-efeb-4dc0-8085-85c5ead7e890\",\"resources\":[{\"attributes\":[{\"name\":\"accountId\",\"value\":\"82cbc8dcd1ab4112b7272b----------\"},{\"name\":\"serviceName\",\"value\":\"network-policy-enabled\"}],\"tags\":[{\"name\":\"tag_name\",\"value\":\"tag_value\"}]}]},\"log_type\":\"response\"}",
  "_rawline": null,
  "_ts": 1675270889860,
  "_app": "network-policy-app",
  "_ip": "52.117.188.100",
  "__key": "logline:9a6d11d936:network-policy-app:network-policy-app-689b855df5-rlz2r:ld21",
  "pod": "network-policy-app-689b855df5-rlz2r",
  "namespace": "network-policy",
  "container": "network-policy-app",
  "containerid": "3926cfaf464c0a5e483945fed3016287dde41ed5ae5168930c67dd288283b4f4",
  "node": "kube-btuvnchd0emnido183eg-iamamstagin-service-00000665\n",
  "_bid": "bdf65474-233e-452b-93e5-cf2a1b974c0d:50966:ld21",
  "level": "info",
  "ts": "2023-02-01T17:01:29.514695768Z",
  "caller": "logging/middlewares.go:136",
  "message": "Response output",
  "environment": "staging",
  "instance_name": "network-policy-app-689b855df5-rlz2r",
  "transaction_id": "96060a0f-5228-4e8c-bb16-5dc6811d9dd6",
  "internal_tx_id": "1a3973d8-0139-443a-a271-a80470060a0b",
  "client_ip": "10.221.217.230",
  "status_code": 201,
  "log_type": "response",
  "_service": "context-based-restrictions",
  "_method": "POST",
  "_path": "/v1/rules",
  "_mezmo_line_size": 2334,
  "_id": "1574000194432520203",
  "headers": {
    "X-Ratelimit-Reset": [
      "1675270890"
    ],
    "Etag": [
      "1-027058a8af8f75fd7219abe5eeb79ce0"
    ],
    "Content-Type": [
      "application/json; charset=utf-8"
    ],
    "X-Content-Type-Options": [
      "nosniff"
    ],
    "Transaction-Id": [
      "96060a0f-5228-4e8c-bb16-5dc6811d9dd6"
    ],
    "X-Correlation-Id": [
      "96060a0f-5228-4e8c-bb16-5dc6811d9dd6"
    ],
    "X-Ratelimit-Limit": [
      "10"
    ],
    "X-Ratelimit-Remaining": [
      "8"
    ]
  },
  "resp_body": {
    "created_at": "2023-02-01T17:01:29Z",
    "created_by_id": "iam-ServiceId-cffb74e9-efeb-4dc0-8085-85c5ead7e890",
    "crn": "crn:v1:staging:public:context-based-restrictions:global:a/82cbc8dcd1ab4112b7272b410ac9965c::rule:07c504d3be962404cf2b54e002c3e1a5",
    "description": "A terraform example of rule",
    "enforcement_mode": "disabled",
    "href": "https://private.cbr.test.cloud.ibm.com/v1/rules/07c504d3be962404cf2b54e002c3e1a5",
    "id": "07c504d3be962404cf2b54e002c3e1a5",
    "last_modified_at": "2023-02-01T17:01:29Z",
    "last_modified_by_id": "iam-ServiceId-cffb74e9-efeb-4dc0-8085-85c5ead7e890",
    "contexts": [
      {
        "o_attributes": [
          "{\n  \"name\": \"endpointType\",\n  \"value\": \"private\"\n}",
          "{\n  \"name\": \"networkZoneId\",\n  \"value\": \"92ed5a175da9ca1704da051794c62c33\"\n}"
        ]
      }
    ],
    "resources": [
      {
        "o_attributes": [
          "{\n  \"name\": \"accountId\",\n  \"value\": \"82cbc8dcd1ab4112b7272b----------\"\n}",
          "{\n  \"name\": \"serviceName\",\n  \"value\": \"network-policy-enabled\"\n}"
        ],
        "o_tags": [
          "{\n  \"name\": \"tag_name\",\n  \"value\": \"tag_value\"\n}"
        ]
      }
    ]
  }
}

@zhenwan
Copy link
Contributor Author

zhenwan commented Feb 6, 2023

@hkantare here is the test results for the private endpoints from prod using my local build linux_amd64:

visibility = "private"
region = ""

request input

{
  "_tag": [
    "iam-am-prod-us-south-dal12"
  ],
  "_account": "ac14e5efab",
  "_cluster": "ld12",
  "_host": "network-policy-app-5b85ff5769-5rfw5",
  "_ingester": "supertenant",
  "_logtype": "json",
  "_file": "/var/log/containers/network-policy-app-5b85ff5769-5rfw5_network-policy_network-policy-app-65475728fd16bdf98ef0e2278cec34762c8e5db51febc87183aa4a5f89bd6a4b.log",
  "_line": "{\"level\":\"info\",\"ts\":\"2023-02-06T22:34:56.338035803Z\",\"caller\":\"logging/middlewares.go:96\",\"message\":\"Request input\",\"environment\":\"prod\",\"instance_name\":\"network-policy-app-5b85ff5769-5rfw5\",\"service\":\"context-based-restrictions\",\"transaction_id\":\"953579a6-c6eb-46dc-8bae-4482edf53ca6\",\"internal_tx_id\":\"52bf5b91-783f-4349-8174-be6ca2aba7fd\",\"method\":\"GET\",\"path\":\"/v1/rules/d3c2665637d61788e61af2646d7c9d01\",\"client_ip\":\"10.241.115.14\",\"headers\":{\"X-Original-User-Agent\":[\"terraform-provider-ibm/1.50.0\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Envoy-Internal\":[\"true\"],\"X-Envoy-Decorator-Operation\":[\"network-policy-service.network-policy.svc.cluster.local:8080/v1/rules*\"],\"X-Envoy-Attempt-Count\":[\"1\"],\"Cse-Ipaddress\":[\"166.9.250.194\"],\"Origin-Host\":[\"private.cbr.cloud.ibm.com\"],\"X-Global-K8fdic-Transaction-Id\":[\"0de447f01b8aadfde164d5f234c0b936\"],\"Accept\":[\"application/json\"],\"X-Envoy-Peer-Metadata\":[\"ChQKDkFQUF9DT05UQUlORVJTEgIaAAoaCgpDTFVTVEVSX0lEEgwaCkt1YmVybmV0ZXMKIAoMSU5TVEFOQ0VfSVBTEhAaDjE3Mi4zMC4xOTEuMjQxChkKDUlTVElPX1ZFUlNJT04SCBoGMS4xNS40CogDCgZMQUJFTFMS/QIq+gIKHQoDYXBwEhYaFGlzdGlvLWluZ3Jlc3NnYXRld2F5CjYKKWluc3RhbGwub3BlcmF0b3IuaXN0aW8uaW8vb3duaW5nLXJlc291cmNlEgkaB3Vua25vd24KIAoFaXN0aW8SFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5ChkKDGlzdGlvLmlvL3JldhIJGgdkZWZhdWx0CjAKG29wZXJhdG9yLmlzdGlvLmlvL2NvbXBvbmVudBIRGg9JbmdyZXNzR2F0ZXdheXMKIQoRcG9kLXRlbXBsYXRlLWhhc2gSDBoKNjU1NDk4NWM2Nwo6Ch9zZXJ2aWNlLmlzdGlvLmlvL2Nhbm9uaWNhbC1uYW1lEhcaFWN1c3RvbS1pbmdyZXNzZ2F0ZXdheQovCiNzZXJ2aWNlLmlzdGlvLmlvL2Nhbm9uaWNhbC1yZXZpc2lvbhIIGgZsYXRlc3QKIgoXc2lkZWNhci5pc3Rpby5pby9pbmplY3QSBxoFZmFsc2UKGgoHTUVTSF9JRBIPGg1jbHVzdGVyLmxvY2FsCjAKBE5BTUUSKBomY3VzdG9tLWluZ3Jlc3NnYXRld2F5LTY1NTQ5ODVjNjctcTg2bWQKHgoJTkFNRVNQQUNFEhEaD2N1c3RvbS1nYXRld2F5cwphCgVPV05FUhJYGlZrdWJlcm5ldGVzOi8vYXBpcy9hcHBzL3YxL25hbWVzcGFjZXMvY3VzdG9tLWdhdGV3YXlzL2RlcGxveW1lbnRzL2N1c3RvbS1pbmdyZXNzZ2F0ZXdheQoXChFQTEFURk9STV9NRVRBREFUQRICKgAKKAoNV09SS0xPQURfTkFNRRIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXk=\"],\"True-Client-Ip\":[\"10.12.123.104\"],\"X-Forwarded-For\":[\"10.241.115.14\"],\"X-Request-Id\":[\"9bcc7bce-e8eb-424c-8be3-56e47020e190\"],\"X-B3-Traceid\":[\"d903885b3e80e1c9be3b9bc374cb6fdd\"],\"X-B3-Spanid\":[\"be3b9bc374cb6fdd\"],\"X-B3-Sampled\":[\"0\"],\"Accept-Encoding\":[\"gzip\"],\"X-Real-Ip\":[\"10.12.123.104\"],\"Endpoint-Type\":[\"private\"],\"Gateway-Id\":[\"iam-gateway-8.1-421-ktq2j\"],\"Gateway-Cluster\":[\"iam-cse-prod-us-south-dal12\"],\"User-Agent\":[\"platform-services-go-sdk/0.31.0 (lang=go; arch=amd64; os=linux; go.version=go1.18.9)\"],\"X-Envoy-Peer-Metadata-Id\":[\"router~172.30.191.241~custom-ingressgateway-6554985c67-q86md.custom-gateways~custom-gateways.svc.cluster.local\"],\"Host\":[\"cbr.cloud.ibm.com\"]},\"query\":{},\"params\":{\"rule_id\":\"d3c2665637d61788e61af2646d7c9d01\"},\"req_body\":null,\"log_type\":\"request\"}",
  "_rawline": null,
  "_ts": 1675722896609,
  "_app": "network-policy-app",
  "_ip": "169.48.229.253",
  "__key": "logline:ac14e5efab:network-policy-app:network-policy-app-5b85ff5769-5rfw5:ld12",
  "pod": "network-policy-app-5b85ff5769-5rfw5",
  "namespace": "network-policy",
  "container": "network-policy-app",
  "containerid": "65475728fd16bdf98ef0e2278cec34762c8e5db51febc87183aa4a5f89bd6a4b",
  "node": "kube-bu9hcu3d05b4j3r6ln0g-iamamprodus-service-0000103d\n",
  "_bid": "4c5d84f1-af86-4aab-a93e-aedb11b85a75:54807:ld12",
  "level": "info",
  "ts": "2023-02-06T22:34:56.338035803Z",
  "caller": "logging/middlewares.go:96",
  "message": "Request input",
  "environment": "prod",
  "instance_name": "network-policy-app-5b85ff5769-5rfw5",
  "transaction_id": "953579a6-c6eb-46dc-8bae-4482edf53ca6",
  "internal_tx_id": "52bf5b91-783f-4349-8174-be6ca2aba7fd",
  "client_ip": "10.241.115.14",
  "log_type": "request",
  "_service": "context-based-restrictions",
  "_method": "GET",
  "_path": "/v1/rules/d3c2665637d61788e61af2646d7c9d01",
  "_mezmo_line_size": 3346,
  "_id": "1575896048143355905",
  "headers": {
    "X-Original-User-Agent": [
      "terraform-provider-ibm/1.50.0"
    ],
    "X-Forwarded-Proto": [
      "https"
    ],
    "X-Envoy-Internal": [
      "true"
    ],
    "X-Envoy-Decorator-Operation": [
      "network-policy-service.network-policy.svc.cluster.local:8080/v1/rules*"
    ],
    "X-Envoy-Attempt-Count": [
      "1"
    ],
    "Cse-Ipaddress": [
      "166.9.250.194"
    ],
    "Origin-Host": [
      "private.cbr.cloud.ibm.com"
    ],
    "X-Global-K8fdic-Transaction-Id": [
      "0de447f01b8aadfde164d5f234c0b936"
    ],
    "Accept": [
      "application/json"
    ],
    "X-Envoy-Peer-Metadata": [
      "ChQKDkFQUF9DT05UQUlORVJTEgIaAAoaCgpDTFVTVEVSX0lEEgwaCkt1YmVybmV0ZXMKIAoMSU5TVEFOQ0VfSVBTEhAaDjE3Mi4zMC4xOTEuMjQxChkKDUlTVElPX1ZFUlNJT04SCBoGMS4xNS40CogDCgZMQUJFTFMS/QIq+gIKHQoDYXBwEhYaFGlzdGlvLWluZ3Jlc3NnYXRld2F5CjYKKWluc3RhbGwub3BlcmF0b3IuaXN0aW8uaW8vb3duaW5nLXJlc291cmNlEgkaB3Vua25vd24KIAoFaXN0aW8SFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5ChkKDGlzdGlvLmlvL3JldhIJGgdkZWZhdWx0CjAKG29wZXJhdG9yLmlzdGlvLmlvL2NvbXBvbmVudBIRGg9JbmdyZXNzR2F0ZXdheXMKIQoRcG9kLXRlbXBsYXRlLWhhc2gSDBoKNjU1NDk4NWM2Nwo6Ch9zZXJ2aWNlLmlzdGlvLmlvL2Nhbm9uaWNhbC1uYW1lEhcaFWN1c3RvbS1pbmdyZXNzZ2F0ZXdheQovCiNzZXJ2aWNlLmlzdGlvLmlvL2Nhbm9uaWNhbC1yZXZpc2lvbhIIGgZsYXRlc3QKIgoXc2lkZWNhci5pc3Rpby5pby9pbmplY3QSBxoFZmFsc2UKGgoHTUVTSF9JRBIPGg1jbHVzdGVyLmxvY2FsCjAKBE5BTUUSKBomY3VzdG9tLWluZ3Jlc3NnYXRld2F5LTY1NTQ5ODVjNjctcTg2bWQKHgoJTkFNRVNQQUNFEhEaD2N1c3RvbS1nYXRld2F5cwphCgVPV05FUhJYGlZrdWJlcm5ldGVzOi8vYXBpcy9hcHBzL3YxL25hbWVzcGFjZXMvY3VzdG9tLWdhdGV3YXlzL2RlcGxveW1lbnRzL2N1c3RvbS1pbmdyZXNzZ2F0ZXdheQoXChFQTEFURk9STV9NRVRBREFUQRICKgAKKAoNV09SS0xPQURfTkFNRRIXGhVjdXN0b20taW5ncmVzc2dhdGV3YXk="
    ],
    "True-Client-Ip": [
      "10.12.123.104"
    ],
    "X-Forwarded-For": [
      "10.241.115.14"
    ],
    "X-Request-Id": [
      "9bcc7bce-e8eb-424c-8be3-56e47020e190"
    ],
    "X-B3-Traceid": [
      "d903885b3e80e1c9be3b9bc374cb6fdd"
    ],
    "X-B3-Spanid": [
      "be3b9bc374cb6fdd"
    ],
    "X-B3-Sampled": [
      "0"
    ],
    "Accept-Encoding": [
      "gzip"
    ],
    "X-Real-Ip": [
      "10.12.123.104"
    ],
    "Endpoint-Type": [
      "private"
    ],
    "Gateway-Id": [
      "iam-gateway-8.1-421-ktq2j"
    ],
    "Gateway-Cluster": [
      "iam-cse-prod-us-south-dal12"
    ],
    "User-Agent": [
      "platform-services-go-sdk/0.31.0 (lang=go; arch=amd64; os=linux; go.version=go1.18.9)"
    ],
    "X-Envoy-Peer-Metadata-Id": [
      "router~172.30.191.241~custom-ingressgateway-6554985c67-q86md.custom-gateways~custom-gateways.svc.cluster.local"
    ],
    "Host": [
      "cbr.cloud.ibm.com"
    ]
  },
  "query": {},
  "params": {
    "rule_id": "d3c2665637d61788e61af2646d7c9d01"
  },
  "req_body": null
}

Response

{
  "_tag": [
    "iam-am-prod-us-south-dal12"
  ],
  "_account": "ac14e5efab",
  "_cluster": "ld12",
  "_host": "network-policy-app-5b85ff5769-5rfw5",
  "_ingester": "supertenant",
  "_logtype": "json",
  "_file": "/var/log/containers/network-policy-app-5b85ff5769-5rfw5_network-policy_network-policy-app-65475728fd16bdf98ef0e2278cec34762c8e5db51febc87183aa4a5f89bd6a4b.log",
  "_line": "{\"level\":\"info\",\"ts\":\"2023-02-06T22:34:56.361664732Z\",\"caller\":\"logging/middlewares.go:136\",\"message\":\"Response output\",\"environment\":\"prod\",\"instance_name\":\"network-policy-app-5b85ff5769-5rfw5\",\"service\":\"context-based-restrictions\",\"transaction_id\":\"953579a6-c6eb-46dc-8bae-4482edf53ca6\",\"internal_tx_id\":\"52bf5b91-783f-4349-8174-be6ca2aba7fd\",\"method\":\"GET\",\"path\":\"/v1/rules/d3c2665637d61788e61af2646d7c9d01\",\"client_ip\":\"10.241.115.14\",\"headers\":{\"X-Correlation-Id\":[\"953579a6-c6eb-46dc-8bae-4482edf53ca6\"],\"X-Ratelimit-Limit\":[\"10\"],\"X-Ratelimit-Remaining\":[\"8\"],\"X-Ratelimit-Reset\":[\"1675722896\"],\"Etag\":[\"1-f9c5f67d7b4ece0273e5f1fd459043fb\"],\"Content-Type\":[\"application/json; charset=utf-8\"],\"X-Content-Type-Options\":[\"nosniff\"],\"Transaction-Id\":[\"953579a6-c6eb-46dc-8bae-4482edf53ca6\"]},\"status_code\":200,\"resp_body\":{\"contexts\":[{\"attributes\":[{\"name\":\"endpointType\",\"value\":\"private\"},{\"name\":\"networkZoneId\",\"value\":\"567a0593b412f5396250bd42477b41cb\"}]}],\"created_at\":\"2023-02-06T22:34:56Z\",\"created_by_id\":\"iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd\",\"crn\":\"crn:v1:bluemix:public:context-based-restrictions:global:a/8fb25be6f99e74201a094972d32b1235::rule:d3c2665637d61788e61af2646d7c9d01\",\"description\":\"A terraform example of rule\",\"enforcement_mode\":\"disabled\",\"href\":\"https://private.cbr.cloud.ibm.com/v1/rules/d3c2665637d61788e61af2646d7c9d01\",\"id\":\"d3c2665637d61788e61af2646d7c9d01\",\"last_modified_at\":\"2023-02-06T22:34:56Z\",\"last_modified_by_id\":\"iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd\",\"resources\":[{\"attributes\":[{\"name\":\"accountId\",\"value\":\"8fb25be6f99e74201a0949----------\"},{\"name\":\"serviceName\",\"value\":\"network-policy-enabled\"}],\"tags\":[{\"name\":\"tag_name\",\"value\":\"tag_value\"}]}]},\"log_type\":\"response\"}",
  "_rawline": null,
  "_ts": 1675722896609,
  "_app": "network-policy-app",
  "_ip": "169.48.229.253",
  "__key": "logline:ac14e5efab:network-policy-app:network-policy-app-5b85ff5769-5rfw5:ld12",
  "pod": "network-policy-app-5b85ff5769-5rfw5",
  "namespace": "network-policy",
  "container": "network-policy-app",
  "containerid": "65475728fd16bdf98ef0e2278cec34762c8e5db51febc87183aa4a5f89bd6a4b",
  "node": "kube-bu9hcu3d05b4j3r6ln0g-iamamprodus-service-0000103d\n",
  "_bid": "4c5d84f1-af86-4aab-a93e-aedb11b85a75:54807:ld12",
  "level": "info",
  "ts": "2023-02-06T22:34:56.361664732Z",
  "caller": "logging/middlewares.go:136",
  "message": "Response output",
  "environment": "prod",
  "instance_name": "network-policy-app-5b85ff5769-5rfw5",
  "transaction_id": "953579a6-c6eb-46dc-8bae-4482edf53ca6",
  "internal_tx_id": "52bf5b91-783f-4349-8174-be6ca2aba7fd",
  "client_ip": "10.241.115.14",
  "status_code": 200,
  "log_type": "response",
  "_service": "context-based-restrictions",
  "_method": "GET",
  "_path": "/v1/rules/d3c2665637d61788e61af2646d7c9d01",
  "_mezmo_line_size": 2354,
  "_id": "1575896048147550209",
  "headers": {
    "X-Correlation-Id": [
      "953579a6-c6eb-46dc-8bae-4482edf53ca6"
    ],
    "X-Ratelimit-Limit": [
      "10"
    ],
    "X-Ratelimit-Remaining": [
      "8"
    ],
    "X-Ratelimit-Reset": [
      "1675722896"
    ],
    "Etag": [
      "1-f9c5f67d7b4ece0273e5f1fd459043fb"
    ],
    "Content-Type": [
      "application/json; charset=utf-8"
    ],
    "X-Content-Type-Options": [
      "nosniff"
    ],
    "Transaction-Id": [
      "953579a6-c6eb-46dc-8bae-4482edf53ca6"
    ]
  },
  "resp_body": {
    "created_at": "2023-02-06T22:34:56Z",
    "created_by_id": "iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd",
    "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/8fb25be6f99e74201a094972d32b1235::rule:d3c2665637d61788e61af2646d7c9d01",
    "description": "A terraform example of rule",
    "enforcement_mode": "disabled",
    "href": "https://private.cbr.cloud.ibm.com/v1/rules/d3c2665637d61788e61af2646d7c9d01",
    "id": "d3c2665637d61788e61af2646d7c9d01",
    "last_modified_at": "2023-02-06T22:34:56Z",
    "last_modified_by_id": "iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd",
    "contexts": [
      {
        "o_attributes": [
          "{\n  \"name\": \"endpointType\",\n  \"value\": \"private\"\n}",
          "{\n  \"name\": \"networkZoneId\",\n  \"value\": \"567a0593b412f5396250bd42477b41cb\"\n}"
        ]
      }
    ],
    "resources": [
      {
        "o_attributes": [
          "{\n  \"name\": \"accountId\",\n  \"value\": \"8fb25be6f99e74201a0949-----------\"\n}",
          "{\n  \"name\": \"serviceName\",\n  \"value\": \"network-policy-enabled\"\n}"
        ],
        "o_tags": [
          "{\n  \"name\": \"tag_name\",\n  \"value\": \"tag_value\"\n}"
        ]
      }
    ]
  }
}
visibility = "public-and-private"
region = "eu-de"

Request Input

{
  "_tag": [
    "iam-am-prod-eu-de-fra04"
  ],
  "_account": "ac14e5efab",
  "_cluster": "ld12",
  "_host": "network-policy-app-ffb86d9c6-t292k",
  "_ingester": "supertenant",
  "_logtype": "json",
  "_file": "/var/log/containers/network-policy-app-ffb86d9c6-t292k_network-policy_network-policy-app-8d39a79a63a30ecc353ba3809e17148d39956f2107f53c609acf4b959c719556.log",
  "_line": "{\"level\":\"info\",\"ts\":\"2023-02-06T23:35:10.176040271Z\",\"caller\":\"logging/middlewares.go:96\",\"message\":\"Request input\",\"environment\":\"prod\",\"instance_name\":\"network-policy-app-ffb86d9c6-t292k\",\"service\":\"context-based-restrictions\",\"transaction_id\":\"b02feb1c-06de-4515-99f7-5b7a779e0d10\",\"internal_tx_id\":\"41b6dbad-8dce-4793-ae6e-136a1a17597f\",\"method\":\"GET\",\"path\":\"/v1/rules/ca1c2bb48b40ed7c595a6ff3ed27df57\",\"client_ip\":\"10.240.57.189\",\"headers\":{\"X-B3-Traceid\":[\"f2dfda4a175b15cce1034a971d2a7a33\"],\"Gateway-Cluster\":[\"iam-cse-prod-eu-de-fra02\"],\"X-Envoy-Peer-Metadata\":[\"ChQKDkFQUF9DT05UQUlORVJTEgIaAAoaCgpDTFVTVEVSX0lEEgwaCkt1YmVybmV0ZXMKIAoMSU5TVEFOQ0VfSVBTEhAaDjE3Mi4zMC4xMzAuMTYxChkKDUlTVElPX1ZFUlNJT04SCBoGMS4xNS40CocDCgZMQUJFTFMS/AIq+QIKHQoDYXBwEhYaFGlzdGlvLWluZ3Jlc3NnYXRld2F5CjYKKWluc3RhbGwub3BlcmF0b3IuaXN0aW8uaW8vb3duaW5nLXJlc291cmNlEgkaB3Vua25vd24KIAoFaXN0aW8SFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5ChkKDGlzdGlvLmlvL3JldhIJGgdkZWZhdWx0CjAKG29wZXJhdG9yLmlzdGlvLmlvL2NvbXBvbmVudBIRGg9JbmdyZXNzR2F0ZXdheXMKIAoRcG9kLXRlbXBsYXRlLWhhc2gSCxoJZjQ5ODY4OWJjCjoKH3NlcnZpY2UuaXN0aW8uaW8vY2Fub25pY2FsLW5hbWUSFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5Ci8KI3NlcnZpY2UuaXN0aW8uaW8vY2Fub25pY2FsLXJldmlzaW9uEggaBmxhdGVzdAoiChdzaWRlY2FyLmlzdGlvLmlvL2luamVjdBIHGgVmYWxzZQoaCgdNRVNIX0lEEg8aDWNsdXN0ZXIubG9jYWwKLwoETkFNRRInGiVjdXN0b20taW5ncmVzc2dhdGV3YXktZjQ5ODY4OWJjLWJrdmd4Ch4KCU5BTUVTUEFDRRIRGg9jdXN0b20tZ2F0ZXdheXMKYQoFT1dORVISWBpWa3ViZXJuZXRlczovL2FwaXMvYXBwcy92MS9uYW1lc3BhY2VzL2N1c3RvbS1nYXRld2F5cy9kZXBsb3ltZW50cy9jdXN0b20taW5ncmVzc2dhdGV3YXkKFwoRUExBVEZPUk1fTUVUQURBVEESAioACigKDVdPUktMT0FEX05BTUUSFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5\"],\"User-Agent\":[\"platform-services-go-sdk/0.31.0 (lang=go; arch=amd64; os=linux; go.version=go1.18.9)\"],\"Accept\":[\"application/json\"],\"X-Envoy-Internal\":[\"true\"],\"X-Request-Id\":[\"8e5ba863-baf3-47b9-9942-9f268a0f4ce2\"],\"X-Envoy-Attempt-Count\":[\"1\"],\"X-Real-Ip\":[\"10.12.123.104\"],\"True-Client-Ip\":[\"10.12.123.104\"],\"X-B3-Sampled\":[\"0\"],\"X-Global-K8fdic-Transaction-Id\":[\"0d5ad5ac6eec34ab63546ac62a41b1e6\"],\"Gateway-Id\":[\"iam-gateway-8.1-421-s662w\"],\"X-Original-User-Agent\":[\"terraform-provider-ibm/1.50.0\"],\"X-Forwarded-For\":[\"10.240.57.189\"],\"Cse-Ipaddress\":[\"166.9.248.78\"],\"Origin-Host\":[\"private.eu-de.cbr.cloud.ibm.com\"],\"Accept-Encoding\":[\"gzip\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Envoy-Decorator-Operation\":[\"network-policy-service.network-policy.svc.cluster.local:8080/v1/rules*\"],\"X-Envoy-Peer-Metadata-Id\":[\"router~172.30.130.161~custom-ingressgateway-f498689bc-bkvgx.custom-gateways~custom-gateways.svc.cluster.local\"],\"X-B3-Spanid\":[\"e1034a971d2a7a33\"],\"Host\":[\"cbr.cloud.ibm.com\"],\"Endpoint-Type\":[\"private\"]},\"query\":{},\"params\":{\"rule_id\":\"ca1c2bb48b40ed7c595a6ff3ed27df57\"},\"req_body\":null,\"log_type\":\"request\"}",
  "_rawline": null,
  "_ts": 1675726510404,
  "_app": "network-policy-app",
  "_ip": "161.156.186.34",
  "__key": "logline:ac14e5efab:network-policy-app:network-policy-app-ffb86d9c6-t292k:ld12",
  "pod": "network-policy-app-ffb86d9c6-t292k",
  "namespace": "network-policy",
  "container": "network-policy-app",
  "containerid": "8d39a79a63a30ecc353ba3809e17148d39956f2107f53c609acf4b959c719556",
  "node": "kube-bu9hm4df0bqmle8a8he0-iamamprodeu-service-00000cfb\n",
  "_bid": "0fb88e29-5400-4bea-95c7-fcdd856268b3:34831:ld12",
  "level": "info",
  "ts": "2023-02-06T23:35:10.176040271Z",
  "caller": "logging/middlewares.go:96",
  "message": "Request input",
  "environment": "prod",
  "instance_name": "network-policy-app-ffb86d9c6-t292k",
  "transaction_id": "b02feb1c-06de-4515-99f7-5b7a779e0d10",
  "internal_tx_id": "41b6dbad-8dce-4793-ae6e-136a1a17597f",
  "client_ip": "10.240.57.189",
  "log_type": "request",
  "_service": "context-based-restrictions",
  "_method": "GET",
  "_path": "/v1/rules/ca1c2bb48b40ed7c595a6ff3ed27df57",
  "_mezmo_line_size": 3336,
  "_id": "1575911205502111744",
  "headers": {
    "X-B3-Traceid": [
      "f2dfda4a175b15cce1034a971d2a7a33"
    ],
    "Gateway-Cluster": [
      "iam-cse-prod-eu-de-fra02"
    ],
    "X-Envoy-Peer-Metadata": [
      "ChQKDkFQUF9DT05UQUlORVJTEgIaAAoaCgpDTFVTVEVSX0lEEgwaCkt1YmVybmV0ZXMKIAoMSU5TVEFOQ0VfSVBTEhAaDjE3Mi4zMC4xMzAuMTYxChkKDUlTVElPX1ZFUlNJT04SCBoGMS4xNS40CocDCgZMQUJFTFMS/AIq+QIKHQoDYXBwEhYaFGlzdGlvLWluZ3Jlc3NnYXRld2F5CjYKKWluc3RhbGwub3BlcmF0b3IuaXN0aW8uaW8vb3duaW5nLXJlc291cmNlEgkaB3Vua25vd24KIAoFaXN0aW8SFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5ChkKDGlzdGlvLmlvL3JldhIJGgdkZWZhdWx0CjAKG29wZXJhdG9yLmlzdGlvLmlvL2NvbXBvbmVudBIRGg9JbmdyZXNzR2F0ZXdheXMKIAoRcG9kLXRlbXBsYXRlLWhhc2gSCxoJZjQ5ODY4OWJjCjoKH3NlcnZpY2UuaXN0aW8uaW8vY2Fub25pY2FsLW5hbWUSFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5Ci8KI3NlcnZpY2UuaXN0aW8uaW8vY2Fub25pY2FsLXJldmlzaW9uEggaBmxhdGVzdAoiChdzaWRlY2FyLmlzdGlvLmlvL2luamVjdBIHGgVmYWxzZQoaCgdNRVNIX0lEEg8aDWNsdXN0ZXIubG9jYWwKLwoETkFNRRInGiVjdXN0b20taW5ncmVzc2dhdGV3YXktZjQ5ODY4OWJjLWJrdmd4Ch4KCU5BTUVTUEFDRRIRGg9jdXN0b20tZ2F0ZXdheXMKYQoFT1dORVISWBpWa3ViZXJuZXRlczovL2FwaXMvYXBwcy92MS9uYW1lc3BhY2VzL2N1c3RvbS1nYXRld2F5cy9kZXBsb3ltZW50cy9jdXN0b20taW5ncmVzc2dhdGV3YXkKFwoRUExBVEZPUk1fTUVUQURBVEESAioACigKDVdPUktMT0FEX05BTUUSFxoVY3VzdG9tLWluZ3Jlc3NnYXRld2F5"
    ],
    "User-Agent": [
      "platform-services-go-sdk/0.31.0 (lang=go; arch=amd64; os=linux; go.version=go1.18.9)"
    ],
    "Accept": [
      "application/json"
    ],
    "X-Envoy-Internal": [
      "true"
    ],
    "X-Request-Id": [
      "8e5ba863-baf3-47b9-9942-9f268a0f4ce2"
    ],
    "X-Envoy-Attempt-Count": [
      "1"
    ],
    "X-Real-Ip": [
      "10.12.123.104"
    ],
    "True-Client-Ip": [
      "10.12.123.104"
    ],
    "X-B3-Sampled": [
      "0"
    ],
    "X-Global-K8fdic-Transaction-Id": [
      "0d5ad5ac6eec34ab63546ac62a41b1e6"
    ],
    "Gateway-Id": [
      "iam-gateway-8.1-421-s662w"
    ],
    "X-Original-User-Agent": [
      "terraform-provider-ibm/1.50.0"
    ],
    "X-Forwarded-For": [
      "10.240.57.189"
    ],
    "Cse-Ipaddress": [
      "166.9.248.78"
    ],
    "Origin-Host": [
      "private.eu-de.cbr.cloud.ibm.com"
    ],
    "Accept-Encoding": [
      "gzip"
    ],
    "X-Forwarded-Proto": [
      "https"
    ],
    "X-Envoy-Decorator-Operation": [
      "network-policy-service.network-policy.svc.cluster.local:8080/v1/rules*"
    ],
    "X-Envoy-Peer-Metadata-Id": [
      "router~172.30.130.161~custom-ingressgateway-f498689bc-bkvgx.custom-gateways~custom-gateways.svc.cluster.local"
    ],
    "X-B3-Spanid": [
      "e1034a971d2a7a33"
    ],
    "Host": [
      "cbr.cloud.ibm.com"
    ],
    "Endpoint-Type": [
      "private"
    ]
  },
  "query": {},
  "params": {
    "rule_id": "ca1c2bb48b40ed7c595a6ff3ed27df57"
  },
  "req_body": null
}

Response

{
  "_tag": [
    "iam-am-prod-eu-de-fra04"
  ],
  "_account": "ac14e5efab",
  "_cluster": "ld12",
  "_host": "network-policy-app-ffb86d9c6-t292k",
  "_ingester": "supertenant",
  "_logtype": "json",
  "_file": "/var/log/containers/network-policy-app-ffb86d9c6-t292k_network-policy_network-policy-app-8d39a79a63a30ecc353ba3809e17148d39956f2107f53c609acf4b959c719556.log",
  "_line": "{\"level\":\"info\",\"ts\":\"2023-02-06T23:35:10.215163129Z\",\"caller\":\"logging/middlewares.go:136\",\"message\":\"Response output\",\"environment\":\"prod\",\"instance_name\":\"network-policy-app-ffb86d9c6-t292k\",\"service\":\"context-based-restrictions\",\"transaction_id\":\"b02feb1c-06de-4515-99f7-5b7a779e0d10\",\"internal_tx_id\":\"41b6dbad-8dce-4793-ae6e-136a1a17597f\",\"method\":\"GET\",\"path\":\"/v1/rules/ca1c2bb48b40ed7c595a6ff3ed27df57\",\"client_ip\":\"10.240.57.189\",\"headers\":{\"X-Correlation-Id\":[\"b02feb1c-06de-4515-99f7-5b7a779e0d10\"],\"X-Ratelimit-Limit\":[\"10\"],\"X-Ratelimit-Remaining\":[\"8\"],\"X-Ratelimit-Reset\":[\"1675726510\"],\"Etag\":[\"1-7650ceec476198a56d7efe649b2122bf\"],\"Content-Type\":[\"application/json; charset=utf-8\"],\"X-Content-Type-Options\":[\"nosniff\"],\"Transaction-Id\":[\"b02feb1c-06de-4515-99f7-5b7a779e0d10\"]},\"status_code\":200,\"resp_body\":{\"contexts\":[{\"attributes\":[{\"name\":\"endpointType\",\"value\":\"private\"},{\"name\":\"networkZoneId\",\"value\":\"ca1c2bb48b40ed7c595a6ff3ed27daeb\"}]}],\"created_at\":\"2023-02-06T23:35:09Z\",\"created_by_id\":\"iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd\",\"crn\":\"crn:v1:bluemix:public:context-based-restrictions:global:a/8fb25be6f99e74201a094972d32b1235::rule:ca1c2bb48b40ed7c595a6ff3ed27df57\",\"description\":\"A terraform example of rule\",\"enforcement_mode\":\"disabled\",\"href\":\"https://private.eu-de.cbr.cloud.ibm.com/v1/rules/ca1c2bb48b40ed7c595a6ff3ed27df57\",\"id\":\"ca1c2bb48b40ed7c595a6ff3ed27df57\",\"last_modified_at\":\"2023-02-06T23:35:09Z\",\"last_modified_by_id\":\"iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd\",\"resources\":[{\"attributes\":[{\"name\":\"accountId\",\"value\":\"8fb25be6f99e74201a0949----------\"},{\"name\":\"serviceName\",\"value\":\"network-policy-enabled\"}],\"tags\":[{\"name\":\"tag_name\",\"value\":\"tag_value\"}]}]},\"log_type\":\"response\"}",
  "_rawline": null,
  "_ts": 1675726510404,
  "_app": "network-policy-app",
  "_ip": "161.156.186.34",
  "__key": "logline:ac14e5efab:network-policy-app:network-policy-app-ffb86d9c6-t292k:ld12",
  "pod": "network-policy-app-ffb86d9c6-t292k",
  "namespace": "network-policy",
  "container": "network-policy-app",
  "containerid": "8d39a79a63a30ecc353ba3809e17148d39956f2107f53c609acf4b959c719556",
  "node": "kube-bu9hm4df0bqmle8a8he0-iamamprodeu-service-00000cfb\n",
  "_bid": "0fb88e29-5400-4bea-95c7-fcdd856268b3:34831:ld12",
  "level": "info",
  "ts": "2023-02-06T23:35:10.215163129Z",
  "caller": "logging/middlewares.go:136",
  "message": "Response output",
  "environment": "prod",
  "instance_name": "network-policy-app-ffb86d9c6-t292k",
  "transaction_id": "b02feb1c-06de-4515-99f7-5b7a779e0d10",
  "internal_tx_id": "41b6dbad-8dce-4793-ae6e-136a1a17597f",
  "client_ip": "10.240.57.189",
  "status_code": 200,
  "log_type": "response",
  "_service": "context-based-restrictions",
  "_method": "GET",
  "_path": "/v1/rules/ca1c2bb48b40ed7c595a6ff3ed27df57",
  "_mezmo_line_size": 2353,
  "_id": "1575911205502111748",
  "headers": {
    "X-Correlation-Id": [
      "b02feb1c-06de-4515-99f7-5b7a779e0d10"
    ],
    "X-Ratelimit-Limit": [
      "10"
    ],
    "X-Ratelimit-Remaining": [
      "8"
    ],
    "X-Ratelimit-Reset": [
      "1675726510"
    ],
    "Etag": [
      "1-7650ceec476198a56d7efe649b2122bf"
    ],
    "Content-Type": [
      "application/json; charset=utf-8"
    ],
    "X-Content-Type-Options": [
      "nosniff"
    ],
    "Transaction-Id": [
      "b02feb1c-06de-4515-99f7-5b7a779e0d10"
    ]
  },
  "resp_body": {
    "created_at": "2023-02-06T23:35:09Z",
    "created_by_id": "iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd",
    "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/8fb25be6f99e74201a094972d32b1235::rule:ca1c2bb48b40ed7c595a6ff3ed27df57",
    "description": "A terraform example of rule",
    "enforcement_mode": "disabled",
    "href": "https://private.eu-de.cbr.cloud.ibm.com/v1/rules/ca1c2bb48b40ed7c595a6ff3ed27df57",
    "id": "ca1c2bb48b40ed7c595a6ff3ed27df57",
    "last_modified_at": "2023-02-06T23:35:09Z",
    "last_modified_by_id": "iam-ServiceId-a081b279-cc3b-41af-9f29-7f30b5db18fd",
    "contexts": [
      {
        "o_attributes": [
          "{\n  \"name\": \"endpointType\",\n  \"value\": \"private\"\n}",
          "{\n  \"name\": \"networkZoneId\",\n  \"value\": \"ca1c2bb48b40ed7c595a6ff3ed27daeb\"\n}"
        ]
      }
    ],
    "resources": [
      {
        "o_attributes": [
          "{\n  \"name\": \"accountId\",\n  \"value\": \"8fb25be6f99e74201a0949----------\"\n}",
          "{\n  \"name\": \"serviceName\",\n  \"value\": \"network-policy-enabled\"\n}"
        ],
        "o_tags": [
          "{\n  \"name\": \"tag_name\",\n  \"value\": \"tag_value\"\n}"
        ]
      }
    ]
  }
}

@zhenwan
Copy link
Contributor Author

zhenwan commented Feb 7, 2023

  visibility = "private"
  region = "us-east"
  endpoints_file_path = "endpointFile.json"

transaction_id25b62b32-762d-4dea-b1cb-dd3882a459b5
looks good

@hkantare hkantare merged commit 4122741 into IBM-Cloud:master Feb 8, 2023
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.

3 participants