Skip to content

Instantly share code, notes, and snippets.

View alopresto's full-sized avatar
🔏
Focusing on NiFi security...

Andy LoPresto alopresto

🔏
Focusing on NiFi security...
View GitHub Profile
@alopresto
alopresto / wwc_resources.md
Last active August 16, 2024 02:28
Women Who Code Resources

Contact me

Strategies

  • YAGNI vs. DRY
  • SOLID Principles
  • Ask clear questions -- explain what you have tried and what is not working
  • Don't reinvent the wheel -- evaluate best practices & existing solutions before attempting something novel
  • Follow conventions -- having the computer understand your code is easy; having other people understand your code is harder
  • Document & explain your decisions & understanding (even options you explored and did not select)
nifi (1785 s)
Run clean install on 2020/02/21 20:45:19 with parameters: {profile=true, surefire.skipAfterFailureCount=1}
nifi-standard-processors (357.6 s)
Plugin execution Duration
org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test {execution: default-test} 334.5 s
org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check {execution: check-style} 10.36 s
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile {execution: default-compile} 4.118 s
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile {execution: default-testCompile} 3.878 s
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile {execution: groovy-tests} 2.314 s
This file has been truncated, but you can view the full file.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Maven Profiler Report </title>
<style>
body {
padding: 30px 50px;
}
h1 {
@alopresto
alopresto / gpg_el_gamal_nifi_test.txt
Last active September 25, 2019 03:45
CLI output from performing GPG El Gamal exploration for NiFi PGP integration.
...rkspace/scratch/ (master) 😉
🔒 0s @ 17:39:57 $ gpg --no-default-keyring --keyring ./nifi-unit-test-small-dsa.gpg --full-generate-key -vv
gpg: keybox './nifi-unit-test-small-dsa.gpg' created
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 2
DSA keys may be between 1024 and 3072 bits long.
@alopresto
alopresto / GroovyProcessor.groovy
Created August 27, 2019 20:15
Sample Apache NiFi custom processor written in Groovy.
class GroovyProcessor implements Processor {
def REL_SUCCESS = new Relationship.Builder().name("success")
.description("FlowFiles that were successfully processed").build()
def ProcessorLog log
@Override
void initialize(ProcessorInitializationContext context) {
log = context.getLogger()
}
🔓 16s @ 20:33:44 $ cat logs/nifi-user.log
2019-06-18 19:06:15,032 INFO [main] o.a.n.a.FileUserGroupProvider Creating new users file at /Users/alopresto/Workspace/nifi/nifi-assembly/target/nifi-1.10.0-SNAPSHOT-bin/nifi-1.10.0-SNAPSHOT/./conf/users.xml
2019-06-18 19:06:15,040 DEBUG [main] o.a.n.a.util.IdentityMappingUtil Identity Mapping property nifi.security.identity.mapping.pattern.dn was found, but no transform was present. Using NONE.
2019-06-18 19:06:15,042 DEBUG [main] o.a.n.a.util.IdentityMappingUtil Found Identity Mapping with key = dn, pattern = (?i)^CN=([^,]*),.*$, value = $1, transform = NONE
2019-06-18 19:06:15,046 INFO [main] o.a.n.a.FileUserGroupProvider Users/Groups file loaded at Tue Jun 18 19:06:15 PDT 2019
2019-06-18 19:06:15,048 DEBUG [main] o.a.nifi.authorization.util.ShellRunner Run Command '<unknown>': [sh, -c, which dscl]
2019-06-18 19:06:15,067 DEBUG [main] o.a.nifi.authorization.util.ShellRunner Run Command 'Get Users List': [sh, -c, dscl . -readall /Users UniqueID PrimaryGroupID | awk
@alopresto
alopresto / NIFI-5973_authorizations.xml
Created June 19, 2019 03:31
authorizations.xml file generated automatically when testing NIFI-5973.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<authorizations>
<policies>
<policy identifier="f99bccd1-a30e-3e4a-98a2-dbc708edc67f" resource="/flow" action="R">
<user identifier="502"/>
</policy>
<policy identifier="b8775bd4-704a-34c6-987b-84f2daf7a515" resource="/restricted-components" action="W">
<user identifier="502"/>
</policy>
<policy identifier="627410be-1717-35b4-a06f-e9362b89e0b7" resource="/tenants" action="R">
# 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
@alopresto
alopresto / NIFI-5973_login-identity-providers.xml
Created June 19, 2019 03:28
login-identity-providers.xml for testing NIFI-5973.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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
@alopresto
alopresto / NIFI-5973_authorizers.xml
Created June 19, 2019 03:27
authorizers.xml file for testing NIFI-5973.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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