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

add HSP IAM audit capabilities #52

Merged
merged 4 commits into from
Jul 3, 2024

Conversation

EriksonBahr
Copy link

@EriksonBahr EriksonBahr commented Jul 1, 2024

Description

Add HSDP IAM audit capabilities to oauth2 proxy

Motivation and Context

HSDP IAM does not provide important audit capabilities out of the box such as successful login and some key auth errors.

How Has This Been Tested?

Tested locally with:

export OAUTH2_PROXY_ENABLE_AUDIT='true'
export OAUTH2_PROXY_AUDIT_URL='url'
export OAUTH2_PROXY_AUDIT_PRODUCT_NAME='Reporting'
export OAUTH2_PROXY_AUDIT_PRODUCT_KEY='product key'
export OAUTH2_PROXY_AUDIT_SHARED_KEY='shared key'
export OAUTH2_PROXY_AUDIT_SECRET_KEY='secret'

Example of the payload:

{
  "resourceType": "AuditEvent",
  "event": {
    "type": {
      "system": "http://hl7.org/fhir/ValueSet/audit-event-type",
      "version": "1",
      "code": "110114",
      "display": "User Authentication"
    },
    "action": "E",
    "dateTime": "2024-07-03T16:34:44Z",
    "outcome": "0",
    "outcomeDesc": "Success"
  },
  "participant": [
    {
      "userId": { "value": "[email protected]" },
      "altId": "admin_t952",
      "requestor": true
    }
  ],
  "source": {
    "identifier": {
      "type": {
        "system": "http://hl7.org/fhir/ValueSet/audit-source-type",
        "code": "4",
        "display": "Application Server"
      },
      "value": "[email protected]"
    },
    "type": [
      {
        "system": "http://hl7.org/fhir/security-source-type",
        "code": "1",
        "display": "End-user display device, diagnostic device."
      }
    ],
    "extension": [
      {
        "url": "/pics/reporting?procedure.identifier=https%3A%2F%2Fwww.philips.com%2Fidentifiers%2FProcedureIdentifier|ACC_20240625221043040",
        "extension": [
          { "url": "applicationName", "valueString": "Reporting" },
          { "url": "applicationVersion", "valueString": "1" },
          { "url": "serverName", "valueString": "oauth2proxy" },
          { "url": "componentName", "valueString": "oauth2proxy" },
          {
            "url": "productKey",
            "valueString": "<omited>"
          },
          {
            "url": "tenant",
            "valueString": "3b64ff86-8ecf-47cb-8431-bedf41318e43"
          }
        ]
      }
    ]
  }
}

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

evozniak
evozniak previously approved these changes Jul 2, 2024
Copy link
Member

@evozniak evozniak left a comment

Choose a reason for hiding this comment

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

Minor comments, looking good.

pkg/middleware/cookie_refresh.go Show resolved Hide resolved
pkg/audit/audit_client.go Outdated Show resolved Hide resolved
pkg/audit/audit_client.go Outdated Show resolved Hide resolved
pkg/audit/audit_client.go Outdated Show resolved Hide resolved
@evozniak evozniak merged commit 8f7537a into philips-forks:pics Jul 3, 2024
3 checks passed
@EriksonBahr EriksonBahr deleted the add-iam-audit branch July 3, 2024 13:11
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.

2 participants