Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
9683c117
Commit
9683c117
authored
Jan 12, 2017
by
Neeru Gupta
Committed by
Vimal Sharma
Jan 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add exclusion mechanism for Atlas audit mechanism
parent
384c3358
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
release-log.txt
release-log.txt
+2
-0
AtlasRepositoryConfiguration.java
...a/org/apache/atlas/util/AtlasRepositoryConfiguration.java
+4
-2
AuditFilter.java
...c/main/java/org/apache/atlas/web/filters/AuditFilter.java
+8
-3
AuditFilterTest.java
...st/java/org/apache/atlas/web/filters/AuditFilterTest.java
+7
-0
No files found.
release-log.txt
View file @
9683c117
...
...
@@ -9,6 +9,8 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ATLAS-1391 Add exclusion mechanism for Atlas audit mechanism (guptaneeru via svimal2106)
ATLAS-1280 Atlas changes to support Hive hook for Hive2 (mneethiraj via svimal2106)
ATLAS-1432 Responsive loader and css changes (kevalbhatt via mneethiraj)
ATLAS-1434 Updated typename validation to allow "." for classifications (ashutoshm via mneethiraj)
ATLAS-1435 include common attributes in v2 entity API response (svimal2106 via mneethiraj)
...
...
repository/src/main/java/org/apache/atlas/util/AtlasRepositoryConfiguration.java
View file @
9683c117
...
...
@@ -102,13 +102,15 @@ public class AtlasRepositoryConfiguration {
* Get the list of operations which are configured to be skipped from auditing
* Valid format is HttpMethod:URL eg: GET:Version
* @return list of string
* @throws AtlasException
*/
public
static
List
<
String
>
getAuditExcludedOperations
(
Configuration
config
)
{
public
static
List
<
String
>
getAuditExcludedOperations
(
Configuration
config
)
throws
AtlasException
{
if
(
config
==
null
)
{
try
{
config
=
ApplicationProperties
.
get
();
}
catch
(
AtlasException
e
)
{
LOG
.
error
(
" Error reading operations for auditing "
,
e
);
throw
e
;
}
}
if
(
skippedOperations
==
null
)
{
...
...
@@ -130,7 +132,7 @@ public class AtlasRepositoryConfiguration {
return
skippedOperations
;
}
public
static
boolean
isExcludedFromAudit
(
Configuration
config
,
String
httpMethod
,
String
httpUrl
)
{
public
static
boolean
isExcludedFromAudit
(
Configuration
config
,
String
httpMethod
,
String
httpUrl
)
throws
AtlasException
{
if
(
getAuditExcludedOperations
(
config
).
size
()
>
0
)
{
return
getAuditExcludedOperations
(
config
).
contains
(
httpMethod
.
toLowerCase
()
+
SEPARATOR
+
httpUrl
.
toLowerCase
());
}
else
{
...
...
webapp/src/main/java/org/apache/atlas/web/filters/AuditFilter.java
View file @
9683c117
...
...
@@ -19,11 +19,13 @@
package
org
.
apache
.
atlas
.
web
.
filters
;
import
com.google.inject.Singleton
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.RequestContext
;
import
org.apache.atlas.metrics.Metrics
;
import
org.apache.atlas.util.AtlasRepositoryConfiguration
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.atlas.util.AtlasRepositoryConfiguration
;
import
org.apache.atlas.web.util.DateTimeHelper
;
import
org.apache.atlas.web.util.Servlets
;
import
org.slf4j.Logger
;
...
...
@@ -40,7 +42,6 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
/**
...
...
@@ -126,7 +127,11 @@ public class AuditFilter implements Filter {
}
boolean
isOperationExcludedFromAudit
(
String
requestHttpMethod
,
String
requestOperation
,
Configuration
config
)
{
return
AtlasRepositoryConfiguration
.
isExcludedFromAudit
(
config
,
requestHttpMethod
,
requestOperation
);
try
{
return
AtlasRepositoryConfiguration
.
isExcludedFromAudit
(
config
,
requestHttpMethod
,
requestOperation
);
}
catch
(
AtlasException
e
)
{
return
false
;
}
}
@Override
...
...
webapp/src/test/java/org/apache/atlas/web/filters/AuditFilterTest.java
View file @
9683c117
...
...
@@ -115,4 +115,11 @@ public class AuditFilterTest {
verify
(
filterChain
).
doFilter
(
servletRequest
,
servletResponse
);
}
@Test
public
void
testNullConfig
()
{
AtlasRepositoryConfiguration
.
resetExcludedOperations
();
AuditFilter
auditFilter
=
new
AuditFilter
();
assertFalse
(
auditFilter
.
isOperationExcludedFromAudit
(
"GET"
,
"Version"
,
null
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment