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 logging for test LdapServer actions #3933

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

peternied
Copy link
Member

@peternied peternied commented Jan 9, 2024

Description

Add logging for test LdapServer actions. Looks like the failure was a one time network issue, but this logging should provide answers if anything happens again.

Issues Resolved

Testing

Ran locally, get messages like:

[2024-01-09T22:28:04,941][DEBUG][com.amazon.dlic.auth.ldap.backend.LDAPAuthorizationBackend] Opened a connection, total count is now 1
[2024-01-09T22:28:04,941][INFO ][com.amazon.dlic.auth.ldap.srv.LdapServer.ServerLogger] CONNECT conn=11 from="127.0.0.1:53892" to="127.0.0.1:14388"

[2024-01-09T22:28:04,941][DEBUG][com.amazon.dlic.auth.ldap.backend.LDAPAuthorizationBackend] DBGTRACE (5): authenticatedUser=spock -> [115, 112, 111, 99, 107]
[2024-01-09T22:28:04,942][INFO ][com.amazon.dlic.auth.ldap.srv.LdapServer.ServerLogger] conn=11 from="127.0.0.1:53892" to="127.0.0.1:14388"
LDAP Message:
     Message ID:  1
     Search Request Protocol Op:
          Base DN:  ou=people,o=TEST
          Scope:  SUB
          Dereference Policy:  ALWAYS
          Size Limit:  0
          Time Limit:  0
          Types Only:  false
          Filter:  (uid=spock)
          Requested Attributes:
               *
               +

[2024-01-09T22:28:04,942][INFO ][com.amazon.dlic.auth.ldap.srv.LdapServer.ServerLogger] [09/Jan/2024:22:28:04 +0000] SEARCH REQUEST conn=11 op=0 msgID=1 base="ou=people,o=TEST" scope=2 filter="(uid=spock)" attrs="*,+"
[2024-01-09T22:28:04,943][INFO ][com.amazon.dlic.auth.ldap.srv.LdapServer.ServerLogger] conn=11 from="127.0.0.1:53892" to="127.0.0.1:14388"
LDAP Message:
     Message ID:  1
     Search Result Entry Protocol Op:
          dn: cn=Captain Spock,ou=people,o=TEST
          objectClass: inetOrgPerson
          objectClass: organizationalPerson
          objectClass: person
          objectClass: top
          cn: Captain Spock
          sn: spock
          uid: spock
          userpassword: spocksecret
          mail: [email protected]
          description: cn=dummyempty,ou=groups,o=TEST
          description: cn=rolemo4,ou=groups,o=TEST
          ou: Human Resources
          entryDN: cn=captain spock,ou=people,o=test
          entryUUID: 3d0655e7-99e4-4929-a706-a9ca0ead1863
          subschemaSubentry: cn=schema
          creatorsName: cn=Internal Root User
          createTimestamp: 20240109222804.475Z
          modifiersName: cn=Internal Root User
          modifyTimestamp: 20240109222804.475Z

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (045d4ef) 65.16% compared to head (a4c56be) 65.30%.
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3933      +/-   ##
==========================================
+ Coverage   65.16%   65.30%   +0.13%     
==========================================
  Files         298      298              
  Lines       21218    21218              
  Branches     3457     3457              
==========================================
+ Hits        13827    13856      +29     
+ Misses       5676     5643      -33     
- Partials     1715     1719       +4     

see 2 files with indirect coverage changes

@peternied peternied merged commit b905999 into opensearch-project:main Jan 11, 2024
82 checks passed
@peternied peternied deleted the ldap-logger branch January 11, 2024 17:56
@peternied peternied added the backport 2.x backport to 2.x branch label Jan 11, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 11, 2024
Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit b905999)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
willyborankin pushed a commit that referenced this pull request Jan 11, 2024
Backport b905999 from #3933.

Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flaky Test] com.amazon.dlic.auth.ldap.LdapBackendTest.testMultiCn is flaky
3 participants