/** * Checks if a property with the given key is sensitive. The key must be for a valid property, and * must either itself be annotated as sensitive or have a prefix annotated as sensitive. * * @param key * property key * @return true if property is sensitive */ public static boolean isSensitive(String key) { Property prop = propertiesByKey.get(key); if (prop != null) { return prop.isSensitive(); } else { for (String prefix : validPrefixes) { if (key.startsWith(prefix)) { if (propertiesByKey.get(prefix).isSensitive()) { return true; } } } } return false; }
private Map<String,String> conf(TCredentials credentials, AccumuloConfiguration conf) throws TException { security.authenticateUser(credentials, credentials); conf.invalidateCache(); Map<String,String> result = new HashMap<>(); for (Entry<String,String> entry : conf) { String key = entry.getKey(); if (!Property.isSensitive(key)) result.put(key, entry.getValue()); } return result; }
@Override public void parseArgs(String programName, String[] args, Object... others) { super.parseArgs(programName, args, others); if (getOverrides().size() > 0) { log.info("The following configuration was set on the command line:"); for (Map.Entry<String,String> entry : getOverrides().entrySet()) { String key = entry.getKey(); log.info(key + " = " + (Property.isSensitive(key) ? "<hidden>" : entry.getValue())); } } } }
public String getTableConfig(String key) { Property property = Property.getPropertyByKey(key); if (property == null || property.isSensitive()) throw new RuntimeException("Unable to access the configuration value " + key); return tableConfig.get(property); }
hadoopConf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credProvider); for (Property property : Property.values()) { if (property.isSensitive()) { char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf, property.getKey());
log.info("{} = {}", key, (Property.isSensitive(key) ? "<hidden>" : entry.getValue())); Property prop = Property.getPropertyByKey(key); if (prop != null && conf.isPropertySet(prop, false)) {
if (Property.isValidZooPropertyKey(key)) { SystemPropUtil.setSystemProperty(context, key, value); log.info("Uploaded - {} = {}", key, Property.isSensitive(key) ? "<hidden>" : value); } else { log.info("Skipped - {} = {}", key, Property.isSensitive(key) ? "<hidden>" : value);
if (hadoopConf != null) { for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) { if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) { continue;
if (property.isSensitive()) { org.apache.hadoop.conf.Configuration hadoopConf = getHadoopConfiguration(); if (hadoopConf != null) {
/** * Checks if a property with the given key is sensitive. The key must be for a valid property, and * must either itself be annotated as sensitive or have a prefix annotated as sensitive. * * @param key * property key * @return true if property is sensitive */ public static boolean isSensitive(String key) { Property prop = propertiesByKey.get(key); if (prop != null) { return prop.isSensitive(); } else { for (String prefix : validPrefixes) { if (key.startsWith(prefix)) { if (propertiesByKey.get(prefix).isSensitive()) { return true; } } } } return false; }
private Map<String,String> conf(TCredentials credentials, AccumuloConfiguration conf) throws TException { security.authenticateUser(credentials, credentials); conf.invalidateCache(); Map<String,String> result = new HashMap<>(); for (Entry<String,String> entry : conf) { String key = entry.getKey(); if (!Property.isSensitive(key)) result.put(key, entry.getValue()); } return result; }
public String getTableConfig(String key) { Property property = Property.getPropertyByKey(key); if (property == null || property.isSensitive()) throw new RuntimeException("Unable to access the configuration value " + key); return tableConfig.get(property); }
if (!Property.isSensitive(entry.getKey())) { continue;
@Override public void getProperties(Map<String,String> props, Predicate<String> filter) { parent.getProperties(props, filter); for (Entry<String,String> entry : getXmlConfig()) if (filter.apply(entry.getKey())) props.put(entry.getKey(), entry.getValue()); // CredentialProvider should take precedence over site Configuration hadoopConf = getHadoopConfiguration(); if (null != hadoopConf) { try { for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) { if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) { continue; } if (filter.apply(key)) { char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf, key); if (null != value) { props.put(key, new String(value)); } } } } catch (IOException e) { log.warn("Failed to extract sensitive properties from Hadoop" + " CredentialProvider, falling back to accumulo-site.xml", e); } } }
log.info(key + " = " + (Property.isSensitive(key) ? "<hidden>" : entry.getValue()));
try { for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) { if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) { continue;
if (property.isSensitive()) { Configuration hadoopConf = getHadoopConfiguration(); if (null != hadoopConf) {
if (property.isSensitive()) { org.apache.hadoop.conf.Configuration hadoopConf = getHadoopConfiguration(); if (null != hadoopConf) {