Added logging for security audits.
This commit is contained in:
@@ -56,7 +56,7 @@ public enum AEFeature
|
|||||||
|
|
||||||
enableDisassemblyCrafting("Crafting"), MolecularAssembler("CraftingFeatures"), MeteoriteCompass("Tools"), Patterns("CraftingFeatures"),
|
enableDisassemblyCrafting("Crafting"), MolecularAssembler("CraftingFeatures"), MeteoriteCompass("Tools"), Patterns("CraftingFeatures"),
|
||||||
|
|
||||||
ChunkLoggerTrace("Commands", false);
|
ChunkLoggerTrace("Commands", false), LogSecurityAudits("Misc", false);
|
||||||
|
|
||||||
String Category;
|
String Category;
|
||||||
boolean visible = true;
|
boolean visible = true;
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ import appeng.api.networking.IGridNode;
|
|||||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||||
import appeng.api.networking.pathing.IPathingGrid;
|
import appeng.api.networking.pathing.IPathingGrid;
|
||||||
import appeng.api.util.IReadOnlyCollection;
|
import appeng.api.util.IReadOnlyCollection;
|
||||||
|
import appeng.core.AEConfig;
|
||||||
|
import appeng.core.AELog;
|
||||||
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.me.pathfinding.IPathItem;
|
import appeng.me.pathfinding.IPathItem;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import appeng.util.ReadOnlyCollection;
|
import appeng.util.ReadOnlyCollection;
|
||||||
@@ -34,7 +37,15 @@ public class GridConnection implements IGridConnection, IPathItem
|
|||||||
GridNode b = (GridNode) bNode;
|
GridNode b = (GridNode) bNode;
|
||||||
|
|
||||||
if ( Platform.securityCheck( a, b ) )
|
if ( Platform.securityCheck( a, b ) )
|
||||||
|
{
|
||||||
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.LogSecurityAudits ) )
|
||||||
|
{
|
||||||
|
AELog.info( "Audit Failed 1: " + a.getGridBlock().getLocation() );
|
||||||
|
AELog.info( "Audit Failed 2: " + b.getGridBlock().getLocation() );
|
||||||
|
}
|
||||||
|
|
||||||
throw new FailedConnection();
|
throw new FailedConnection();
|
||||||
|
}
|
||||||
|
|
||||||
if ( a == null || b == null )
|
if ( a == null || b == null )
|
||||||
throw new GridException( "Connection Forged Between null enties." );
|
throw new GridException( "Connection Forged Between null enties." );
|
||||||
|
|||||||
@@ -1504,6 +1504,11 @@ public class Platform
|
|||||||
boolean a_isSecure = isPowered( a.getGrid() ) && a.lastSecurityKey != -1;
|
boolean a_isSecure = isPowered( a.getGrid() ) && a.lastSecurityKey != -1;
|
||||||
boolean b_isSecure = isPowered( b.getGrid() ) && b.lastSecurityKey != -1;
|
boolean b_isSecure = isPowered( b.getGrid() ) && b.lastSecurityKey != -1;
|
||||||
|
|
||||||
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.LogSecurityAudits ) )
|
||||||
|
{
|
||||||
|
AELog.info( "Audit: " + a_isSecure + " : " + b_isSecure + " @ " + a.lastSecurityKey + " vs " + b.lastSecurityKey );
|
||||||
|
}
|
||||||
|
|
||||||
// can't do that son...
|
// can't do that son...
|
||||||
if ( a_isSecure && b_isSecure )
|
if ( a_isSecure && b_isSecure )
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user