SlideShare a Scribd company logo
1 of 12
Download to read offline
PROXYUSERAUTHENTICATION
Enrico Cairo
31/01/2019
1
- - 31/01/2019Proxy User Authentication 2
https://www.facebook.com/AskDbaForInfo/
https://www.linkedin.com/in/cairoenrico/
https://twitter.com/DbaAsk
http://www.ask-dba-for.Info
- -
MISUNDERSTANDING
31/01/20193Proxy User Authentication
Proxy User Authentication != User Authentication by Proxy
- -
SCENARIO
31/01/20194Proxy User Authentication
Normal user
GRANTS
select any table
drop any table
- -
SCENARIO
31/01/20195Proxy User Authentication
SQL> conn / as sysdba
Connected.
SQL> CREATE TABLE sys.dummy (id NUMBER);
Table created.
SQL> CREATE TABLE system.dummy (id NUMBER);
Table created.
SQL> CREATE USER jane IDENTIFIED BY "doe"
2 DEFAULT TABLESPACE users
3 TEMPORARY TABLESPACE temp
4 ACCOUNT UNLOCK;
User created.
SQL> GRANT CREATE SESSION TO jane;
Grant succeeded.
SQL> GRANT SELECT ANY TABLE TO jane;
Grant succeeded.
SQL> GRANT DROP ANY TABLE TO jane;
Grant succeeded.
SQL>
SQL> conn jane/doe
Connected.
SQL> DROP TABLE sys.dummy;
DROP TABLE sys.dummy
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> SELECT * FROM sys.dummy;
SELECT * FROM sys.dummy
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> SELECT * FROM system.dummy;
no rows selected
SQL> DROP TABLE system.dummy;
Table dropped.
SQL>
- -
ARE THEY REAL WORKAROUNDS?
31/01/20196Proxy User Authentication
whenever sqlerror exit
column password new_value pw
declare
l_passwd varchar2(45);
begin
select password into l_passwd from sys.dba_users where username =
upper('&1');
end;
/
select password
from sys.dba_users
where username = upper( '&1' )
/
alter user &1 identified by Hello;
connect &1/hello
alter user &1 identified by values '&pw';
show user
whenever sqlerror continue
SQL> alter session set current schema = โ€˜johnโ€™;
- -
REAL WORKAROUND
31/01/20197Proxy User Authentication
Since Oracle 9i Release 2
SQL> create user PROXY identified by PROXY default tablespace USERS;
SQL> alter user OWNER grant connect through PROXY;
SQL> conn PROXY[OWNER]/PROXY
SQL> show user
USER is "OWNER"
- -
CHECKING
31/01/20198Proxy User Authentication
SQL> conn / as sysdba
Connected.
SQL> REVOKE DROP ANY TABLE FROM jane;
Revoke succeeded.
SQL> CREATE USER john IDENTIFIED BY "doe"
2 DEFAULT TABLESPACE users
3 TEMPORARY TABLESPACE temp
4 ACCOUNT UNLOCK;
User created.
SQL> GRANT CREATE SESSION TO john;
Grant succeeded.
SQL> GRANT RESOURCE TO john;
Grant succeeded.
SQL> ALTER USER john QUOTA UNLIMITED ON
users;
User altered.
SQL> CREATE TABLE john.dummy (id NUMBER);
Table created.
SQL> ALTER USER john GRANT CONNECT THROUGH
jane;
User altered.
SQL> AUDIT SESSION BY jane;
Audit succeeded.
SQL> conn jane/doe
Connected.
SQL> SELECT * FROM john.dummy;
no rows selected
SQL> DROP TABLE john.dummy;
DROP TABLE john.dummy
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> conn jane[john]/doe
Connected.
SQL> show user
USER is "john"
SQL> DROP TABLE dummy;
Table dropped.
- -
AUDIT
31/01/20199Proxy User Authentication
SQL> conn / as sysdba
Connected.
SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss';
SQL> SET LINES 132 PAGES 60 TRIMS ON
SQL> COL username for a13
SQL> COL proxy_user for a13
SQL> COL obj_name for a13
SQL> COL timestamp for a20
SQL> SELECT a.username,
2 b.username proxy_user,
3 a.obj_name,
4 a.returncode,
5 a.timestamp,
6 a.sessionid,
7 a.proxy_sessionid
8 FROM dba_audit_trail a,
9 dba_audit_trail b
10 WHERE a.action_name = 'DROP TABLE'
11 AND a.proxy_sessionid = b.sessionid
12 AND b.action_name = 'PROXY AUTHENTICATION ONLY'
13 ORDER BY sessionid;
USERNAME PROXY_USER OBJ_NAME RETURNCODE TIMESTAMP SESSIONID PROXY_SESSIONID
------------- ------------- ------------- ---------- -------------------- ---------- ---------------
JOHN JANE DUMMY 0 2018-09-14 14:27:44 295832023 295832022
- -
REMARKS
31/01/201910Proxy User Authentication
SQL> ALTER USER john ACCOUNT LOCK;
User altered.
SQL> conn jane[john]/doe
ERROR:
ORA-28000: the account is locked
Warning: You are no longer connected to ORACLE.
SQL>
What happens if user โ€˜johnโ€™ is locked and โ€˜janeโ€™ tries to login through him?
- -
REMARKS
31/01/201911Proxy User Authentication
SQL> conn jane[john]/doe
Connected.
SQL> col "whoami" for a25
SQL> col "who am i" for a25
SQL> col "sid" for a10
SQL> SELECT sys_context('userenv','session_user') "whoami",
2 sys_context('userenv','proxy_user') "who am i",
3 sys_context('userenv','sid') "sid"
4 FROM dual;
whoami who am i sid
------------------------- ------------------------- ----------
JOHN JANE 878
SQL> conn jane/doe
Connected.
SQL> SELECT sys_context('userenv','session_user') "whoami",
2 sys_context('userenv','proxy_user') "who am i",
3 sys_context('userenv','sid') "sid"
4 FROM dual;
whoami who am i sid
------------------------- ------------------------- ----------
JANE 878
SQL>
Can I check which kind of method Iโ€™m using for login, similar to *nix environment?
- -
REMARKS
01/02/201912Proxy User Authentication
SQL> SELECT * FROM proxy_users;
PROXY CLIENT AUT FLAGS
------------------------- ------------------------- --- -----------------------------------
JANE JOHN NO PROXY MAY ACTIVATE ALL CLIENT ROLES
SQL> col username for a25
SQL> col network_service_banner for a100
SQL> SELECT s.username, s.sid, s.serial#, s.state, c.network_service_banner
2 FROM v$session s,
3 v$session_connect_info c
4 WHERE s.sid = c.sid
5 AND s.serial# = c.serial#
6 AND c.authentication_type = 'PROXY';
USERNAME SID SERIAL# STATE
------------------------------ ---------- ---------- -------------------
NETWORK_SERVICE_BANNER
----------------------------------------------------------------------------------------------------
JOHN 878 19357 WAITING
Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
JOHN 878 19357 WAITING
Oracle Advanced Security: authentication service for Linux: Version 11.2.0.3.0 - Production
JOHN 878 19357 WAITING
Oracle Advanced Security: encryption service for Linux: Version 11.2.0.3.0 - Production
JOHN 878 19357 WAITING
Oracle Advanced Security: crypto-checksumming service for Linux: Version 11.2.0.3.0 - Production
Can I realize someone is logged into my instance by using this feature without looking audit trail?

More Related Content

Similar to Proxy authentication Itoug TechDays 2019

Manage users & tables in Oracle Database
Manage users & tables in Oracle DatabaseManage users & tables in Oracle Database
Manage users & tables in Oracle DatabaseNR Computer Learning Center
ย 
1. Create a View that allows students to view their own informatio.docx
1. Create a View that allows students to view their own informatio.docx1. Create a View that allows students to view their own informatio.docx
1. Create a View that allows students to view their own informatio.docxketurahhazelhurst
ย 
Intro to SQL Injection
Intro to SQL InjectionIntro to SQL Injection
Intro to SQL Injectionhon1nbo
ย 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Colin O'Dell
ย 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
ย 
Hacking Your Way To Better Security
Hacking Your Way To Better SecurityHacking Your Way To Better Security
Hacking Your Way To Better SecurityColin O'Dell
ย 
MySQL server security
MySQL server securityMySQL server security
MySQL server securityDamien Seguy
ย 
Sql injection presentation
Sql injection presentationSql injection presentation
Sql injection presentationZara Joe
ย 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2Osama Mustafa
ย 
Web Application Security in Rails
Web Application Security in RailsWeb Application Security in Rails
Web Application Security in RailsUri Nativ
ย 
Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016Colin O'Dell
ย 
Banking Database
Banking DatabaseBanking Database
Banking DatabaseAshwin Dinoriya
ย 
Locking Down Your MySQL Database.pptx
Locking Down Your MySQL Database.pptxLocking Down Your MySQL Database.pptx
Locking Down Your MySQL Database.pptxDave Stokes
ย 
Easy logins for JavaScript web applications
Easy logins for JavaScript web applicationsEasy logins for JavaScript web applications
Easy logins for JavaScript web applicationsFrancois Marier
ย 
Percona Live 2012PPT๏ผšmysql-security-privileges-and-user-management
Percona Live 2012PPT๏ผšmysql-security-privileges-and-user-managementPercona Live 2012PPT๏ผšmysql-security-privileges-and-user-management
Percona Live 2012PPT๏ผšmysql-security-privileges-and-user-managementmysqlops
ย 
07 application security fundamentals - part 2 - security mechanisms - data ...
07   application security fundamentals - part 2 - security mechanisms - data ...07   application security fundamentals - part 2 - security mechanisms - data ...
07 application security fundamentals - part 2 - security mechanisms - data ...appsec
ย 
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 201510 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015Scott Sutherland
ย 
DJ-02-Model-Single.pptx
DJ-02-Model-Single.pptxDJ-02-Model-Single.pptx
DJ-02-Model-Single.pptxjoeveller
ย 
kill_session_procedure.docx
kill_session_procedure.docxkill_session_procedure.docx
kill_session_procedure.docxSUNIL884268
ย 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performancerobgalvinjr
ย 

Similar to Proxy authentication Itoug TechDays 2019 (20)

Manage users & tables in Oracle Database
Manage users & tables in Oracle DatabaseManage users & tables in Oracle Database
Manage users & tables in Oracle Database
ย 
1. Create a View that allows students to view their own informatio.docx
1. Create a View that allows students to view their own informatio.docx1. Create a View that allows students to view their own informatio.docx
1. Create a View that allows students to view their own informatio.docx
ย 
Intro to SQL Injection
Intro to SQL InjectionIntro to SQL Injection
Intro to SQL Injection
ย 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
ย 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
ย 
Hacking Your Way To Better Security
Hacking Your Way To Better SecurityHacking Your Way To Better Security
Hacking Your Way To Better Security
ย 
MySQL server security
MySQL server securityMySQL server security
MySQL server security
ย 
Sql injection presentation
Sql injection presentationSql injection presentation
Sql injection presentation
ย 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2
ย 
Web Application Security in Rails
Web Application Security in RailsWeb Application Security in Rails
Web Application Security in Rails
ย 
Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016Hacking Your Way To Better Security - php[tek] 2016
Hacking Your Way To Better Security - php[tek] 2016
ย 
Banking Database
Banking DatabaseBanking Database
Banking Database
ย 
Locking Down Your MySQL Database.pptx
Locking Down Your MySQL Database.pptxLocking Down Your MySQL Database.pptx
Locking Down Your MySQL Database.pptx
ย 
Easy logins for JavaScript web applications
Easy logins for JavaScript web applicationsEasy logins for JavaScript web applications
Easy logins for JavaScript web applications
ย 
Percona Live 2012PPT๏ผšmysql-security-privileges-and-user-management
Percona Live 2012PPT๏ผšmysql-security-privileges-and-user-managementPercona Live 2012PPT๏ผšmysql-security-privileges-and-user-management
Percona Live 2012PPT๏ผšmysql-security-privileges-and-user-management
ย 
07 application security fundamentals - part 2 - security mechanisms - data ...
07   application security fundamentals - part 2 - security mechanisms - data ...07   application security fundamentals - part 2 - security mechanisms - data ...
07 application security fundamentals - part 2 - security mechanisms - data ...
ย 
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 201510 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
ย 
DJ-02-Model-Single.pptx
DJ-02-Model-Single.pptxDJ-02-Model-Single.pptx
DJ-02-Model-Single.pptx
ย 
kill_session_procedure.docx
kill_session_procedure.docxkill_session_procedure.docx
kill_session_procedure.docx
ย 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performance
ย 

Recently uploaded

Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
ย 
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...amitlee9823
ย 
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
ย 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
ย 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
ย 
Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...amitlee9823
ย 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
ย 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
ย 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
ย 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
ย 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
ย 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
ย 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
ย 
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...amitlee9823
ย 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
ย 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
ย 

Recently uploaded (20)

Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
ย 
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore ...
ย 
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
ย 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
ย 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
ย 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
ย 
Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: ๐Ÿ“ 7737669865 ๐Ÿ“ High Profile Model Escorts | Bangalore...
ย 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
ย 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
ย 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
ย 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
ย 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
ย 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
ย 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
ย 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
ย 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
ย 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
ย 
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
Call Girls Indiranagar Just Call ๐Ÿ‘— 7737669865 ๐Ÿ‘— Top Class Call Girl Service B...
ย 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
ย 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
ย 

Proxy authentication Itoug TechDays 2019

  • 2. - - 31/01/2019Proxy User Authentication 2 https://www.facebook.com/AskDbaForInfo/ https://www.linkedin.com/in/cairoenrico/ https://twitter.com/DbaAsk http://www.ask-dba-for.Info
  • 3. - - MISUNDERSTANDING 31/01/20193Proxy User Authentication Proxy User Authentication != User Authentication by Proxy
  • 4. - - SCENARIO 31/01/20194Proxy User Authentication Normal user GRANTS select any table drop any table
  • 5. - - SCENARIO 31/01/20195Proxy User Authentication SQL> conn / as sysdba Connected. SQL> CREATE TABLE sys.dummy (id NUMBER); Table created. SQL> CREATE TABLE system.dummy (id NUMBER); Table created. SQL> CREATE USER jane IDENTIFIED BY "doe" 2 DEFAULT TABLESPACE users 3 TEMPORARY TABLESPACE temp 4 ACCOUNT UNLOCK; User created. SQL> GRANT CREATE SESSION TO jane; Grant succeeded. SQL> GRANT SELECT ANY TABLE TO jane; Grant succeeded. SQL> GRANT DROP ANY TABLE TO jane; Grant succeeded. SQL> SQL> conn jane/doe Connected. SQL> DROP TABLE sys.dummy; DROP TABLE sys.dummy * ERROR at line 1: ORA-00942: table or view does not exist SQL> SELECT * FROM sys.dummy; SELECT * FROM sys.dummy * ERROR at line 1: ORA-00942: table or view does not exist SQL> SELECT * FROM system.dummy; no rows selected SQL> DROP TABLE system.dummy; Table dropped. SQL>
  • 6. - - ARE THEY REAL WORKAROUNDS? 31/01/20196Proxy User Authentication whenever sqlerror exit column password new_value pw declare l_passwd varchar2(45); begin select password into l_passwd from sys.dba_users where username = upper('&1'); end; / select password from sys.dba_users where username = upper( '&1' ) / alter user &1 identified by Hello; connect &1/hello alter user &1 identified by values '&pw'; show user whenever sqlerror continue SQL> alter session set current schema = โ€˜johnโ€™;
  • 7. - - REAL WORKAROUND 31/01/20197Proxy User Authentication Since Oracle 9i Release 2 SQL> create user PROXY identified by PROXY default tablespace USERS; SQL> alter user OWNER grant connect through PROXY; SQL> conn PROXY[OWNER]/PROXY SQL> show user USER is "OWNER"
  • 8. - - CHECKING 31/01/20198Proxy User Authentication SQL> conn / as sysdba Connected. SQL> REVOKE DROP ANY TABLE FROM jane; Revoke succeeded. SQL> CREATE USER john IDENTIFIED BY "doe" 2 DEFAULT TABLESPACE users 3 TEMPORARY TABLESPACE temp 4 ACCOUNT UNLOCK; User created. SQL> GRANT CREATE SESSION TO john; Grant succeeded. SQL> GRANT RESOURCE TO john; Grant succeeded. SQL> ALTER USER john QUOTA UNLIMITED ON users; User altered. SQL> CREATE TABLE john.dummy (id NUMBER); Table created. SQL> ALTER USER john GRANT CONNECT THROUGH jane; User altered. SQL> AUDIT SESSION BY jane; Audit succeeded. SQL> conn jane/doe Connected. SQL> SELECT * FROM john.dummy; no rows selected SQL> DROP TABLE john.dummy; DROP TABLE john.dummy * ERROR at line 1: ORA-01031: insufficient privileges SQL> conn jane[john]/doe Connected. SQL> show user USER is "john" SQL> DROP TABLE dummy; Table dropped.
  • 9. - - AUDIT 31/01/20199Proxy User Authentication SQL> conn / as sysdba Connected. SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd hh24:mi:ss'; SQL> SET LINES 132 PAGES 60 TRIMS ON SQL> COL username for a13 SQL> COL proxy_user for a13 SQL> COL obj_name for a13 SQL> COL timestamp for a20 SQL> SELECT a.username, 2 b.username proxy_user, 3 a.obj_name, 4 a.returncode, 5 a.timestamp, 6 a.sessionid, 7 a.proxy_sessionid 8 FROM dba_audit_trail a, 9 dba_audit_trail b 10 WHERE a.action_name = 'DROP TABLE' 11 AND a.proxy_sessionid = b.sessionid 12 AND b.action_name = 'PROXY AUTHENTICATION ONLY' 13 ORDER BY sessionid; USERNAME PROXY_USER OBJ_NAME RETURNCODE TIMESTAMP SESSIONID PROXY_SESSIONID ------------- ------------- ------------- ---------- -------------------- ---------- --------------- JOHN JANE DUMMY 0 2018-09-14 14:27:44 295832023 295832022
  • 10. - - REMARKS 31/01/201910Proxy User Authentication SQL> ALTER USER john ACCOUNT LOCK; User altered. SQL> conn jane[john]/doe ERROR: ORA-28000: the account is locked Warning: You are no longer connected to ORACLE. SQL> What happens if user โ€˜johnโ€™ is locked and โ€˜janeโ€™ tries to login through him?
  • 11. - - REMARKS 31/01/201911Proxy User Authentication SQL> conn jane[john]/doe Connected. SQL> col "whoami" for a25 SQL> col "who am i" for a25 SQL> col "sid" for a10 SQL> SELECT sys_context('userenv','session_user') "whoami", 2 sys_context('userenv','proxy_user') "who am i", 3 sys_context('userenv','sid') "sid" 4 FROM dual; whoami who am i sid ------------------------- ------------------------- ---------- JOHN JANE 878 SQL> conn jane/doe Connected. SQL> SELECT sys_context('userenv','session_user') "whoami", 2 sys_context('userenv','proxy_user') "who am i", 3 sys_context('userenv','sid') "sid" 4 FROM dual; whoami who am i sid ------------------------- ------------------------- ---------- JANE 878 SQL> Can I check which kind of method Iโ€™m using for login, similar to *nix environment?
  • 12. - - REMARKS 01/02/201912Proxy User Authentication SQL> SELECT * FROM proxy_users; PROXY CLIENT AUT FLAGS ------------------------- ------------------------- --- ----------------------------------- JANE JOHN NO PROXY MAY ACTIVATE ALL CLIENT ROLES SQL> col username for a25 SQL> col network_service_banner for a100 SQL> SELECT s.username, s.sid, s.serial#, s.state, c.network_service_banner 2 FROM v$session s, 3 v$session_connect_info c 4 WHERE s.sid = c.sid 5 AND s.serial# = c.serial# 6 AND c.authentication_type = 'PROXY'; USERNAME SID SERIAL# STATE ------------------------------ ---------- ---------- ------------------- NETWORK_SERVICE_BANNER ---------------------------------------------------------------------------------------------------- JOHN 878 19357 WAITING Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production JOHN 878 19357 WAITING Oracle Advanced Security: authentication service for Linux: Version 11.2.0.3.0 - Production JOHN 878 19357 WAITING Oracle Advanced Security: encryption service for Linux: Version 11.2.0.3.0 - Production JOHN 878 19357 WAITING Oracle Advanced Security: crypto-checksumming service for Linux: Version 11.2.0.3.0 - Production Can I realize someone is logged into my instance by using this feature without looking audit trail?