Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hadoop.fs.audit;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;

/**
* Constants related to auditing.
*/
@InterfaceAudience.Private
@InterfaceStability.Unstable
public final class AuditConstants {

private AuditConstants() {
}

/**
* The host from where requests originate: {@value}.
* example.org is used as the IETF require that it never resolves.
* This isn't always met by some mobile/consumer DNS services, but
* we don't worry about that. What is important is that
* a scan for "example.org" in the logs will exclusively find
* entries from this referrer.
*/
public static final String REFERRER_ORIGIN_HOST = "audit.example.org";

/**
* Header: Command: {@value}.
* Set by tool runner.
*/
public static final String PARAM_COMMAND = "cm";

/**
* Header: FileSystem ID: {@value}.
*/
public static final String PARAM_FILESYSTEM_ID = "fs";

/**
* Header: operation ID: {@value}.
*/
public static final String PARAM_ID = "id";

/**
* JobID query header: {@value}.
*/
public static final String PARAM_JOB_ID = "ji";

/**
* Header: operation: {@value}.
* These should be from StoreStatisticNames or similar,
* and are expected to be at the granularity of FS
* API operations.
*/
public static final String PARAM_OP = "op";

/**
* Header: first path of operation: {@value}.
*/
public static final String PARAM_PATH = "p1";

/**
* Header: second path of operation: {@value}.
*/
public static final String PARAM_PATH2 = "p2";

/**
* Header: Principal: {@value}.
*/
public static final String PARAM_PRINCIPAL = "pr";

/**
* Header: Process ID: {@value}.
*/
public static final String PARAM_PROCESS = "ps";

/**
* Thread 0: the thread which created a span {@value}.
*/
public static final String PARAM_THREAD0 = "t0";

/**
* Thread 1: the thread making the S3 request: {@value}.
*/
public static final String PARAM_THREAD1 = "t1";

/**
* Timestamp of span creation: {@value}.
*/
public static final String PARAM_TIMESTAMP = "ts";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hadoop.fs.audit;

/**
* Statistic Names for Auditing.
*/
public final class AuditStatisticNames {

private AuditStatisticNames() {
}

/**
* Audit failure: {@value}.
*/
public static final String AUDIT_FAILURE = "audit_failure";

/**
* A request was executed and the auditor invoked: {@value}.
*/
public static final String AUDIT_REQUEST_EXECUTION
= "audit_request_execution";

/**
* Audit span created: {@value}.
*/
public static final String AUDIT_SPAN_CREATION = "audit_span_creation";

/**
* Access check during audit rejected: {@value}.
*/
public static final String AUDIT_ACCESS_CHECK_FAILURE
= "audit_access_check_failure";
}
Loading